Changeset 222 in flair-src for trunk/tools/FlairGCS/src/main.cpp


Ignore:
Timestamp:
Feb 26, 2018, 9:36:16 AM (4 years ago)
Author:
Sanahuja Guillaume
Message:

allows realloc in graphs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/FlairGCS/src/main.cpp

    r45 r222  
    88#include <qmetatype.h>
    99#include <tclap/CmdLine.h>
     10#include <execinfo.h>
     11#include <signal.h>
    1012
    1113#include "Manager.h"
     
    3941}
    4042
     43void seg_fault(int sig __attribute__((unused))) {
     44  void *bt[32];
     45  int nentries;
     46
     47  printf("Segmentation fault:\n");
     48  /* Dump a backtrace of the frame which caused the segfault: */
     49  nentries = backtrace(bt, sizeof(bt) / sizeof(bt[0]));
     50  backtrace_symbols_fd(bt, nentries, fileno(stdout));
     51
     52  exit(1);
     53}
     54
    4155int main(int argc, char *argv[]) {
    4256
     
    5266
    5367  compile_info("FlairGCS");
     68 
     69  // catch segfault
     70  signal(SIGSEGV, seg_fault);
    5471
    5572  parseOptions(argc, argv);
Note: See TracChangeset for help on using the changeset viewer.