aboutsummaryrefslogtreecommitdiff
path: root/src/client/linux
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2013-11-07 22:50:13 +0000
committerthestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2013-11-07 22:50:13 +0000
commit46821f78b1871b65471ae36ba6f91e02e94ec33c (patch)
tree6d821f0466b0cffa6857421c6c978b9b07c49c20 /src/client/linux
parentUse register %ebp (instead of %esp) when calculating the value of (diff)
downloadbreakpad-46821f78b1871b65471ae36ba6f91e02e94ec33c.tar.xz
Allow SIGABRT to abort the program.
SIGABRT can be generated internally, usually by calling abort(), or externally by another process. When the signal is generated by the kernel, info->si_pid is 0 and the signal is treated in the same way as an exception (SIGSEGV, etc.), but the assumption that the exception happens again upon return from the handler is wrong, so we must have a special case for this. Original CL: https://breakpad.appspot.com/734002/ BUG=chromium:303075 TEST=tested with Alt-VolumeUp-X on Chrome OS A=semenzato@chromium.org R=semenzato@google.com Review URL: https://breakpad.appspot.com/754002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1233 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/linux')
-rw-r--r--src/client/linux/handler/exception_handler.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc
index 9d19a909..b78568d1 100644
--- a/src/client/linux/handler/exception_handler.cc
+++ b/src/client/linux/handler/exception_handler.cc
@@ -341,10 +341,11 @@ void ExceptionHandler::SignalHandler(int sig, siginfo_t* info, void* uc) {
pthread_mutex_unlock(&handler_stack_mutex_);
- if (info->si_pid) {
+ if (info->si_pid || sig == SIGABRT) {
// This signal was triggered by somebody sending us the signal with kill().
// In order to retrigger it, we have to queue a new signal by calling
- // kill() ourselves.
+ // kill() ourselves. The special case (si_pid == 0 && sig == SIGABRT) is
+ // due to the kernel sending a SIGABRT from a user request via SysRQ.
if (tgkill(getpid(), syscall(__NR_gettid), sig) < 0) {
// If we failed to kill ourselves (e.g. because a sandbox disallows us
// to do so), we instead resort to terminating our process. This will