Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/309fcd6d428b2f552fd27bf93154a09d5836eed4
...commit
http://git.netsurf-browser.org/netsurf.git/commit/309fcd6d428b2f552fd27bf93154a09d5836eed4
...tree
http://git.netsurf-browser.org/netsurf.git/tree/309fcd6d428b2f552fd27bf93154a09d5836eed4
The branch, master has been updated
via 309fcd6d428b2f552fd27bf93154a09d5836eed4 (commit)
from 24ec30359be98b64f7668df6172047b740d9d9f2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=309fcd6d428b2f552fd27bf93154a09d5836eed4
commit 309fcd6d428b2f552fd27bf93154a09d5836eed4
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
monkey: Catch some signals and backtrace
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/frontends/monkey/main.c b/frontends/monkey/main.c
index e4d32d8..3fd0696 100644
--- a/frontends/monkey/main.c
+++ b/frontends/monkey/main.c
@@ -24,6 +24,7 @@
#include <unistd.h>
#include <string.h>
#include <errno.h>
+#include <signal.h>
#include "utils/config.h"
#include "utils/sys_time.h"
@@ -340,6 +341,28 @@ __assert_fail(const char *__assertion, const char *__file,
abort();
}
+
+static void
+signal_handler(int sig)
+{
+ int frames;
+ fprintf(stderr, "Caught signal %s (%d)\n",
+ ((sig == SIGSEGV) ? "SIGSEGV" :
+ ((sig == SIGILL) ? "SIGILL" :
+ ((sig == SIGFPE) ? "SIGFPE" :
+ ((sig == SIGBUS) ? "SIGBUS" :
+ "unknown signal")))),
+ sig);
+ frames = backtrace(&backtrace_buffer[0], 4096);
+ if (frames > 0 && frames < 4096) {
+ fprintf(stderr, "Backtrace:\n");
+ fflush(stderr);
+ backtrace_symbols_fd(&backtrace_buffer[0], frames, 2);
+ }
+
+ abort();
+}
+
#endif
int
@@ -359,6 +382,15 @@ main(int argc, char **argv)
.llcache = filesystem_llcache_table,
};
+#if (!defined(NDEBUG) && defined(HAVE_EXECINFO))
+ /* Catch segfault, illegal instructions and fp exceptions */
+ signal(SIGSEGV, signal_handler);
+ signal(SIGILL, signal_handler);
+ signal(SIGFPE, signal_handler);
+ /* It's unlikely, but SIGBUS could happen on some platforms */
+ signal(SIGBUS, signal_handler);
+#endif
+
ret = netsurf_register(&monkey_table);
if (ret != NSERROR_OK) {
die("NetSurf operation table failed registration");
-----------------------------------------------------------------------
Summary of changes:
frontends/monkey/main.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/frontends/monkey/main.c b/frontends/monkey/main.c
index e4d32d8..3fd0696 100644
--- a/frontends/monkey/main.c
+++ b/frontends/monkey/main.c
@@ -24,6 +24,7 @@
#include <unistd.h>
#include <string.h>
#include <errno.h>
+#include <signal.h>
#include "utils/config.h"
#include "utils/sys_time.h"
@@ -340,6 +341,28 @@ __assert_fail(const char *__assertion, const char *__file,
abort();
}
+
+static void
+signal_handler(int sig)
+{
+ int frames;
+ fprintf(stderr, "Caught signal %s (%d)\n",
+ ((sig == SIGSEGV) ? "SIGSEGV" :
+ ((sig == SIGILL) ? "SIGILL" :
+ ((sig == SIGFPE) ? "SIGFPE" :
+ ((sig == SIGBUS) ? "SIGBUS" :
+ "unknown signal")))),
+ sig);
+ frames = backtrace(&backtrace_buffer[0], 4096);
+ if (frames > 0 && frames < 4096) {
+ fprintf(stderr, "Backtrace:\n");
+ fflush(stderr);
+ backtrace_symbols_fd(&backtrace_buffer[0], frames, 2);
+ }
+
+ abort();
+}
+
#endif
int
@@ -359,6 +382,15 @@ main(int argc, char **argv)
.llcache = filesystem_llcache_table,
};
+#if (!defined(NDEBUG) && defined(HAVE_EXECINFO))
+ /* Catch segfault, illegal instructions and fp exceptions */
+ signal(SIGSEGV, signal_handler);
+ signal(SIGILL, signal_handler);
+ signal(SIGFPE, signal_handler);
+ /* It's unlikely, but SIGBUS could happen on some platforms */
+ signal(SIGBUS, signal_handler);
+#endif
+
ret = netsurf_register(&monkey_table);
if (ret != NSERROR_OK) {
die("NetSurf operation table failed registration");
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]