1 --- abort.c.orig 2008-09-07 11:37:51.000000000 -0700
2 +++ abort.c 2008-09-07 11:56:01.000000000 -0700
3 @@ -39,19 +39,26 @@ __FBSDID("$FreeBSD: src/lib/libc/stdlib/
12 #include "un-namespace.h"
15 +extern void (*__cleanup)();
16 +extern void __abort(void) __dead2;
17 +extern const char *__crashreporter_info__;
19 +#define TIMEOUT 10000 /* 10 milliseconds */
26 + if (!__crashreporter_info__)
27 + __crashreporter_info__ = "abort() called";
29 * POSIX requires we flush stdio buffers on abort.
30 * XXX ISO C requires that abort() be async-signal-safe.
31 @@ -67,11 +74,22 @@ abort()
32 sigdelset(&act.sa_mask, SIGABRT);
33 (void)_sigprocmask(SIG_SETMASK, &act.sa_mask, NULL);
35 + usleep(TIMEOUT); /* give time for signal to happen */
38 * If SIGABRT was ignored, or caught and the handler returns, do
39 * it again, only harder.
44 +__private_extern__ void
47 + struct sigaction act;
49 + if (!__crashreporter_info__)
50 + __crashreporter_info__ = "__abort() called";
51 act.sa_handler = SIG_DFL;
53 sigfillset(&act.sa_mask);
54 @@ -79,5 +97,19 @@ abort()
55 sigdelset(&act.sa_mask, SIGABRT);
56 (void)_sigprocmask(SIG_SETMASK, &act.sa_mask, NULL);
59 + usleep(TIMEOUT); /* give time for signal to happen */
60 + __builtin_trap(); /* never exit normally */
63 +__private_extern__ void
64 +abort_report_np(const char *fmt, ...)
70 + vasprintf(&str, fmt, ap);
72 + __crashreporter_info__ = str ? str : fmt;