Changeset 229338 in webkit
- Timestamp:
- Mar 6, 2018 12:53:52 PM (6 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r229330 r229338 1 2018-03-06 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r229330. 4 https://bugs.webkit.org/show_bug.cgi?id=183379 5 6 Broke some Apple internal code (Requested by ap on #webkit). 7 8 Reverted changeset: 9 10 "Remove unused crash hook functionality" 11 https://bugs.webkit.org/show_bug.cgi?id=183369 12 https://trac.webkit.org/changeset/229330 13 1 14 2018-03-06 Michael Catanzaro <mcatanzaro@igalia.com> 2 15 -
trunk/Source/WTF/wtf/Assertions.cpp
r229330 r229338 252 252 } 253 253 254 static WTFCrashHookFunction globalHook = 0; 255 256 void WTFSetCrashHook(WTFCrashHookFunction function) 257 { 258 globalHook = function; 259 } 260 254 261 #if !defined(NDEBUG) || !OS(DARWIN) 255 262 void WTFCrash() 256 263 { 264 if (globalHook) 265 globalHook(); 266 257 267 WTFReportBacktrace(); 258 268 #if ASAN_ENABLED … … 281 291 { 282 292 CRASH(); 293 } 294 295 #if HAVE(SIGNAL_H) 296 static NO_RETURN void dumpBacktraceSignalHandler(int sig) 297 { 298 WTFReportBacktrace(); 299 exit(128 + sig); 300 } 301 302 static void installSignalHandlersForFatalErrors(void (*handler)(int)) 303 { 304 signal(SIGILL, handler); // 4: illegal instruction (not reset when caught). 305 signal(SIGTRAP, handler); // 5: trace trap (not reset when caught). 306 signal(SIGFPE, handler); // 8: floating point exception. 307 signal(SIGBUS, handler); // 10: bus error. 308 signal(SIGSEGV, handler); // 11: segmentation violation. 309 signal(SIGSYS, handler); // 12: bad argument to system call. 310 signal(SIGPIPE, handler); // 13: write on a pipe with no reader. 311 signal(SIGXCPU, handler); // 24: exceeded CPU time limit. 312 signal(SIGXFSZ, handler); // 25: exceeded file size limit. 313 } 314 315 static void resetSignalHandlersForFatalErrors() 316 { 317 installSignalHandlersForFatalErrors(SIG_DFL); 318 } 319 #endif 320 321 void WTFInstallReportBacktraceOnCrashHook() 322 { 323 #if HAVE(SIGNAL_H) 324 // Needed otherwise we are going to dump the stack trace twice 325 // in case we hit an assertion. 326 WTFSetCrashHook(&resetSignalHandlersForFatalErrors); 327 installSignalHandlersForFatalErrors(&dumpBacktraceSignalHandler); 328 #endif 283 329 } 284 330 -
trunk/Source/WTF/wtf/Assertions.h
r229330 r229338 201 201 WTF_EXPORT_PRIVATE void WTFPrintBacktrace(void** stack, int size); 202 202 203 typedef void (*WTFCrashHookFunction)(void); 204 WTF_EXPORT_PRIVATE void WTFSetCrashHook(WTFCrashHookFunction); 205 WTF_EXPORT_PRIVATE void WTFInstallReportBacktraceOnCrashHook(void); 206 203 207 WTF_EXPORT_PRIVATE bool WTFIsDebuggerAttached(void); 204 208
Note: See TracChangeset
for help on using the changeset viewer.