diff options
author | Ben Cheng <bccheng@google.com> | 2013-06-10 17:01:41 -0700 |
---|---|---|
committer | Ben Cheng <bccheng@google.com> | 2013-06-10 17:17:46 -0700 |
commit | 7e6ce1a3c52d8533fed92c143419fedb0c93988a (patch) | |
tree | 0ed2dd0e1c7a57ee6a2f6eff3e4bb609d191102b /libc/unistd | |
parent | 8252b8e4b730b13623f31dc66396e000586d1c58 (diff) | |
download | bionic-7e6ce1a3c52d8533fed92c143419fedb0c93988a.zip bionic-7e6ce1a3c52d8533fed92c143419fedb0c93988a.tar.gz bionic-7e6ce1a3c52d8533fed92c143419fedb0c93988a.tar.bz2 |
Fix abort(3) to raise SIGABRT rather than causing SIGSEGV.
tgkill() needs the .save stack unwinding directive to get the complete
stack trace.
BUG: https://code.google.com/p/android/issues/detail?id=16672
Change-Id: Ifb447dca2147a592c48baf32769dfc175d8aea72
Diffstat (limited to 'libc/unistd')
-rw-r--r-- | libc/unistd/abort.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/libc/unistd/abort.c b/libc/unistd/abort.c index 4dffbae..4a349bd 100644 --- a/libc/unistd/abort.c +++ b/libc/unistd/abort.c @@ -53,9 +53,7 @@ abort(void) * any errors -- X311J doesn't allow abort to return anyway. */ sigdelset(&mask, SIGABRT); - /* temporary, so deliberate seg fault can be caught by debuggerd */ - sigdelset(&mask, SIGSEGV); - /* -- */ + (void)sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL); /* @@ -72,17 +70,7 @@ abort(void) } } - /* temporary, for bug hunting */ - /* seg fault seems to produce better debuggerd results than SIGABRT */ -#ifdef __mips__ - /* An access that will generate SIGSEGV rather than SIGBUS. */ - *((char*)0xdeadc0c0) = 39; -#else - *((char*)0xdeadbaad) = 39; -#endif - /* -- */ - - (void)kill(getpid(), SIGABRT); + raise(SIGABRT); /* * if SIGABRT ignored, or caught and the handler returns, do @@ -99,6 +87,6 @@ abort(void) } (void)sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL); - (void)kill(getpid(), SIGABRT); + raise(SIGABRT); _exit(1); } |