Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Paste
P469
test case for jobc panic
Active
Public
Actions
Authored by
kib
on Dec 29 2020, 7:25 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Flag For Later
Award Token
Tags
None
Referenced Files
F14411245: test case for jobc panic
Dec 29 2020, 7:25 PM
2020-12-29 19:25:04 (UTC+0)
Subscribers
None
/*
# gdb101 ./forktest
...
(gdb) catch fork
Catchpoint 1 (fork)
(gdb) r
Starting program: /mnt/forktest/forktest
Catchpoint 1 (forked process 830), _fork () at _fork.S:4
4 _fork.S: No such file or directory.
(gdb) kill
Kill the program being debugged? (y or n) y
[Inferior 1 (process 828) killed]
(gdb) quit
<panic>
*/
#include <sys/types.h>
#include <sys/wait.h>
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int
main(void)
{
pid_t pid, wpid;
pid = fork();
if (pid == -1)
err(1, "fork");
if (pid == 0) {
printf("I'm in the child\n");
exit(1);
}
printf("I'm in the parent\n");
wpid = waitpid(pid, NULL, 0);
if (wpid < 0)
err(1, "waitpid");
return (0);
}
Event Timeline
kib
created this paste.
Dec 29 2020, 7:25 PM
2020-12-29 19:25:03 (UTC+0)
kib
created this object in space
S1 Global
.
kib
mentioned this in
D27816: jobc: correct check for ignored children.
.
Log In to Comment