Record Case Detail

Notes

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

Stderr

=================================================================
==115829==ERROR: AddressSanitizer: heap-use-after-free on address 0x602000000030 at pc 0x00000051f8d1 bp 0x7fffa5655ef0 sp 0x7fffa5655ee8
READ of size 4 at 0x602000000030 thread T0
    #0 0x51f8d0  (/out/package/calc_mem+0x51f8d0)
    #1 0x51b5db  (/out/package/calc_mem+0x51b5db)
    #2 0x7effe7353c86  (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
    #3 0x41e539  (/out/package/calc_mem+0x41e539)

0x602000000030 is located 0 bytes inside of 12-byte region [0x602000000030,0x60200000003c)
freed by thread T0 here:
    #0 0x517718  (/out/package/calc_mem+0x517718)
    #1 0x51afe7  (/out/package/calc_mem+0x51afe7)
    #2 0x7effe7353c86  (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

previously allocated by thread T0 here:
    #0 0x5169a0  (/out/package/calc_mem+0x5169a0)
    #1 0x51b2ef  (/out/package/calc_mem+0x51b2ef)
    #2 0x7effe7353c86  (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

SUMMARY: AddressSanitizer: heap-use-after-free (/out/package/calc_mem+0x5

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

What you are entering is: 1
empty? 0
5
What you are entering is: n
 inside the function

JOJ Answer

-1