diff --git a/uwsgi.c b/uwsgi.c index 9eca9eab..7e5a85ce 100644 --- a/uwsgi.c +++ b/uwsgi.c @@ -1123,6 +1123,38 @@ void uwsgi_plugins_atexit(void) { } +#ifdef __linux__ + +#include + +void uwsgi_backtrace(int signum) { + + void *btrace[64]; + size_t bt_size, i; + char **bt_strings; + + uwsgi_log("!!! uWSGI process %d got Segmentation Fault !!!\n", (int) getpid()); + + bt_size = backtrace(btrace, 64); + + bt_strings = backtrace_symbols(btrace, bt_size); + + uwsgi_log("*** backtrace ***\n"); + for(i=0;i