dd1c87fe697a61aa268769234922acaf44c59de8
[platform/upstream/dbus.git] / test / test-segfault.c
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
11 int
12 main (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 }