Record Case Detail

Notes

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

Stderr

$ ./ex3_memory_check rand_char*.txt inc
main.c:148:13: runtime error: index 2049 out of bounds for type 'char *[2049]'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior main.c:148:13 in 
=================================================================
==28026==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fff0b2d15f8 at pc 0x0000005174db bp 0x7fff0b2ccd10 sp 0x7fff0b2ccd08
WRITE of size 8 at 0x7fff0b2d15f8 thread T0
    #0 0x5174da  (/out/package/ex3_memory_check+0x5174da)
    #1 0x517ed8  (/out/package/ex3_memory_check+0x517ed8)
    #2 0x7fcea1a72b96  (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #3 0x41cac9  (/out/package/ex3_memory_check+0x41cac9)

Address 0x7fff0b2d15f8 is located in stack of thread T0 at offset 18648 in frame
    #0 0x516d5f  (/out/package/ex3_memory_check+0x516d5f)

  This frame has 5 object(s):
    [32, 40) 'temp'
    [64, 2113) 'task'
    [2256, 18648) 'content' <== Memory access at offset 18648 overflows this variable
    [18912, 27108) 'a'
    [27376, 43768) 'b

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

Program exit with non zero value 1!

JOJ Answer

Correct!