Re: [Gc] MinGW make check fails for gc-7.2alpha6

Ivan Maidanski ivmai at
Mon Aug 29 03:39:25 PDT 2011

Hi Ron,

Little time has been spent to make configure work right with Mingw (unlike cygwin). I have done some changes since v7.2alpha6 but I think they wont fix this.

The problem here is (as I've learned from config.h) that GC is built with Win32 native threads support (not win32pthreads) - GC_THREAD and no -lpthread is needed (unlike if -D GC_WIN32_PTHREADS is specified). Since the client creates a thread without using redirected _beginthreadex or CreateThread, that thread is not registered in GC.

The scripts should be adjusted to use a particular multi-threading API consistently. I think (but not sure) for Win32 this should be native Win32 threads.

Ron -
If you have some will to adjust configure for MinGW (or mingw-w64), it would be good if you send me a patch against the recent BDWGC snapshot (in Git).

PS. At present, if GC_WIN32_PTHREADS is set (or GC_THREADS for cygwin), only Win32 _beginthreadex and CreateThread are not redirected (nor the corresponding GC_beginthreadex and GC_CreateThread are compiled). Definitely, it would be good to compile and redirect them (although, I'm not sure it would be good to redirect Win32 CreateThread implicitly as it leads to windows.h file inclusion which is not pleasant to include implicitly at least on cygwin).


28 08 2011, 04:23 Ron Wright <logiconcepts819 at>:
> Hello,
> I was able to successfully compile the test code for gc, but when the tests ran, the thread leak test failed with a "Collecting from unknown thread" abort message.  Attached are the GDB log file of the test (with a breakpoint set at line 1373 of win32_threads.c) and the file include/private/config.h.
> By the way, the -lpthread flag was not added to the dependency list in (probably because I configured the build to be static, whereas libpthread is a shared library in MinGW), so I had to execute this command to make the tests compile:
> sed -i -e 's/^\(dependency_libs='\''.*\)\('\''\)$/\1 -lpthread\2/'
>  _______________________________________________

More information about the Gc mailing list