diff options
author | Simon McVittie <smcv@debian.org> | 2011-01-31 17:37:59 +0000 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2011-01-31 17:37:59 +0000 |
commit | 24fbe571516161d48b499d587f9adb3e683dbf88 (patch) | |
tree | 7d70909156dcf587d91f693b8e1216eb4e0465e1 /test/test-segfault.c | |
parent | 9b72896b3730a9fceb961be28bb95762a7b4e9d6 (diff) | |
download | dbus-24fbe571516161d48b499d587f9adb3e683dbf88.tar.gz |
Imported Upstream version 1.2.24upstream/1.2.24
Diffstat (limited to 'test/test-segfault.c')
-rw-r--r-- | test/test-segfault.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/test-segfault.c b/test/test-segfault.c new file mode 100644 index 00000000..bf4d964b --- /dev/null +++ b/test/test-segfault.c @@ -0,0 +1,28 @@ +/* This is simply a process that segfaults */ +#include <config.h> +#include <stdlib.h> +#include <signal.h> + +#ifdef HAVE_SETRLIMIT +#include <sys/resource.h> +#endif + +int +main (int argc, char **argv) +{ + char *p; + +#if HAVE_SETRLIMIT + struct rlimit r = { 0, }; + + getrlimit (RLIMIT_CORE, &r); + r.rlim_cur = 0; + setrlimit (RLIMIT_CORE, &r); + + raise (SIGSEGV); +#endif + p = NULL; + *p = 'a'; + + return 0; +} |