Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Access violation in gcx.Gcx.mark

Moderators: kris

Posted: 12/09/09 12:52:25

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION(0xc0000005) at gcx.Gcx.mark (0x00464194) thread(1652)
->us
#0 void gcx.Gcx.mark(void*, void*, void*) () from gcx

Any idea what this is? I'm using some revision between 0.99.7 and 0.99.8. Thanks!

Author Message

Posted: 01/01/10 12:06:16

Is this scenario possible ->

Thread 1 is inside a C function call. Thread 2 causes the garbage collector to try suspend all threads. Thread 1 messes up because it is still inside the C function and GC is trying to suspend/mark/else stuff, so I get a crash ?

If so, how can I guarantee GC will not be triggered while C function is executing? Thanks!

Posted: 01/01/10 22:01:21

I think there is an old thread in this forum on this topic (wasn't you the originator, bobef?) - something about ffmod or similar. The solution is probably to register the thread used by the C library as a non D GC thread.

Posted: 01/03/10 16:47:29

Yes, I know. It was my thread, but this time it is FFMPEG which is single threaded. All calls originate from D threads, so something else is happening and I'm unable to track it...

Posted: 01/03/10 17:22:34

I found some more info. If I place try/catch at the point which triggers the garbage collection (which a function reading from HttpClient? if it matters) I get this exception "Unable to suspend thread" and tango.sys.Common.SysError?.lastMsg says "The recipient process has refused the signal." (code 156). Anyone knows what could cause this?

Posted: 01/03/10 18:18:54

Do you pass D GC allocated memory through those C functions? In which case you should try to not do that.