Removed the backtrace stuff. It wasn't producing traces that were useful.
authorArt Cancro <ajc@citadel.org>
Sat, 8 May 2021 22:24:12 +0000 (18:24 -0400)
committerArt Cancro <ajc@citadel.org>
Sat, 8 May 2021 22:24:12 +0000 (18:24 -0400)
appimage/ctdlvisor.c
citadel/citserver.c
citadel/citserver.h
citadel/server_main.c
citadel/sysdep.c

index c7a073a..6784f2c 100644 (file)
@@ -96,14 +96,12 @@ void detach_from_tty(void) {
 
 pid_t start_citadel() {
        char bin[1024];
-       char backtrace_filename[PATH_MAX];
        sprintf(bin, "%s/usr/local/citadel/citserver", getenv("APPDIR"));
        pid_t pid = fork();
        if (pid == 0) {
                fprintf(stderr, "ctdlvisor: executing %s with data directory %s\n", bin, getenv("CTDL_DIR"));
                detach_from_tty();
-               sprintf(backtrace_filename, "/tmp/citserver-backtrace.%d", getpid());
-               execlp(bin, "citserver", "-x9", "-h", getenv("CTDL_DIR"), "-b", backtrace_filename, NULL);
+               execlp(bin, "citserver", "-x9", "-h", getenv("CTDL_DIR"), NULL);
                exit(errno);
        }
        else {
index 48c4f5a..cde79e0 100644 (file)
@@ -33,7 +33,6 @@ int ScheduledShutdown = 0;
 time_t server_startup_time;
 int panic_fd;
 int openid_level_supported = 0;
-char *backtrace_filename = NULL;
 
 
 /*
index a702e08..adfe476 100644 (file)
@@ -51,4 +51,3 @@ extern int panic_fd;
 char CtdlCheckExpress(void);
 extern time_t server_startup_time;
 extern int openid_level_supported;
-extern char *backtrace_filename;
index 33fdc33..4e6ca96 100644 (file)
@@ -100,7 +100,7 @@ int main(int argc, char **argv) {
        syslog(LOG_INFO, "%s", libcitadel_version_string());
 
        /* parse command-line arguments */
-       while ((a=getopt(argc, argv, "cl:dh:x:t:B:Dru:s:b:")) != EOF) switch(a) {
+       while ((a=getopt(argc, argv, "cl:dh:x:t:B:Dru:s:")) != EOF) switch(a) {
 
                // test this binary for compatibility and exit
                case 'c':
@@ -169,10 +169,6 @@ int main(int argc, char **argv) {
                        sanity_diag_mode = atoi(optarg);
                        break;
 
-               case 'b':
-                       backtrace_filename = strdup(optarg);
-                       break;
-
                // any other parameter makes it crash and burn
                default:
                        fprintf(stderr, "citserver: usage: "
index 3caa2dc..31ece98 100644 (file)
@@ -49,32 +49,7 @@ volatile int running_as_daemon = 0;
 
 
 static RETSIGTYPE signal_cleanup(int signum) {
-       syslog(LOG_DEBUG, "sysdep: caught signal %d - backtrace follows:", signum);
-
-       void *bt[1024];
-       int bt_size;
-       char **bt_syms;
-       int i;
-       FILE *backtrace_fp = NULL;
-
-       if (backtrace_filename != NULL) {
-               backtrace_fp = fopen(backtrace_filename, "w");
-       }
-
-       bt_size = backtrace(bt, 1024);
-       bt_syms = backtrace_symbols(bt, bt_size);
-       for (i = 1; i < bt_size; i++) {
-               syslog(LOG_DEBUG, "%s", bt_syms[i]);
-               if (backtrace_fp) {
-                       fprintf(backtrace_fp, "%s\n", bt_syms[i]);
-               }
-       }
-       free(bt_syms);
-
-       if (backtrace_fp) {
-               fclose(backtrace_fp);
-       }
-
+       syslog(LOG_DEBUG, "sysdep: caught signal %d", signum);
        exit_signal = signum;
        server_shutting_down = 1;
 }
@@ -115,13 +90,11 @@ void init_sysdep(void) {
        sigaddset(&set, SIGINT);
        sigaddset(&set, SIGHUP);
        sigaddset(&set, SIGTERM);
-       sigaddset(&set, SIGSEGV);
        sigprocmask(SIG_UNBLOCK, &set, NULL);
 
        signal(SIGINT, signal_cleanup);
        signal(SIGHUP, signal_cleanup);
        signal(SIGTERM, signal_cleanup);
-       signal(SIGSEGV, signal_cleanup);
 
        // Do not shut down the server on broken pipe signals, otherwise the
        // whole Citadel service would come down whenever a single client