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
This commit is contained in:
parent
8252b8e4b7
commit
7e6ce1a3c5
@ -39,6 +39,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
ENTRY(tgkill)
|
ENTRY(tgkill)
|
||||||
|
.save {r4-r7, ip, lr}
|
||||||
stmfd sp!, {r4-r7, ip, lr}
|
stmfd sp!, {r4-r7, ip, lr}
|
||||||
ldr r7, =__NR_tgkill
|
ldr r7, =__NR_tgkill
|
||||||
swi #0
|
swi #0
|
||||||
|
@ -53,9 +53,7 @@ abort(void)
|
|||||||
* any errors -- X311J doesn't allow abort to return anyway.
|
* any errors -- X311J doesn't allow abort to return anyway.
|
||||||
*/
|
*/
|
||||||
sigdelset(&mask, SIGABRT);
|
sigdelset(&mask, SIGABRT);
|
||||||
/* temporary, so deliberate seg fault can be caught by debuggerd */
|
|
||||||
sigdelset(&mask, SIGSEGV);
|
|
||||||
/* -- */
|
|
||||||
(void)sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL);
|
(void)sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -72,17 +70,7 @@ abort(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* temporary, for bug hunting */
|
raise(SIGABRT);
|
||||||
/* 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);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* if SIGABRT ignored, or caught and the handler returns, do
|
* 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)sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL);
|
||||||
(void)kill(getpid(), SIGABRT);
|
raise(SIGABRT);
|
||||||
_exit(1);
|
_exit(1);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user