Notes
This function is in beta test. Please help improve it in the issues
here.
================================================================= ==5794==ERROR: AddressSanitizer: heap-use-after-free on address 0x615000000808 at pc 0x00000051a223 bp 0x7ffc72f45960 sp 0x7ffc72f45958 READ of size 8 at 0x615000000808 thread T0 #0 0x51a222 (/out/package/test_part1_new_memcheck+0x51a222) #1 0x51a1f5 (/out/package/test_part1_new_memcheck+0x51a1f5) #2 0x51aaab (/out/package/test_part1_new_memcheck+0x51aaab) #3 0x51e1b4 (/out/package/test_part1_new_memcheck+0x51e1b4) #4 0x521141 (/out/package/test_part1_new_memcheck+0x521141) #5 0x7f4556f49b96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #6 0x41d979 (/out/package/test_part1_new_memcheck+0x41d979) 0x615000000808 is located 8 bytes inside of 480-byte region [0x615000000800,0x6150000009e0) freed by thread T0 here: #0 0x516b58 (/out/package/test_part1_new_memcheck+0x516b58) #1 0x520cd7 (/out/package/test_part1_new_memcheck+0x520cd7) #2 0x7f4556f49b96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) previously
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
7 2046 0 15 65 32 7 67 33 16 69 34 70 3 1 39 80 19 40 9 83 41 84 20 85 42 4 87 43 88 21 89 44 10 0 2 55 112 27 13 115 57 116 28 117 58 6
JOJ Answer
7 2046 0 15 65 32 7 67 33 16 69 34 70 3 1 39 80 19 40 9 83 41 84 20 85 42 4 87 43 88 21 89 44 10 0 2 55 112 27 13 115 57 116 28 117 58 6 7 2171 0 15 65 32 7 67 33 16 69 34 70 3 1 39 80 19 40 9 83 41 84 20 85 42 4 87 43 88 21 89 44 10 0 2 55 112 27 13 115 57 116 28 117 58 6 125 7 2046 0 15 65 32 7 67 33 16 69 34 70 3 1 39 80 19 40 9 83 41 84 20 85 42 4 87 43 88 21 89 44 10 0 2 55 112 27 13 115 57 116 28 117 58 6 7 2046 0 15 65 32 7 67 33 16 69 34 70 3 1 39 80 19 40 9 83 41 84 20 85 42 4 87 43 88 21 89 44 10 0 2 55 112 27 13 115 57 116 28 117 58 6 7 2171 0 15 65 32 7 67 33 16 69 34 70 3 1 39 80 19 40 9 83 41 84 20 85 42 4 87 43 88 21 89 44 10 0 2 55 112 27 13 115 57 116 28 117 58 6 125 7 2296 0 15 65 32 7 67 33 16 69 34 70 3 1 39 80 19 40 9 83 41 84 20 85 42 4 87 43 88 21 89 44 10 0 2 55 112 27 13 115 57 116 28 117 58 6 125 125 7 2171 0 15 65 32 7 67 33 16 69 34 70 3 1 39 80 19 40 9 83 41 84 20 85 42 4 87 43 88 21 89 44 10 0 2 55 112 27 13 115 57 116 28 117 58 6 125 7 2171 0 15 65 32 7 67 33 16 69 34 70