os/ossrv/ofdbus/dbus/tsrc/testapps/dbus_test_cases/test-segfault.c
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/ofdbus/dbus/tsrc/testapps/dbus_test_cases/test-segfault.c	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,27 @@
     1.4 +/* Portion Copyright © 2008 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.*/
     1.5 +/* This is simply a process that segfaults */
     1.6 +#include <stdlib.h>
     1.7 +#ifndef TODO
     1.8 +#include <signal.h>
     1.9 +#endif
    1.10 +#include <sys/time.h>
    1.11 +#include <sys/resource.h>
    1.12 +
    1.13 +int
    1.14 +main ()
    1.15 +{
    1.16 +  char *p;  
    1.17 +
    1.18 +  struct rlimit r = { 0, };
    1.19 +  #ifndef TODO
    1.20 +  getrlimit (RLIMIT_CORE, &r);
    1.21 +  r.rlim_cur = 0;
    1.22 +  setrlimit (RLIMIT_CORE, &r);
    1.23 +  
    1.24 +   raise (SIGSEGV);
    1.25 +  #endif
    1.26 +  p = NULL;
    1.27 +  *p = 'a';
    1.28 +  
    1.29 +  return 0;
    1.30 +}