Changeset 196458 in webkit
- Timestamp:
- Feb 11, 2016 4:59:11 PM (8 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r196397 r196458 1 2016-02-11 Mark Lam <mark.lam@apple.com> 2 3 Need WTFCrash workaround for shipping SafariForWebKitDevelopment binaries. 4 https://bugs.webkit.org/show_bug.cgi?id=154125 5 6 Reviewed by Joseph Pecoraro. 7 8 Presently shipping SafariForWebKitDevelopment binaries still expect to link to a 9 WTFCrash function. We need to provide this function as a workaround until we can 10 update SafariForWebKitDevelopment to use the new inlined version. 11 12 We do this by doing: 13 1. Make WTFCrashImpl() the sole function for implementing a crash. 14 The CRASH() macro is now defined to be WTFCrashImpl() instead of WTFCrash(). 15 2. Renamed the legacy WTFCrash() to WTFCrashImpl() for debug or non-Darwin builds. 16 For (non-debug && OS(DARWIN)) builds, WTFCrashImpl() will be an inlined 17 function with an asm statement that issues a breakpoint trap. 18 3. Implement WTFCrash() as a function that calls CRASH(). 19 This satisfies the need of shipping SafariForWebKitDevelopment binaries. 20 4. Change WTFCrashWithSecurityImplication() to call CRASH(). 21 This ensures that we have a consistent implementation of how we crash. 22 5. Changed WTFLogAlwaysAndCrash() to call CRASH() instead of WTFCrash(). 23 This is just to have consistency in that all code in the WebKit project 24 now crashes by calling CRASH(), not WTFCrash(). 25 26 * wtf/Assertions.cpp: 27 * wtf/Assertions.h: 28 1 29 2016-02-09 Mark Lam <mark.lam@apple.com> 2 30 -
trunk/Source/WTF/wtf/Assertions.cpp
r196397 r196458 314 314 315 315 #if !defined(NDEBUG) || !OS(DARWIN) 316 void WTFCrash ()316 void WTFCrashImpl() 317 317 { 318 318 if (globalHook) … … 330 330 #endif // !defined(NDEBUG) || !OS(DARWIN) 331 331 332 // We need to keep WTFCrash() around (even on non-debug OS(DARWIN) builds) as a workaround 333 // for presently shipping (circa early 2016) SafariForWebKitDevelopment binaries which still 334 // expects to link to it. 335 void WTFCrash() 336 { 337 CRASH(); 338 } 339 332 340 void WTFCrashWithSecurityImplication() 333 341 { 334 if (globalHook) 335 globalHook(); 336 WTFReportBacktrace(); 337 *(int *)(uintptr_t)0xfbadbeef = 0; 338 // More reliable, but doesn't say fbadbeef. 339 #if COMPILER(GCC_OR_CLANG) 340 __builtin_trap(); 341 #else 342 ((void(*)())0)(); 343 #endif 342 CRASH(); 344 343 } 345 344 … … 457 456 WTFLogAlwaysV(format, args); 458 457 va_end(args); 459 WTFCrash();458 CRASH(); 460 459 } 461 460 -
trunk/Source/WTF/wtf/Assertions.h
r196397 r196458 152 152 WTF_EXPORT_PRIVATE bool WTFIsDebuggerAttached(); 153 153 154 #ifdef __cplusplus155 }156 #endif157 158 154 #ifndef CRASH 159 #define CRASH() WTFCrash() 160 #endif 161 162 #ifdef __cplusplus 163 extern "C" { 164 #endif 155 #define CRASH() WTFCrashImpl() 156 #endif 157 165 158 #if defined(NDEBUG) && OS(DARWIN) 166 ALWAYS_INLINE NO_RETURN_DUE_TO_CRASH void WTFCrash ()159 ALWAYS_INLINE NO_RETURN_DUE_TO_CRASH void WTFCrashImpl() 167 160 { 168 161 // Crash with a SIGTRAP i.e EXC_BREAKPOINT. … … 181 174 } 182 175 #else 176 WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH void WTFCrashImpl(); 177 #endif 178 183 179 WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH void WTFCrash(); 184 #endif185 186 #ifdef __cplusplus187 }188 #endif189 180 190 181 #ifndef CRASH_WITH_SECURITY_IMPLICATION … … 192 183 #endif 193 184 194 #ifdef __cplusplus 195 extern "C" { 196 #endif 197 WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH void WTFCrashWithSecurityImplication(); 185 WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH void WTFCrashWithSecurityImplication(); 186 198 187 #ifdef __cplusplus 199 188 }
Note: See TracChangeset
for help on using the changeset viewer.