Record Case Detail

Notes

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

Stderr

=================================================================
==46383==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x604000000038 at pc 0x55a425aee4b6 bp 0x7ffd53eec390 sp 0x7ffd53eec380
READ of size 4 at 0x604000000038 thread T0
    #0 0x55a425aee4b5 in findBook_test (/out/package/ex6+0x54b5)
    #1 0x55a425aed528 in main (/out/package/ex6+0x4528)
    #2 0x7f11406acb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #3 0x55a425aec5c9 in _start (/out/package/ex6+0x35c9)

0x604000000038 is located 0 bytes to the right of 40-byte region [0x604000000010,0x604000000038)
allocated by thread T0 here:
    #0 0x7f114187bb40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x55a425aedc81 in pushBack (/out/package/ex6+0x4c81)
    #2 0x55a425aee390 in createFromArray (/out/package/ex6+0x5390)
    #3 0x55a425aecdbd in main (/out/package/ex6+0x3dbd)
    #4 0x7f11406acb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

SUMMARY: AddressSaniti

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:
28->NULL
findBook(28): PASS
findBook(28): PASS
removeBook(28): PASS
findBook(28): PASS