aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-unwind.c
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2024-12-13 18:36:34 +0100
committerTom de Vries <tdevries@suse.de>2024-12-13 18:36:34 +0100
commit2e792a78e495be6df4b8c0a3e41332c2f6dcd911 (patch)
tree96610bcb63f974158805a0a887d7802cdd58725e /gdb/python/py-unwind.c
parent7336a8977d81b7b8c00f2e8ccb8a084afb33b19a (diff)
downloadgdb-2e792a78e495be6df4b8c0a3e41332c2f6dcd911.zip
gdb-2e792a78e495be6df4b8c0a3e41332c2f6dcd911.tar.gz
gdb-2e792a78e495be6df4b8c0a3e41332c2f6dcd911.tar.bz2
[gdb] Fix tsan warning: signal handler spoils errno
When building gdb with -fsanitize=thread and running test-case gdb.base/bg-exec-sigint-bp-cond.exp, I run into: ... ==================^M WARNING: ThreadSanitizer: signal handler spoils errno (pid=25422)^M #0 handler_wrapper gdb/posix-hdep.c:66^M #1 decltype ({parm#2}({parm#3}...)) gdb::handle_eintr<>() \ gdbsupport/eintr.h:67^M #2 gdb::waitpid(int, int*, int) gdbsupport/eintr.h:78^M #3 run_under_shell gdb/cli/cli-cmds.c:926^M ... Likewise in: - tui_sigwinch_handler with test-case gdb.python/tui-window.exp, and - handle_sighup with test-case gdb.base/quit-live.exp. Fix this by saving the original errno, and restoring it before returning [1]. Tested on x86_64-linux. Approved-By: Tom Tromey <tom@tromey.com> [1] https://www.gnu.org/software/libc/manual/html_node/POSIX-Safety-Concepts.html
Diffstat (limited to 'gdb/python/py-unwind.c')
0 files changed, 0 insertions, 0 deletions