Record Case Detail

Notes

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

Stderr

 pwd: /out/package
ppid: 84518
   1: WRITELN pwd | cat > 1.txt
   2: WRITELN cat 1.txt
   3: WRITELN ls
   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 Runtime Error. 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 $ =================================================================
==84521==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6140000005d0 at pc 0x000000515a81 bp 0x7ffe93cb04c0 sp 0x7ffe93cb04b8
READ of size 8 at 0x6140000005d0 thread T0
    #0 0x515a80  (/out/package/mumsh_memory_check+0x515a80)
    #1 0x515f6f  (/out/package/mumsh_memory_check+0x515f6f)
    #2 0x516dad  (/out/package/mumsh_memory_check+0x516dad)
    #3 0x516b10  (/out/package/mumsh_memory_check+0x516b10)
    #4 0x5172f9  (/out/package/mumsh_memory_check+0x5172f9)
    #5 0x7f375d9b9b96  (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #6 0x41cd09  (/out/package/mumsh_memory_check+0x41cd09)

0x6140000005d0 is located 0 bytes to the right of 400-byte region [0x614000000440,0x6140000005d0)
allocated by thread T0 here:
    #0 0x4dcbc0  (/out/package/mumsh_memory_check+0x4dcbc0)
    #1 0x517119  (/out/package/mumsh_memory_check+0x517119)
    #2 0x7f375d9b9b96  (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

SUMMARY: AddressSanitizer: hea

JOJ Answer

mumsh $ mumsh $ /out/package
mumsh $ 1.txt
driver
mumsh
mumsh_memory_check
mumsh $ exit