[Gc] FW: MinGW/msys on Windows 32 and 64 bit using pthreads-win32

Boehm, Hans hans.boehm at hp.com
Tue Jun 12 07:05:50 PDT 2012


Forwarding, since I'm travelling , and can't easily approve this.

Hans

From: Eduard Urbach [mailto:e.urbach at googlemail.com]


Hello,

I've been using Boehm GC successfully under Linux/Debian systems and I thought the Windows versions was working as well until I tried it on 64 bit systems. I am using these options:

./configure --enable-cplusplus --enable-threads=posix --enable-thread-local-alloc --enable-parallel-mark

Before including the GC:

            #ifdef _WIN32
                        #define GC_WIN32_PTHREADS
            #else
                        #define GC_THREADS
            #endif

            #define GC_OPERATOR_NEW_ARRAY
            #define PARALLEL_MARK
            #define USE_LIBC_PRIVATE

            // PThreads
            #ifndef _REENTRANT
                        #define _REENTRANT
            #endif

            #ifndef _MULTI_THREADED
                        #define _MULTI_THREADED
            #endif

            #ifdef _WIN32
                        #include "../gc-7.3/gc_cpp.h"
            #else
                        #include "../gc/gc_cpp.h"
            #endif

I wrote a program which creates 4 threads where each thread creates a lot of objects, if you want to test it you can download it here: http://blitzprog.org/downloads/windows and run bp.Compiler.Benchmark in multithreaded mode.
On Win64 when I run it in multithreaded mode I get a message box saying GetThreadContext() failed. A quick google search showed me I'm not the only one having this problem and it seems to be related to WOW64.

Compiling the GC with different configure options and compilers gave the following results:

---------------------------------------------------------------------------------------------------------

MinGW 32, GCC 4.6, Threads = win32, 64-bit host system, GC 7.3alpha2
 --> gctest crashes, rest works

MinGW 32, GCC 4.7, Threads = win32, 64-bit host system, GC 7.3alpha2
 --> 3 tests fail, rest works (all threading related tests iirc, e.g. threadleaks)

MinGW 64, GCC 4.7, Threads = posix, 64-bit host system, GC 7.3alpha2
 --> Compile error (sorry for not having saved it...)

---------------------------------------------------------------------------------------------------------

MinGW 32, GCC 4.6, Threads = win32, 32-bit host system, GC 7.2
 --> all tests pass, however I need pthreads-win32

MinGW 32, GCC 4.6, Threads = posix, 32-bit host system, GC 7.2
 --> Configure fails, can't get it to use pthreads-win32

MinGW 32, GCC 4.6, Threads = posix, 32-bit host system, GC 7.3alpha2
 --> 1 test fails (threadleaks crashes) but my multithreaded test application is running fine
 --> The same application run on 64-bit Windows leads to a message box saying GetThreadContext() failed

---------------------------------------------------------------------------------------------------------

Basically I am trying to find a way to get the GC running with pthreads-win32 on 32- and 64-Bit Windows using either MinGW 32 or MinGW 64, whatever works. I am not really interested in building native 64-bit binaries for Windows but I want my 32-bit applications to run normally on a 64-bit system.

I am willing to help out if you need more information, I have a 32- and 64-bit Windows system running and both lead to at least 1 test failing on make check. On Debian/Ubuntu everything works fine, though :)

Regards,
Eduard Urbach
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://napali.hpl.hp.com/pipermail/gc/attachments/20120612/a2e00e29/attachment.htm


More information about the Gc mailing list