Title: [263082] trunk
Revision
263082
Author
[email protected]
Date
2020-06-16 01:32:46 -0700 (Tue, 16 Jun 2020)

Log Message

Add SIGABRT handler for non OS(DARWIN) builds to the jsc shell with the -s option.
https://bugs.webkit.org/show_bug.cgi?id=213200

Reviewed by Michael Catanzaro.

JSTests:

* stress/ensure-crash.js:
- unskip this test since expected crashes should now be handled on non-darwin builds.

Source/_javascript_Core:

This is needed because non OS(DARWIN) builds uses abort as their "CRASH"ing
mechanism.

* jsc.cpp:
(CommandLine::parseArguments):

Source/WTF:

* wtf/threads/Signals.h:
(WTF::toSystemSignal):
(WTF::fromSystemSignal):

Modified Paths

Diff

Modified: trunk/JSTests/ChangeLog (263081 => 263082)


--- trunk/JSTests/ChangeLog	2020-06-16 07:29:44 UTC (rev 263081)
+++ trunk/JSTests/ChangeLog	2020-06-16 08:32:46 UTC (rev 263082)
@@ -1,3 +1,13 @@
+2020-06-16  Mark Lam  <[email protected]>
+
+        Add SIGABRT handler for non OS(DARWIN) builds to the jsc shell with the -s option.
+        https://bugs.webkit.org/show_bug.cgi?id=213200
+
+        Reviewed by Michael Catanzaro.
+
+        * stress/ensure-crash.js:
+        - unskip this test since expected crashes should now be handled on non-darwin builds.
+
 2020-06-15  Tadeu Zagallo  <[email protected]>
 
         Bytecode liveness should be aware of checkpoints

Modified: trunk/JSTests/stress/ensure-crash.js (263081 => 263082)


--- trunk/JSTests/stress/ensure-crash.js	2020-06-16 07:29:44 UTC (rev 263081)
+++ trunk/JSTests/stress/ensure-crash.js	2020-06-16 08:32:46 UTC (rev 263082)
@@ -1,4 +1,3 @@
-//@ skip if ["arm", "mips"].include?($architecture)
 //@ crashOK!
 
 $vm.crash();

Modified: trunk/Source/_javascript_Core/ChangeLog (263081 => 263082)


--- trunk/Source/_javascript_Core/ChangeLog	2020-06-16 07:29:44 UTC (rev 263081)
+++ trunk/Source/_javascript_Core/ChangeLog	2020-06-16 08:32:46 UTC (rev 263082)
@@ -1,3 +1,16 @@
+2020-06-16  Mark Lam  <[email protected]>
+
+        Add SIGABRT handler for non OS(DARWIN) builds to the jsc shell with the -s option.
+        https://bugs.webkit.org/show_bug.cgi?id=213200
+
+        Reviewed by Michael Catanzaro.
+
+        This is needed because non OS(DARWIN) builds uses abort as their "CRASH"ing
+        mechanism.
+
+        * jsc.cpp:
+        (CommandLine::parseArguments):
+
 2020-06-15  Michael Catanzaro  <[email protected]>
 
         WTF signal machinery is guarded by #if USE(PTHREADS) && HAVE(MACHINE_CONTEXT) but does not use pthreads or machine context

Modified: trunk/Source/_javascript_Core/jsc.cpp (263081 => 263082)


--- trunk/Source/_javascript_Core/jsc.cpp	2020-06-16 07:29:44 UTC (rev 263081)
+++ trunk/Source/_javascript_Core/jsc.cpp	2020-06-16 08:32:46 UTC (rev 263082)
@@ -2997,7 +2997,12 @@
             activateSignalHandlersFor(Signal::AccessFault);
             activateSignalHandlersFor(Signal::FloatingPoint);
             activateSignalHandlersFor(Signal::Breakpoint);
+
+#if !OS(DARWIN)
+            addSignalHandler(Signal::Abort, SignalHandler(exit));
+            activateSignalHandlersFor(Signal::Abort);
 #endif
+#endif
             continue;
         }
         if (!strcmp(arg, "-x")) {

Modified: trunk/Source/WTF/ChangeLog (263081 => 263082)


--- trunk/Source/WTF/ChangeLog	2020-06-16 07:29:44 UTC (rev 263081)
+++ trunk/Source/WTF/ChangeLog	2020-06-16 08:32:46 UTC (rev 263082)
@@ -1,3 +1,14 @@
+2020-06-16  Mark Lam  <[email protected]>
+
+        Add SIGABRT handler for non OS(DARWIN) builds to the jsc shell with the -s option.
+        https://bugs.webkit.org/show_bug.cgi?id=213200
+
+        Reviewed by Michael Catanzaro.
+
+        * wtf/threads/Signals.h:
+        (WTF::toSystemSignal):
+        (WTF::fromSystemSignal):
+
 2020-06-15  Michael Catanzaro  <[email protected]>
 
         WTF signal machinery is guarded by #if USE(PTHREADS) && HAVE(MACHINE_CONTEXT) but does not use pthreads or machine context

Modified: trunk/Source/WTF/wtf/threads/Signals.h (263081 => 263082)


--- trunk/Source/WTF/wtf/threads/Signals.h	2020-06-16 07:29:44 UTC (rev 263081)
+++ trunk/Source/WTF/wtf/threads/Signals.h	2020-06-16 08:32:46 UTC (rev 263082)
@@ -48,6 +48,9 @@
 
     // These signals will only chain if we don't have a handler that can process them. If there is nothing
     // to chain to we restore the default handler and crash.
+#if !OS(DARWIN)
+    Abort,
+#endif
     FloatingPoint,
     Breakpoint, // Be VERY careful with this, installing a handler for this will break lldb/gdb.
     IllegalInstruction,
@@ -64,6 +67,9 @@
     case Signal::Usr: return std::make_tuple(SIGILL, WTF::nullopt);
     case Signal::FloatingPoint: return std::make_tuple(SIGFPE, WTF::nullopt);
     case Signal::Breakpoint: return std::make_tuple(SIGTRAP, WTF::nullopt);
+#if !OS(DARWIN)
+    case Signal::Abort: return std::make_tuple(SIGABRT, WTF::nullopt);
+#endif
     default: break;
     }
     RELEASE_ASSERT_NOT_REACHED();
@@ -78,6 +84,9 @@
     case SIGTRAP: return Signal::Breakpoint;
     case SIGILL: return Signal::IllegalInstruction;
     case SIGUSR2: return Signal::Usr;
+#if !OS(DARWIN)
+    case SIGABRT: return Signal::Abort;
+#endif
     default: return Signal::Unknown;
     }
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to