Record Case Detail

Notes

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

Stderr

=================================================================
==57384==ERROR: AddressSanitizer: attempting double-free on 0x616000000680 in thread T0:
    #0 0x4dc7a0  (/out/package/ex4+0x4dc7a0)
    #1 0x7fb8363fc36d  (/lib/x86_64-linux-gnu/libc.so.6+0x7e36d)
    #2 0x4db23d  (/out/package/ex4+0x4db23d)
    #3 0x518827  (/out/package/ex4+0x518827)
    #4 0x514fe7  (/out/package/ex4+0x514fe7)
    #5 0x7fb83639fb96  (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #6 0x41cab9  (/out/package/ex4+0x41cab9)

0x616000000680 is located 0 bytes inside of 552-byte region [0x616000000680,0x6160000008a8)
freed by thread T0 here:
    #0 0x4dc7a0  (/out/package/ex4+0x4dc7a0)
    #1 0x7fb8363fc36d  (/lib/x86_64-linux-gnu/libc.so.6+0x7e36d)

previously allocated by thread T0 here:
    #0 0x4dc970  (/out/package/ex4+0x4dc970)
    #1 0x7fb8363fceb9  (/lib/x86_64-linux-gnu/libc.so.6+0x7eeb9)
    #2 0x515402  (/out/package/ex4+0x515402)
    #3 0x514fe7  (/out/package/ex4+0x514fe7)
    #4 0x7fb83639fb96  (/lib/x86_64-linux-gnu

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


        

JOJ Answer

STDOUT START
53 -58 93 52 31 7 175 -80 133 54 
44 -94 122 -165 156 14 127 119 -37 154 
-172 0 -53 115 -38 -57 14 -120 -28 -42 
-13 69 -20 118 66 -84 -95 -2 -4 -18 
97 -145 -18 -3 -74 -62 133 -157 -115 -65 
38 54 38 145 80 76 -2 -3 -119 29 
-164 86 -127 31 127 -39 -183 35 -72 -175 
43 8 90 -13 32 45 97 36 123 -192 
52 -43 -46 -88 181 -32 52 28 82 104 
132 130 -99 -74 -53 77 42 -36 -135 116 

-11063 7073 -9226 10778 14293 -8578 -6309 -2636 3500 3156 
6213 1284 -3265 5117 -8475 1383 8536 -11517 4469 8741 
-4436 -6017 -4697 -4742 -7748 -5657 1894 8056 -2978 -7854 
4451 -1768 -16792 -7825 6944 -4528 18713 -4737 -5280 5981 
-7099 10115 7892 12925 -4540 -8348 -20936 -2273 12185 -13324 
-10982 -7781 13238 -7389 5264 5828 16814 -13095 -11551 -3990 
14054 -6377 17280 -18006 -14081 -7877 1188 11538 6094 -23921 
-18503 -15912 743 -596 14964 -8090 18109 -1254 6298 -2412 
5963 -6688 7093 -156 -12631 -541 7917 1470 -3018 17273 
-3552 7838 11590 -4647 12104 14865 -3786 10451 7955 2057 

-11823 2066 -15