Comment 7 for bug 932487

Revision history for this message
Roy Tam (roytam) wrote : Re: [Bug 932487] Re: win32: git rev 59f971d crashes when accessing disk (coroutine issue)

2012/2/17 Stefan Weil <email address hidden>:
> The crash is caused by non-working thread local storage (TLS) in
> coroutine-win32.c.
>
> It took me some time to analyze this bug because I don't get it in my native w32 environment with gcc-4.6.2,
> but I could reproduce it with cross compiled w32 code.  SwitchToFiber crashed because it was called with a
> TIB (http://en.wikipedia.org/wiki/Win32_Thread_Information_Block) which belonged to a thread which was
> not converted to a fiber. ConvertThreadToFiber was not called for this thread because TLS "current" was
> not thread local.
>
> Please try these modified configure option which adds the compiler flag needed for multithreading:
> --extra-cflags="-O0 -pipe -mthreads". For me, -mthreads solved the problem.
>

Yes "-mthreads" switch does workaround the issue.
But using "-mthreads" making resulting binaries depend on
mingwm10.dll, which is not good.

> Regards,
> Stefan Weil