Record Case Detail

Notes

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

Stderr

 pwd: /out/package
ppid: 3176
   1: WRITELN echo 123
   2: WRITELN 
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 $ 123
mumsh $ /in/mumsh.c:368:20: runtime error: index -1 out of bounds for type 'char [1024]'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /in/mumsh.c:368:20 in 
=================================================================
==3177==ERROR: AddressSanitizer: stack-buffer-underflow on address 0x7ffe8a98f99f at pc 0x0000005214c7 bp 0x7ffe8a98f970 sp 0x7ffe8a98f968
READ of size 1 at 0x7ffe8a98f99f thread T0
    #0 0x5214c6  (/out/package/mumsh_memory_check+0x5214c6)
    #1 0x7f1bee520b96  (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #2 0x41d079  (/out/package/mumsh_memory_check+0x41d079)

Address 0x7ffe8a98f99f is located in stack of thread T0 at offset 31 in frame
    #0 0x520faf  (/out/package/mumsh_memory_check+0x520faf)

  This frame has 1 object(s):
    [32, 1056) 'input' <== Memory access at offset 31 underflows this variable
HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext
      (longjmp and C++ exceptions *are* supported)
SUMMA

JOJ Answer

mumsh $ 123
mumsh $ mumsh $ exit