diff options
author | Havoc Pennington <hp@redhat.com> | 2003-04-11 03:45:40 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2003-04-11 03:45:40 +0000 |
commit | 78e79022316f45e86a6cac4da85d6b60f5a8f7f8 (patch) | |
tree | 66190504e2f2d060b15712c54bb794d0f2a8b7e3 /test | |
parent | eb63ba5039c8afe61210cf2b217ec75b4a86356e (diff) |
2003-04-10 Havoc Pennington <hp@pobox.com>
* 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.
Diffstat (limited to 'test')
-rw-r--r-- | test/data/valid-service-files/debug-echo.service.in | 2 | ||||
-rw-r--r-- | test/data/valid-service-files/debug-segfault.service.in | 4 | ||||
-rw-r--r-- | test/test-segfault.c | 11 |
3 files changed, 15 insertions, 2 deletions
diff --git a/test/data/valid-service-files/debug-echo.service.in b/test/data/valid-service-files/debug-echo.service.in index 62e79161..c22735a6 100644 --- a/test/data/valid-service-files/debug-echo.service.in +++ b/test/data/valid-service-files/debug-echo.service.in @@ -1,3 +1,3 @@ [D-BUS Service] Name=org.freedesktop.DBus.TestSuiteEchoService -Exec=@TEST_SERVICE_BINARY@
\ No newline at end of file +Exec=@TEST_SERVICE_BINARY@ diff --git a/test/data/valid-service-files/debug-segfault.service.in b/test/data/valid-service-files/debug-segfault.service.in new file mode 100644 index 00000000..73c7b55b --- /dev/null +++ b/test/data/valid-service-files/debug-segfault.service.in @@ -0,0 +1,4 @@ +[D-BUS Service] +Name=org.freedesktop.DBus.TestSuiteSegfaultService +Exec=@TEST_SEGFAULT_BINARY@ + diff --git a/test/test-segfault.c b/test/test-segfault.c index 6c197823..dad0b589 100644 --- a/test/test-segfault.c +++ b/test/test-segfault.c @@ -1,13 +1,22 @@ /* This is simply a process that segfaults */ #include <signal.h> +#include <sys/resource.h> + int main (int argc, char **argv) { - char *p = 0; + 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; |