Record Case Detail

Notes

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

Stderr

=================================================================
==46256==ERROR: AddressSanitizer: heap-use-after-free on address 0x604000003070 at pc 0x559f6ef12899 bp 0x7ffea8e44010 sp 0x7ffea8e44000
READ of size 8 at 0x604000003070 thread T0
    #0 0x559f6ef12898 in removeBook (/out/package/ex6+0x3898)
    #1 0x559f6ef13250 in main (/out/package/ex6+0x4250)
    #2 0x7f4367ed1b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #3 0x559f6ef12549 in _start (/out/package/ex6+0x3549)

0x604000003070 is located 32 bytes inside of 40-byte region [0x604000003050,0x604000003078)
freed by thread T0 here:
    #0 0x7f43690a07a8 in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xde7a8)
    #1 0x559f6ef12846 in removeBook (/out/package/ex6+0x3846)
    #2 0x559f6ef13250 in main (/out/package/ex6+0x4250)
    #3 0x7f4367ed1b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

previously allocated by thread T0 here:
    #0 0x7f43690a0b40 in __interceptor_malloc (/usr/lib/x86_64

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

Linked-List:
5067->2992->1161->1986->3821->3215->3289->503->2593->3061->3184->2522->4245->3650->1647->5682->854->5094->375->3605->5002->254->5712->846->445->869->2848->2367->300->368->2622->5129->6194->745->3318->2670->2276->3519->2118->5016->1582->2923->4763->2796->4801->5307->5497->91->2168->4093->4->6009->4843->4197->126->569->2480->5945->3419->4676->231->4100->3523->4669->5999->3460->3985->5395->2301->834->169->5656->3499->4710->5186->1404->2135->2359->5450->2007->1731->122->1717->380->5397->3331->1269->3188->3297->1152->1762->4301->5019->3257->1356->3207->5199->1074->2845->3535->1659->2517->2095->2575->4875->2154->128->628->1176->290->1350->924->434->1159->2209->34->117->3474->1043->4381->552->2287->3663->50->5063->2330->2410->1664->5614->327->3488->1132->5890->6141->4495->4246->3026->6038->1326->2299->1904->2239->4915->400->1042->783->1038->1936->2921->4956->2766->502->3424->3380->5888->3399->2916->2082->224->330->2685->3547->2837->1644->5163->4657->4968->726->6182->5286->3584->1504->1197->6179->1409->1