From f5c8f6fb61ce609452361ee9b61a343570f62d12 Mon Sep 17 00:00:00 2001 From: "thestig@chromium.org" Date: Sat, 14 Aug 2010 01:41:39 +0000 Subject: Fix a couple of bugs where we generate incorrect minidump files on Linux.o Patch by Markus Gutschke . R=thestig Review URL: http://breakpad.appspot.com/150001 Review URL: http://breakpad.appspot.com/155001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@649 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/client/linux/handler/exception_handler.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/client/linux/handler') diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc index 038612f2..6e58ff2c 100644 --- a/src/client/linux/handler/exception_handler.cc +++ b/src/client/linux/handler/exception_handler.cc @@ -72,6 +72,7 @@ #include #include #include +#include #include #include #include @@ -268,7 +269,10 @@ void ExceptionHandler::SignalHandler(int sig, siginfo_t* info, void* uc) { // crashed. The default action for all the signals which we catch is Core, so // this is the end of us. signal(sig, SIG_DFL); - tgkill(getpid(), sys_gettid(), sig); + + // TODO(markus): mask signal and return to caller + tgkill(getpid(), syscall(__NR_gettid), sig); + _exit(1); // not reached. } @@ -296,7 +300,7 @@ bool ExceptionHandler::HandleSignal(int sig, siginfo_t* info, void* uc) { return false; // Allow ourselves to be dumped. - sys_prctl(PR_SET_DUMPABLE, 1); + prctl(PR_SET_DUMPABLE, 1); CrashContext context; memcpy(&context.siginfo, info, sizeof(siginfo_t)); memcpy(&context.context, uc, sizeof(struct ucontext)); @@ -309,7 +313,7 @@ bool ExceptionHandler::HandleSignal(int sig, siginfo_t* info, void* uc) { sizeof(context.float_state)); } #endif - context.tid = sys_gettid(); + context.tid = syscall(__NR_gettid); if (crash_handler_ != NULL) { if (crash_handler_(&context, sizeof(context), callback_context_)) { -- cgit v1.2.1