diff options
Diffstat (limited to 'crash/10123.c')
| -rw-r--r-- | crash/10123.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/crash/10123.c b/crash/10123.c new file mode 100644 index 0000000..48a9304 --- /dev/null +++ b/crash/10123.c | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | /* | ||
| 2 | *Excerpt of the bug's description: | ||
| 3 | GDB fails to interrupt the program being debugged if the program is blocking SIGINT. | ||
| 4 | |||
| 5 | When using the sigwait function to retrieve signals, the program is expected to block them. SIGINT is a commonly handled signal. Any | ||
| 6 | program using sigwait to retrieve signals and handling SIGINT this way will not be interruptible by GDB. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #include <stddef.h> | ||
| 10 | #include <stdio.h> | ||
| 11 | #include <unistd.h> | ||
| 12 | #include <signal.h> | ||
| 13 | |||
| 14 | int main(){ | ||
| 15 | sigset_t sigs; | ||
| 16 | sigfillset(&sigs); | ||
| 17 | sigprocmask(SIG_SETMASK, &sigs, NULL); | ||
| 18 | |||
| 19 | if(fork()){ | ||
| 20 | sleep(1); // to be sure that | ||
| 21 | kill(getppid(), SIGINT); | ||
| 22 | _exit(0); | ||
| 23 | } | ||
| 24 | while(1){ | ||
| 25 | pause(); | ||
| 26 | printf("[*] No GBD detected\n"); | ||
| 27 | /* | ||
| 28 | * Put your code here | ||
| 29 | */ | ||
| 30 | } | ||
| 31 | return 0; | ||
| 32 | } | ||
