Notes
This function is in beta test. Please help improve it in the issues
here.
pwd: /out/package ppid: 90792 1: WRITELN sleep 10 2: CTRL+C Scan child pids of ppid: 90792 SIGINT Send signal 2 to pid: 90792 Scan child pids of ppid: 90793 Send signal 2 to pid: 90793 Scan child pids of ppid: 90794 Send signal 2 to pid: 90794 3: WRITELN echo 123 > 1.txt 4: WRITELN sleep 10 > 1.txt 5: CTRL+C Scan child pids of ppid: 90792 SIGINT Send signal 2 to pid: 90792 Scan child pids of ppid: 90793 Send signal 2 to pid: 90793 Scan child pids of ppid: 90794 Send signal 2 to pid: 90794 Scan child pids of ppid: 90795 Send signal 2 to pid: 90795 Scan child pids of ppid: 90796 Send signal 2 to pid: 90796 Scan child pids of ppid: 90797 Send signal 2 to pid: 90797 6: WRITELN cat 1.txt 7: WRITELN echo success 8: CTRL+C Scan child pids of ppid: 90792 SIGINT Send signal 2 to pid: 90792 Scan child pids of ppid: 90793 Send signal 2 to pid: 90793 Scan child pids of ppid: 90794 Send signal 2 to pid: 90794 Scan child pids of ppid: 90795 Send signal 2 to pid: 90795 Scan child pids of ppid: 90796
Hints
Your answer may be identical to the JOJ answer in the first several lines.
However, you will still get Wrong Answer because the complete output may be longer and there might be errors in the future lines.
Please double check your code to solve this problem and try again.
Your Answer
mumsh $ /in/main.c:111:13: runtime error: index 1024 out of bounds for type 'char [1024]' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /in/main.c:111:13 in ================================================================= ==90793==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffcc1b5a800 at pc 0x000000517104 bp 0x7ffcc1b5a3d0 sp 0x7ffcc1b5a3c8 WRITE of size 1 at 0x7ffcc1b5a800 thread T0 #0 0x517103 (/out/package/mumsh_memory_check+0x517103) #1 0x522303 (/out/package/mumsh_memory_check+0x522303) #2 0x7f83444c5b96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #3 0x41d039 (/out/package/mumsh_memory_check+0x41d039) Address 0x7ffcc1b5a800 is located in stack of thread T0 at offset 1056 in frame #0 0x51682f (/out/package/mumsh_memory_check+0x51682f) This frame has 2 object(s): [32, 1056) 'command' <== Memory access at offset 1056 overflows this variable [1184, 1192) 'fd424' HINT: this may be a false positive if your program uses some custom stack unwind me
JOJ Answer
mumsh $ mumsh $ mumsh $ mumsh $ mumsh $ success mumsh $ mumsh $ exit