https://bugs.winehq.org/show_bug.cgi?id=44820
Bug ID: 44820 Summary: Processes might terminate with incorrect exit code due to race-condition when threads are killed during shutdown Product: Wine Version: 3.4 Hardware: x86-64 OS: Linux Status: NEW Severity: normal Priority: P2 Component: ntdll Assignee: wine-bugs@winehq.org Reporter: focht@gmx.net Distribution: ---
Hello folks,
to track https://github.com/wine-staging/wine-staging/tree/master/patches/ntdll-Threa...
Unfortunately there is no further information/details, I just found this:
https://wine-staging.com/news/2015-03-07-release-1.7.38.html
-> https://github.com/wine-staging/wine-staging/blob/v1.7.38/debian/changelog
--- quote --- * Added patch to fix race-condition when threads are killed during shutdown. --- quote ---
https://github.com/wine-staging/wine-staging/blob/master/patches/ntdll-Threa...
--- quote --- When exit_thread is executed, nb_threads is decremented before the thread is fully shutdown. When another thread runs ExitProcess() this will cause a SIGQUIT signal to all threads, effectively decrementing nb_threads twice. The process will terminate with a wrong exitcode then because the refcount reaches zero too early.
Currently Wine has no locking protection of LdrShutdownProcess(), so it can only be executed safely when all other threads have terminated before. Most likely there are more Wine bugs in this area, but the attached patch should fix the most critical one (messed up refcounting of threads) for now. --- quote ---
Sadly no applications are mentioned that could be used to validate the problem.
$ wine --version wine-3.4
Regards
https://bugs.winehq.org/show_bug.cgi?id=44820
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |STAGED Staged patchset| |https://github.com/wine-sta | |ging/wine-staging/tree/mast | |er/patches/ntdll-Threading Keywords| |patch
https://bugs.winehq.org/show_bug.cgi?id=44820
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |austinenglish@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=44820
tokktokk fdsfgs@krutt.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fdsfgs@krutt.org