[PATCH] ntdll: Block SIGTRAP during server calls.
This prevents issues with gdbproxy, where gdb adds breakpoints to the dynamic loader which get triggered on thread destruction. It also allows setting a gdb breakpoint in sigaction(). Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45070 Signed-off-by: Huw Davies <huw(a)codeweavers.com> --- dlls/ntdll/server.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c index ec03445..689f0e7 100644 --- a/dlls/ntdll/server.c +++ b/dlls/ntdll/server.c @@ -1399,6 +1399,9 @@ void server_init_process(void) sigaddset( &server_block_set, SIGUSR1 ); sigaddset( &server_block_set, SIGUSR2 ); sigaddset( &server_block_set, SIGCHLD ); +#ifdef SIGTRAP + sigaddset( &server_block_set, SIGTRAP ); +#endif pthread_sigmask( SIG_BLOCK, &server_block_set, NULL ); /* receive the first thread request fd on the main socket */ -- 2.7.4
On 15 Oct 2018, at 15:08, Huw Davies <huw(a)codeweavers.com> wrote:
This prevents issues with gdbproxy, where gdb adds breakpoints to the dynamic loader which get triggered on thread destruction. It also allows setting a gdb breakpoint in sigaction().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45070 Signed-off-by: Huw Davies <huw(a)codeweavers.com> --- dlls/ntdll/server.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c index ec03445..689f0e7 100644 --- a/dlls/ntdll/server.c +++ b/dlls/ntdll/server.c @@ -1399,6 +1399,9 @@ void server_init_process(void) sigaddset( &server_block_set, SIGUSR1 ); sigaddset( &server_block_set, SIGUSR2 ); sigaddset( &server_block_set, SIGCHLD ); +#ifdef SIGTRAP + sigaddset( &server_block_set, SIGTRAP ); +#endif pthread_sigmask( SIG_BLOCK, &server_block_set, NULL );
/* receive the first thread request fd on the main socket */
Hmm, this can't work as the debugger needs to handle the overwritten opcode. Sorry for the noise. Huw.
participants (1)
-
Huw Davies