summaryrefslogtreecommitdiffstats
path: root/test/test-segfault.c
diff options
context:
space:
mode:
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;