| 2081 | } |
| 2082 | |
| 2083 | void bugReportEnd(int killViaSignal, int sig) { |
| 2084 | struct sigaction act; |
| 2085 | |
| 2086 | serverLogRaw(LL_WARNING|LL_RAW, |
| 2087 | "\n=== KEYDB BUG REPORT END. Make sure to include from START to END. ===\n\n" |
| 2088 | " Please report the crash by opening an issue on github:\n\n" |
| 2089 | " https://github.com/JohnSully/KeyDB/issues\n\n" |
| 2090 | " Suspect RAM error? Use keydb-server --test-memory to verify it.\n\n" |
| 2091 | ); |
| 2092 | |
| 2093 | /* free(messages); Don't call free() with possibly corrupted memory. */ |
| 2094 | if (cserver.daemonize && cserver.supervised == 0 && cserver.pidfile) unlink(cserver.pidfile); |
| 2095 | |
| 2096 | if (!killViaSignal) { |
| 2097 | if (g_pserver->use_exit_on_panic) |
| 2098 | exit(1); |
| 2099 | abort(); |
| 2100 | } |
| 2101 | |
| 2102 | /* Make sure we exit with the right signal at the end. So for instance |
| 2103 | * the core will be dumped if enabled. */ |
| 2104 | sigemptyset (&act.sa_mask); |
| 2105 | act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND; |
| 2106 | act.sa_handler = SIG_DFL; |
| 2107 | sigaction (sig, &act, NULL); |
| 2108 | kill(getpid(),sig); |
| 2109 | } |
| 2110 | |
| 2111 | /* ==================== Logging functions for debugging ===================== */ |
| 2112 |
no test coverage detected