http://bugs.winehq.org/show_bug.cgi?id=24018
--- Comment #13 from Andrey Turkin andrey.turkin@gmail.com 2013-06-30 10:10:38 CDT --- Cygwin folks have fixed stack overflow bug; unfortunately the latest cygwin build still doesn't work as it should due to another regression. This one is a Wine bug. Basically it boils down to the fact that user APCs queued before starting process' WinMain (that is, queued in DllMain handlers and in TLS callbacks) should be executed after dlls are loaded, tls callbacks are executed, loader lock is released but before starting WinMain. Wine doesn't do that (which is not surprising given how Wine process startup differs from Windows') To properly fix this bug one would need to implement NtTestAlert (to make sure APC queue is empty). In meantime I attached a small hack which is enough to make Cygwin happy (with regard to this bug). With this hack and latest Cygwin snapshot cygwin's setup completes, though not entirely successfully - some of postinstall steps are failing.