Notes
This function is in beta test. Please help improve it in the issues
here.
pwd: /out/package ppid: 73687 1: WRITELN sleep 10 2: CTRL+C Scan child pids of ppid: 73687 SIGINT Send signal 2 to pid: 73687 Scan child pids of ppid: 73688 Send signal 2 to pid: 73688 Scan child pids of ppid: 73690 Send signal 2 to pid: 73690 3: WRITELN echo 123 > 1.txt 4: WRITELN sleep 10 > 1.txt 5: CTRL+C Scan child pids of ppid: 73687 SIGINT Send signal 2 to pid: 73687 Scan child pids of ppid: 73688 Send signal 2 to pid: 73688 Scan child pids of ppid: 73693 Send signal 2 to pid: 73693 6: WRITELN cat 1.txt 7: WRITELN echo success 8: CTRL+C Scan child pids of ppid: 73687 SIGINT Send signal 2 to pid: 73687 Scan child pids of ppid: 73688 Send signal 2 to pid: 73688 Scan child pids of ppid: 73696 Send signal 2 to pid: 73696 9: WRITELN exit exit: 1
Hints
Your answer may be identical to the JOJ answer in the first several lines.
However, the main problem you meet now is Time Exceeded. And the exit code of your program is 1, which should be 0.
Please double check your code to solve this problem and try again.
Your Answer
mumsh $ mumsh.c:65:13: runtime error: index 128 out of bounds for type 'int [128]' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior mumsh.c:65:13 in ================================================================= ==73688==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x619000000480 at pc 0x000000517199 bp 0x7ffc0eb42810 sp 0x7ffc0eb42808 READ of size 8 at 0x619000000480 thread T0 #0 0x517198 (/out/package/mumsh_memory_check+0x517198) #1 0x7fe2ff6b8b96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #2 0x41ccb9 (/out/package/mumsh_memory_check+0x41ccb9) 0x619000000480 is located 0 bytes to the right of 1024-byte region [0x619000000080,0x619000000480) allocated by thread T0 here: #0 0x4dcb70 (/out/package/mumsh_memory_check+0x4dcb70) #1 0x5151d2 (/out/package/mumsh_memory_check+0x5151d2) #2 0x7fe2ff6b8b96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) SUMMARY: AddressSanitizer: heap-buffer-overflow (/out/package/mumsh_memory_check+0x517198) Shadow bytes around the bugg
JOJ Answer
mumsh $ mumsh $ mumsh $ mumsh $ mumsh $ success mumsh $ mumsh $ exit