2013/12/5 Fanael Linithien <[email protected]>:
> I came up with a patch that fixes the issue for me.
>
> The patch replaces the global critical section with a spinlock.
> Critical sections require explicit initialization before use, which in
> this case is not possible: register_frame_ctor (from libgcc), which
> runs BEFORE enter_global_cs, tries to lock a mutex, which requires a
> spinlock, which needs to be initialized in static_spin_init, which
> tries to enter the global critical section, which is not initialized.
> The result is a segfault somewhere in ntdll.
>
> register_frame_ctor has constructor priority of 0, so setting the
> priority of global_spin_ctor wouldn't cut it.
>
>
> I'm not sure what is the official way to send patches, so I'm posting it here.

Nice catch.  This describes at least the runtime-failure we got reported.
Did you tested regressions for this patch?

The only thing about using memory-based spinlocking is that we might
introduce race-condtion.  So we should at least verify for this.

Kai

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to