Record Case Detail

Notes

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

Stderr

 pwd: /out/package
ppid: 84481
   1: WRITELN echo 123 > 1.txt
   2: WRITELN echo 321 > 2.txt
   3: WRITELN cat < 1.txt | cat | cat | cat | cat | cat | cat | cat | cat | cat | cat | cat | cat | cat | cat >> 2.txt
   4: WRITELN cat 1.txt
   5: WRITELN cat 2.txt
   6: WRITELN ls
   7: 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 $ =================================================================
==84483==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6140000003d0 at pc 0x000000515a81 bp 0x7ffff7672780 sp 0x7ffff7672778
READ of size 8 at 0x6140000003d0 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 0x5172f9  (/out/package/mumsh_memory_check+0x5172f9)
    #4 0x7f1af9c9ab96  (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #5 0x41cd09  (/out/package/mumsh_memory_check+0x41cd09)

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

SUMMARY: AddressSanitizer: heap-buffer-overflow (/out/package/mumsh_memory_check+0x515a80)

JOJ Answer

mumsh $ mumsh $ mumsh $ mumsh $ 123
mumsh $ 321
123
mumsh $ 1.txt
2.txt
driver
mumsh
mumsh_memory_check
mumsh $ exit