Bug 1395504 - Infinite hang of web content process when parent process crashes r?ted.mielczarek
Don't free memory in exception handling context to avoid deadlocks.
Replace old_handler_.reset() with old_handler_.release() to
intentionally leak the sigaction struct instead.
MozReview-Commit-ID: lUNygOJCUL
--- a/toolkit/crashreporter/breakpad-client/mac/handler/exception_handler.cc
+++ b/toolkit/crashreporter/breakpad-client/mac/handler/exception_handler.cc
@@ -689,17 +689,22 @@ bool ExceptionHandler::UninstallHandler(
kern_return_t result = KERN_SUCCESS;
if (old_handler_.get()) {
sigaction(SIGABRT, old_handler_.get(), NULL);
#if USE_PROTECTED_ALLOCATIONS
mprotect(gProtectedData.protected_buffer, PAGE_SIZE,
PROT_READ | PROT_WRITE);
#endif
- old_handler_.reset();
+ if (in_exception) {
+ old_handler_.release();
+ } else {
+ // this delete should NOT happen if an exception just occurred!
+ old_handler_.reset();
+ }
gProtectedData.handler = NULL;
}
if (installed_exception_handler_) {
mach_port_t current_task = mach_task_self();
// Restore the previous ports
for (unsigned int i = 0; i < previous_->count; ++i) {