Record Case Detail

Notes

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

Stderr

 pwd: /out/package
ppid: 10232
   1: WRITELN echo 123>1.txt
   2: WRITELN echo 222 > 2.txt
   3: WRITELN echo 321   >    3.txt
   4: WRITELN echo 123>>1.txt
   5: WRITELN echo 2 > 1.txt
   6: WRITELN cat 1.txt
   7: WRITELN cat 1.txt >> 2.txt
   8: WRITELN cat 2.txt
   9: WRITELN rm 1.txt
  10: WRITELN rm 2.txt
  11: WRITELN rm  3.txt
  12: WRITELN exit

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 $ mumsh $ mumsh $ /in/redirection.c:96:44: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'unsigned long'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /in/redirection.c:96:44 in 
=================================================================
==10241==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000000271 at pc 0x00000051b938 bp 0x7ffed39bb310 sp 0x7ffed39bb308
READ of size 1 at 0x602000000271 thread T0
    #0 0x51b937  (/out/package/mumsh_memory_check+0x51b937)
    #1 0x51b084  (/out/package/mumsh_memory_check+0x51b084)
    #2 0x51ce29  (/out/package/mumsh_memory_check+0x51ce29)
    #3 0x518021  (/out/package/mumsh_memory_check+0x518021)
    #4 0x51571a  (/out/package/mumsh_memory_check+0x51571a)
    #5 0x7fd287a92b96  (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #6 0x41d299  (/out/package/mumsh_memory_check+0x41d299)

0x602000000271 is located 0 bytes to the right of 1-byte region [0x602000000270,0x602000000271)
allocated by thread T0 here:

JOJ Answer

mumsh $ mumsh $ mumsh $ mumsh $ mumsh $ mumsh $ 2
mumsh $ mumsh $ 222
2
mumsh $ mumsh $ mumsh $ mumsh $ exit