Changeset 94955 in webkit
- Timestamp:
- Sep 12, 2011 7:20:07 AM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r94923 r94955 1 2011-09-12 Balazs Kelemen <kbalazs@webkit.org> 2 3 [Qt][WK2] WebKitTestRunner does not produce crash logs 4 https://bugs.webkit.org/show_bug.cgi?id=67714 5 6 Added a simple way of generating backtrace on crash 7 to the web process. The implementation is similar what 8 we have in DRT. It depends on GNU libc functionality 9 so it is only enabled where we are running in such an environment. 10 11 * WebKitTestRunner/InjectedBundle/qt/InjectedBundleQt.cpp: 12 (WTR::printBacktrace): 13 (WTR::crashHandler): 14 (WTR::InjectedBundle::platformInitialize): 15 1 16 2011-09-11 Filip Pizlo <fpizlo@apple.com> 2 17 -
trunk/Tools/WebKitTestRunner/InjectedBundle/qt/InjectedBundleQt.cpp
r81135 r94955 1 1 /* 2 2 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 University of Szeged. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 26 27 #include "config.h" 27 28 #include "InjectedBundle.h" 29 #include <stdio.h> 30 #include <stdlib.h> 31 #include <wtf/AlwaysInline.h> 32 33 #if HAVE(SIGNAL_H) 34 #include <signal.h> 35 #endif 36 37 #if defined(__GLIBC__) && !defined(__UCLIBC__) 38 #include <execinfo.h> 39 #endif 28 40 29 41 namespace WTR { 30 42 43 static inline void printBacktrace() 44 { 45 #if defined(__GLIBC__) && !defined(__UCLIBC__) 46 void* frames[256]; 47 size_t size = backtrace(frames, 256); 48 if (!size) 49 return; 50 51 char** symbols = backtrace_symbols(frames, size); 52 if (!symbols) 53 return; 54 55 for (unsigned i = 0; i < size; ++i) 56 fprintf(stderr, "%u: %s\n", i, symbols[i]); 57 58 fflush(stderr); 59 free(symbols); 60 #endif 61 } 62 63 #if HAVE(SIGNAL_H) 64 static NO_RETURN void crashHandler(int signal) 65 { 66 fprintf(stderr, "%s\n", strsignal(signal)); 67 printBacktrace(); 68 exit(128 + signal); 69 } 70 #endif 71 31 72 void InjectedBundle::platformInitialize(WKTypeRef) 32 73 { 74 #if HAVE(SIGNAL_H) 75 signal(SIGILL, crashHandler); /* 4: illegal instruction (not reset when caught) */ 76 signal(SIGTRAP, crashHandler); /* 5: trace trap (not reset when caught) */ 77 signal(SIGFPE, crashHandler); /* 8: floating point exception */ 78 signal(SIGBUS, crashHandler); /* 10: bus error */ 79 signal(SIGSEGV, crashHandler); /* 11: segmentation violation */ 80 signal(SIGSYS, crashHandler); /* 12: bad argument to system call */ 81 signal(SIGPIPE, crashHandler); /* 13: write on a pipe with no reader */ 82 signal(SIGXCPU, crashHandler); /* 24: exceeded CPU time limit */ 83 signal(SIGXFSZ, crashHandler); /* 25: exceeded file size limit */ 84 #endif 33 85 } 34 86
Note: See TracChangeset
for help on using the changeset viewer.