Record Case Detail

Notes

This function is in beta test. Please help improve it in the issues here.

Stderr

 pwd: /out/package
ppid: 122135
   1: WRITELN sleep 10 | echo 123
   2: CTRL+C
Scan child pids of ppid: 122135
SIGINT
Send signal 2 to pid: 122135
Scan child pids of ppid: 122136
Send signal 2 to pid: 122136
Scan child pids of ppid: 122141
Send signal 2 to pid: 122141
   3: WRITELN echo success
   4: 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 $ 123
mumsh $ /in/read.c:31:29: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'unsigned long'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /in/read.c:31:29 in 
=================================================================
==122136==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x619000000982 at pc 0x000000517b62 bp 0x7ffc01340690 sp 0x7ffc01340688
READ of size 1 at 0x619000000982 thread T0
    #0 0x517b61  (/out/package/mumsh_memory_check+0x517b61)
    #1 0x5159f9  (/out/package/mumsh_memory_check+0x5159f9)
    #2 0x7f6ce563ab96  (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #3 0x41d1e9  (/out/package/mumsh_memory_check+0x41d1e9)

0x619000000982 is located 0 bytes to the right of 1026-byte region [0x619000000580,0x619000000982)
allocated by thread T0 here:
    #0 0x4dd0a0  (/out/package/mumsh_memory_check+0x4dd0a0)
    #1 0x5177a9  (/out/package/mumsh_memory_check+0x5177a9)
    #2 0x5159f9  (/out/package/mumsh_memory_check+0x5159f9)
    #3 0x7f6c

JOJ Answer

mumsh $ 123

mumsh $ success
mumsh $ exit