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.