#include <string.h>
#include <signal.h>
#include <stdlib.h>
+#include <execinfo.h>
static struct fuse_session *fuse_instance;
+static void dump_stack(void)
+{
+#ifdef HAVE_BACKTRACE
+ const size_t backtrace_sz = 1024 * 1024;
+ void* backtrace_buffer[backtrace_sz];
+
+ int err_fd = fileno(stderr);
+
+ int trace_len = backtrace(backtrace_buffer, backtrace_sz);
+ backtrace_symbols_fd(backtrace_buffer, trace_len, err_fd);
+#endif
+}
+
static void exit_handler(int sig)
{
if (fuse_instance) {
fuse_session_exit(fuse_instance);
if(sig <= 0) {
fuse_log(FUSE_LOG_ERR, "assertion error: signal value <= 0\n");
+ dump_stack();
abort();
}
fuse_instance->error = sig;
cc.has_function('setxattr', prefix: '#include <sys/xattr.h>'))
private_cfg.set('HAVE_ICONV',
cc.has_function('iconv', prefix: '#include <iconv.h>'))
+private_cfg.set('HAVE_BACKTRACE',
+ cc.has_function('backtrace', prefix: '#include <execinfo.h>'))
# Test if structs have specific member
private_cfg.set('HAVE_STRUCT_STAT_ST_ATIM',