Fossil

Check-in [cc8c33ee]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add GCC backtraces to the segv handler.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | segvhandler
Files: files | file ages | folders
SHA3-256: cc8c33ee8aff995b170421ebf78598a314e49ed7248c080ba58818a05d5631d8
User & Date: drh 2018-07-19 11:40:09.114
Context
2018-07-19
13:13
Add a segfault simulator to the test-warning page. ... (check-in: c4dcb00d user: drh tags: segvhandler)
11:40
Add GCC backtraces to the segv handler. ... (check-in: cc8c33ee user: drh tags: segvhandler)
02:37
Fix the backoffice delay so that it extends the deadline for the follow-on process if the current process runs overtime. This prevents multiple follow-ons. ... (check-in: 5542cd43 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/main.c.
1416
1417
1418
1419
1420
1421
1422















1423

1424
1425
1426
1427
1428
1429
1430
  repo_list_page();
}

/*
** Called whenever a crash is encountered while processing a webpage.
*/
void sigsegv_handler(int x){















  fossil_errorlog("Segfault");

  exit(1);
}

/*
** Called if a server gets a SIGPIPE.  This often happens when a client
** webbrowser opens a connection but never sends the HTTP request
*/







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>







1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
  repo_list_page();
}

/*
** Called whenever a crash is encountered while processing a webpage.
*/
void sigsegv_handler(int x){
#if HAVE_BACKTRACE
  void *array[20];
  size_t size;
  char **strings;
  size_t i;
  Blob out;
  size = backtrace(array, sizeof(array)/sizeof(array[0]));
  strings = backtrace_symbols(array, size);
  blob_init(&out, 0, 0);
  blob_appendf(&out, "Segfault");
  for(i=0; i<size; i++){
    blob_appendf(&out, "\n(%d) %s", i, strings[i]);
  }
  fossil_panic("%s", blob_str(&out));
#else
  fossil_panic("Segfault");
#endif
  exit(1);
}

/*
** Called if a server gets a SIGPIPE.  This often happens when a client
** webbrowser opens a connection but never sends the HTTP request
*/