https://github.com/ekg/freebayes
Raw File
Tip revision: 60850dc518fc453622cbb40ad6dd9f67644ed859 authored by Pjotr Prins on 16 December 2020, 10:18:06 UTC
Disable cmake, but leave the file with a message
Tip revision: 60850dc
SegfaultHandler.cpp
#include "SegfaultHandler.h"

// from http://stackoverflow.com/a/77336/238609
// many thanks to tgamblin

void segfaultHandler(int sig) {
#ifndef __CYGWIN__
    void *array[10];
    size_t size;

    // get void*'s for all entries on the stack
    size = backtrace(array, 10);

    // print out all the frames to stderr
    fprintf(stderr, "Error: signal %d:\n", sig);
    backtrace_symbols_fd(array, size, 2);
#endif
    exit(1);
}
back to top