[Mono-list] gc handles not thread safe?

Rodrigo Kumpera kumpera at gmail.com
Thu Oct 17 12:40:13 UTC 2013


As long as it crashes, it's fine.


On Wed, Oct 16, 2013 at 11:48 PM, Chris Ochs <chris at ochsnet.com> wrote:

> It's pretty much impossible to provide a test case that doesn't involve
> installing Akka.   I could probably provide a self contained bundle that
> someone could just run from the command line that would trigger it, using
> as little java/akka as possible.
>
> Chris
>
>
>
>
> On Wed, Oct 16, 2013 at 8:20 PM, Rodrigo Kumpera <kumpera at gmail.com>wrote:
>
>> GC Handles are thread safe as they are used all the time by Xamarin's
>> products.
>>
>> The best line of approach here is to file a bug report with a test case,
>> that's how you get a possible mono bug fixed.
>>
>>
>> On Wed, Oct 16, 2013 at 10:56 PM, Chris Ochs <chris at ochsnet.com> wrote:
>>
>>> I'm embedding mono in a java app and when using gchandles it's obvious
>>> that memory is getting stomped on somehow.  When I don't use gc handles, or
>>> just use gc handles within a single thread, everything is fine.
>>>
>>> The same gc handle is never accessed concurrently from different
>>> threads, although I do pass them around to different threads.
>>>
>>> Reading/writing memory streams triggers the problem regularly, it
>>> usually segfaults in BlockCopy with various errors about the stream not
>>> containing the expected data, or sometimes division by zero.
>>>
>>> I'm fairly sure the code that handles threading is not at fault, I'm
>>> using Akka which has a well established concurrency model I don't
>>> explicitly create any threads myself.
>>>
>>> FYI I see this in mono 2 and the latest mono 3 from master.
>>>
>>> Is there another technique I can use to keep a MonoObject around and
>>> keep the gc from collecting it without using gc handles?   I was thinking
>>> of just having a thread safe dictionary in C# that keeps references to
>>> these objects, and just make all my calls into managed code via static
>>> methods that can get the object and call methods on it in C#.
>>>
>>> Chris
>>>
>>> _______________________________________________
>>> Mono-list maillist  -  Mono-list at lists.ximian.com
>>> http://lists.ximian.com/mailman/listinfo/mono-list
>>>
>>>
>>
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20131017/250a42aa/attachment.html>


More information about the Mono-list mailing list