https://bugs.winehq.org/show_bug.cgi?id=52213
--- Comment #7 from Giovanni Mascellani gmascellani@codeweavers.com --- I updated the debugging patch so that the crash is displayed in a minimal example, without involving winegstreamer which is not the real problem here.
The crash seems to happen because pthread_exit() is called inside a signal handler (which is executed in an alternate stack). Basically, the only thing pthread_exit() is supposed to do is to launch an internal exception to unwind the stack, and it might be unable to properly handle being on an alternate stack.
The new debugging patch has a sleep() call before exit(), because otherwise the exit_group() call might arrive before SIGSEGV is delivered and the segmentation fault might be hidden. With this sleep() call the crash is consistently reproducible on my system.