blob: 329a21fd0819d0e4258342c26d24030a5837d8be [file] [log] [blame]
Emeric Vigier2f625822012-08-06 11:09:52 -04001/* This is simply a process that segfaults */
2#include <config.h>
3#include <stdlib.h>
4#ifdef HAVE_SIGNAL_H
5#include <signal.h>
6#endif
7
8#ifdef HAVE_SETRLIMIT
9#include <sys/resource.h>
10#endif
11
12int
13main (int argc, char **argv)
14{
15 char *p;
16
17#if HAVE_SETRLIMIT
18 struct rlimit r = { 0, };
19
20 getrlimit (RLIMIT_CORE, &r);
21 r.rlim_cur = 0;
22 setrlimit (RLIMIT_CORE, &r);
23
24 raise (SIGSEGV);
25#endif
26 p = NULL;
27 *p = 'a';
28
29 return 0;
30}