Skip to content
Snippets Groups Projects
Commit 6b15bf28 authored by Simon McVittie's avatar Simon McVittie
Browse files

utils: Don't reset SIGBUS, SIGFPE, SIGSEGV handlers under AddressSanitizer


AddressSanitizer sets handlers for these signals to provide better
diagnostics.

Fixes: 52e494e5 "utils: Unignore all signals, not just the ones Steam historically altered"
Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent ba3eab48
No related branches found
No related tags found
1 merge request!622utils: Don't reset SIGBUS, SIGFPE, SIGSEGV handlers under AddressSanitizer
Pipeline #65609 passed
......@@ -41,6 +41,12 @@
#include <steam-runtime-tools/macros.h>
#include <steam-runtime-tools/glib-backports-internal.h>
#ifdef __has_feature
#define _srt_compiler_has_feature __has_feature
#else
#define _srt_compiler_has_feature(x) (0)
#endif
typedef enum
{
SRT_HELPER_FLAGS_SEARCH_PATH = (1 << 0),
......
......@@ -713,6 +713,15 @@ _srt_unblock_signals (void)
if (sig == SIGKILL || sig == SIGSTOP)
continue;
#if defined(__SANITIZE_ADDRESS__) || _srt_compiler_has_feature(address_sanitizer)
/* AddressSanitizer sets handlers for these signals during startup.
* Leave those in place, and don't show a warning for them. */
if ((sig == SIGBUS || sig == SIGFPE || sig == SIGSEGV)
&& sigaction (sig, NULL, &old_action) == 0
&& old_action.sa_handler != SIG_IGN)
continue;
#endif
if (sigaction (sig, &new_action, &old_action) != 0)
{
saved_errno = errno;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment