mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2025-12-24 20:30:07 +01:00
* bus/dispatch.c (check_segfault_service_activation): add test for launching an executable that just crashes. * test/test-segfault.c (main): try setting coredumpsize to 0 so we don't leave a million cores. We'll see how portable this is.
23 lines
315 B
C
23 lines
315 B
C
/* This is simply a process that segfaults */
|
|
#include <signal.h>
|
|
|
|
#include <sys/resource.h>
|
|
|
|
int
|
|
main (int argc, char **argv)
|
|
{
|
|
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;
|
|
}
|