]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Handle SIGSYS and SIGSTKFLT when defined
authorMark Wielaard <mark@klomp.org>
Mon, 14 Jul 2025 22:00:44 +0000 (00:00 +0200)
committerMark Wielaard <mark@klomp.org>
Mon, 14 Jul 2025 22:24:00 +0000 (00:24 +0200)
Both signals were already partially handled. But calculate_SKSS_from_SCSS
only handled SIGSYS on freebsd. default_action didn't handle SIGSTKFLT.
And sync_signalhandler didn't expect to have to handle SIGSYS.

This fixes LTP tests kill11 and waitpid01.

https://bugs.kde.org/show_bug.cgi?id=506890

coregrind/m_signals.c

index cccbb568324638f9bb64a719fea0a527c23aa059..523f4d7fcbafceb2563a81f3eb6867e12823b047 100644 (file)
@@ -855,7 +855,7 @@ void calculate_SKSS_from_SCSS ( SKSS* dst )
       case VKI_SIGFPE:
       case VKI_SIGILL:
       case VKI_SIGTRAP:
-#if defined(VGO_freebsd)
+#if defined(VKI_SIGSYS)
       case VKI_SIGSYS:
 #endif
         /* For these, we always want to catch them and report, even
@@ -1832,6 +1832,9 @@ static void default_action(const vki_siginfo_t *info, ThreadId tid)
       case VKI_SIGPIPE:        /* term */
       case VKI_SIGALRM:        /* term */
       case VKI_SIGTERM:        /* term */
+#     if defined(VKI_SIGSTKFLT)
+      case VKI_SIGSTKFLT:      /* term */
+#     endif
       case VKI_SIGUSR1:        /* term */
       case VKI_SIGUSR2:        /* term */
       case VKI_SIGIO:  /* term */
@@ -3004,6 +3007,9 @@ void sync_signalhandler ( Int sigNo,
             || sigNo == VKI_SIGBUS
             || sigNo == VKI_SIGFPE
             || sigNo == VKI_SIGILL
+#if defined(VKI_SIGSYS)
+            || sigNo == VKI_SIGSYS
+#endif
             || sigNo == VKI_SIGTRAP);
 
    info->si_code = sanitize_si_code(info->si_code);