summaryrefslogtreecommitdiffstats
path: root/daemon/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/debug.c')
-rw-r--r--daemon/debug.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/daemon/debug.c b/daemon/debug.c
index e4a7f055..6d6d2b59 100644
--- a/daemon/debug.c
+++ b/daemon/debug.c
@@ -46,11 +46,13 @@ struct cmd {
static char *debug_help (const char *subcmd, int argc, char *const *const argv);
static char *debug_fds (const char *subcmd, int argc, char *const *const argv);
+static char *debug_segv (const char *subcmd, int argc, char *const *const argv);
static char *debug_sh (const char *subcmd, int argc, char *const *const argv);
static struct cmd cmds[] = {
{ "help", debug_help },
{ "fds", debug_fds },
+ { "segv", debug_segv },
{ "sh", debug_sh },
{ NULL, NULL }
};
@@ -177,6 +179,14 @@ debug_fds (const char *subcmd, int argc, char *const *const argv)
return out;
}
+/* Force a segfault in the daemon. */
+static char *
+debug_segv (const char *subcmd, int argc, char *const *const argv)
+{
+ *(int*)0 = 0;
+ return NULL;
+}
+
/* Run an arbitrary shell command. */
static char *
debug_sh (const char *subcmd, int argc, char *const *const argv)