☠☠ backed out by c1e97e2838a7 ☠ ☠ | |
author | Ted Mielczarek <ted.mielczarek@gmail.com> |
Thu, 20 Sep 2012 10:57:08 -0400 | |
changeset 107632 | 1e7050c52cb992d0b65f7d14cee28b1e3318acf0 |
parent 107631 | 776f7325952bdfb9527636007b01ad27d7cf6c33 |
child 107633 | b7a70792a39d5fc023fd1bde84eec7031547f89a |
push id | 15142 |
push user | tmielczarek@mozilla.com |
push date | Thu, 20 Sep 2012 17:35:14 +0000 |
treeherder | mozilla-inbound@1e7050c52cb9 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | ehsan |
bugs | 792850 |
milestone | 18.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/toolkit/crashreporter/test/CrashTestUtils.jsm +++ b/toolkit/crashreporter/test/CrashTestUtils.jsm @@ -37,16 +37,23 @@ CrashTestUtils.saveAppMemory = lib.decla ctypes.uint64_t); CrashTestUtils.lockDir = lib.declare("LockDir", ctypes.default_abi, ctypes.voidptr_t, // nsILocalFile* ctypes.voidptr_t); // nsISupports* +try { + CrashTestUtils.TryOverrideExceptionHandler = lib.declare("TryOverrideExceptionHandler", + ctypes.default_abi, + ctypes.void_t); +} +catch(ex) {} + CrashTestUtils.dumpHasStream = lib.declare("DumpHasStream", ctypes.default_abi, ctypes.bool, ctypes.char.ptr, ctypes.uint32_t); CrashTestUtils.dumpHasInstructionPointerMemory = lib.declare("DumpHasInstructionPointerMemory",
--- a/toolkit/crashreporter/test/nsTestCrasher.cpp +++ b/toolkit/crashreporter/test/nsTestCrasher.cpp @@ -99,8 +99,22 @@ uint64_t SaveAppMemory() FILE *fp = fopen("crash-addr", "w"); if (!fp) return 0; fprintf(fp, "%p\n", (void *)testData); fclose(fp); return (int64_t)testData; } + +#ifdef XP_WIN32 +static LONG WINAPI HandleException(EXCEPTION_POINTERS* exinfo) +{ + TerminateProcess(GetCurrentProcess(), 0); + return 0; +} + +extern "C" NS_EXPORT +void TryOverrideExceptionHandler() +{ + SetUnhandledExceptionFilter(HandleException); +} +#endif
new file mode 100644 --- /dev/null +++ b/toolkit/crashreporter/test/unit/test_override_exception_handler.js @@ -0,0 +1,12 @@ +function run_test() +{ + // Ensure that attempting to override the exception handler doesn't cause + // us to lose our exception handler. + do_crash( + function() { + CrashTestUtils.TryOverrideExceptionHandler(); + }, + function(mdump, extra) { + }, + true); +}
--- a/toolkit/crashreporter/test/unit/xpcshell.ini +++ b/toolkit/crashreporter/test/unit/xpcshell.ini @@ -6,11 +6,13 @@ tail = [test_crash_purevirtual.js] [test_crash_runtimeabort.js] [test_crash_oom.js] skip-if = os == 'win' && debug [test_crashreporter.js] [test_crashreporter_crash.js] [test_crashreporter_crash_profile_lock.js] +[test_override_exception_handler.js] +run-if = os == 'win' [test_crashreporter_appmem.js] run-if = os == 'win' || os == 'linux'