summaryrefslogtreecommitdiff
path: root/test/test-segfault.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-04-11 03:45:40 +0000
committerHavoc Pennington <hp@redhat.com>2003-04-11 03:45:40 +0000
commit78e79022316f45e86a6cac4da85d6b60f5a8f7f8 (patch)
tree66190504e2f2d060b15712c54bb794d0f2a8b7e3 /test/test-segfault.c
parenteb63ba5039c8afe61210cf2b217ec75b4a86356e (diff)
downloaddbus-78e79022316f45e86a6cac4da85d6b60f5a8f7f8.tar.gz
2003-04-10 Havoc Pennington <hp@pobox.com>
* bus/dispatch.c (check_segfault_service_activation): add test for launching an executable that just crashes. * test/test-segfault.c (main): try setting coredumpsize to 0 so we don't leave a million cores. We'll see how portable this is.
Diffstat (limited to 'test/test-segfault.c')
-rw-r--r--test/test-segfault.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/test-segfault.c b/test/test-segfault.c
index 6c197823..dad0b589 100644
--- a/test/test-segfault.c
+++ b/test/test-segfault.c
@@ -1,13 +1,22 @@
/* This is simply a process that segfaults */
#include <signal.h>
+#include <sys/resource.h>
+
int
main (int argc, char **argv)
{
- char *p = 0;
+ char *p;
+
+ struct rlimit r = { 0, };
+
+ getrlimit (RLIMIT_CORE, &r);
+ r.rlim_cur = 0;
+ setrlimit (RLIMIT_CORE, &r);
raise (SIGSEGV);
+ p = 0;
*p = 'a';
return 0;