[Gc] Windows crash
jules at acris.co.uk
Wed Jun 29 06:30:44 PDT 2005
Julian Hall wrote:
> I'm using GC 6.5, compiled to a windows DLL using cygwin gcc with the
> -mno-cygwin flag.
> I have a relatively simple program that uses GC to allocate a few
> objects and strings while responding to GUI events, and which calls
> GC_collect_a_little after processing each event until either
> PeekMessage returns true, or GC_collect_a_little returns false.
> If I enable incremental collection, I occasionally get an exception
> C0000096 (Illegal Instruction in non-priveleged mode) while executing
> code inside NTDLL.DLL.
D'oh! Ignore me. In converting my program from refcounting I'd missed
converting a malloc to a GC_malloc, so one of my objects was being
collected during execution, causing the program to follow a random
pointer and execute OS code in a user context. Incremental collection
merely made it happen faster.
What should have given this away is that my code shouldn't have been
executing anything in NTDLL.DLL, as the only OS library it was
interfacing with in the code executing at the time was USER32.
More information about the Gc