test-segfault.c revision 42fe5c9341e9493ed94b319bb00063f432dd0673
1/* This is simply a process that segfaults */
2#include <config.h>
3#include <stdlib.h>
4#include <signal.h>
5
6#if !defined(DBUS_WIN) && !defined(DBUS_WINCE)
7#include <sys/time.h>
8#include <sys/resource.h>
9#endif
10
11int
12main (int argc, char **argv)
13{
14  char *p;
15
16#if !defined(DBUS_WIN) && !defined(DBUS_WINCE)
17  struct rlimit r = { 0, };
18
19  getrlimit (RLIMIT_CORE, &r);
20  r.rlim_cur = 0;
21  setrlimit (RLIMIT_CORE, &r);
22
23  raise (SIGSEGV);
24#endif
25  p = NULL;
26  *p = 'a';
27
28  return 0;
29}
30