https://bugs.winehq.org/show_bug.cgi?id=45070
Bug ID: 45070 Summary: closing threads causes "wine client error" and kills process when run under winedbg --gdb Product: Wine Version: 3.6 Hardware: x86 OS: Linux Status: NEW Severity: normal Priority: P2 Component: winedbg Assignee: wine-bugs@winehq.org Reporter: z.figura12@gmail.com Distribution: ---
Created attachment 61208 --> https://bugs.winehq.org/attachment.cgi?id=61208 test program showing problem
When run under winedbg in gdb mode, closing a thread consistently causes 'wine client error:30: write: Bad file descriptor', aborting the program.
The basic problem seems to be that gdb will inject breakpoints into dlopen() to allow hooking that function if desired. Normally this works fine, but this can also be triggered during thread teardown, i.e. inside of pthread_exit(). In this case we catch the SIGTRAP, but abort when we try to pass it along to wineserver, since we've already closed our file handle to the server pipe.
The obvious solution seems to be to block SIGTRAP during thread shutdown. Attempting this makes the 'bad file descriptor' message go away, but the process still gets killed prematurely. I haven't figured out why.
https://bugs.winehq.org/show_bug.cgi?id=45070
--- Comment #1 from Zebediah Figura z.figura12@gmail.com --- Altering trap_handler to ignore all traps seems to work, in that Wine doesn't abort after hitting this trap (but it also doesn't trap anywhere else, leaving gdb useless).
https://bugs.winehq.org/show_bug.cgi?id=45070
tokktokk fdsfgs@krutt.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fdsfgs@krutt.org
https://bugs.winehq.org/show_bug.cgi?id=45070
Rémi Bernon rbernon@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |rbernon@codeweavers.com
--- Comment #2 from Rémi Bernon rbernon@codeweavers.com --- I think the recently upstreamed winedbg patches may have changed the way gdb frontend interacts with the target process, and it possibly solved this issue.
https://bugs.winehq.org/show_bug.cgi?id=45070
Jinoh Kang jinoh.kang.kr@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jinoh.kang.kr@gmail.com
--- Comment #3 from Jinoh Kang jinoh.kang.kr@gmail.com --- Can reproduce in wine 7.12 (staging) while debugging foobar2000.exe.
https://bugs.winehq.org/show_bug.cgi?id=45070
Eric Pouech eric.pouech@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |eric.pouech@gmail.com
--- Comment #4 from Eric Pouech eric.pouech@gmail.com --- just tested both test program from #1 and foobar2000 and couldn't reproduce the error of bad descriptor
[eric:~/work/output-wine/bugzilla/bz45070]$ gdb --version GNU gdb (GDB) Fedora Linux 12.1-6.fc37
wine-8.0-rc2
foobar2000 1.6.14
https://bugs.winehq.org/show_bug.cgi?id=45070
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fgouget@codeweavers.com
--- Comment #5 from François Gouget fgouget@codeweavers.com --- The same "wine client error" message also happen during WineTest runs. Those seem to be tied to Windows-on-Windows modes too. See bug 54115 for more details.