Record Case Detail

Notes

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

Stderr

/in/database.c:149:17: runtime error: index -1 out of bounds for type 'char [120]'
=================================================================
==50226==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffc91705bbf at pc 0x5649b855567b bp 0x7ffc91704af0 sp 0x7ffc91704ae0
READ of size 1 at 0x7ffc91705bbf thread T0
    #0 0x5649b855567a in LOAD (/out/package/database+0x1167a)
    #1 0x5649b8551957 in main (/out/package/database+0xd957)
    #2 0x7f4c57b09b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #3 0x5649b8551ba9 in _start (/out/package/database+0xdba9)

Address 0x7ffc91705bbf is located in stack of thread T0 at offset 4191 in frame
    #0 0x5649b85548cf in LOAD (/out/package/database+0x108cf)

  This frame has 4 object(s):
    [32, 72) 'record'
    [128, 4148) 't'
    [4192, 4312) 'read' <== Memory access at offset 4191 underflows this variable
    [4352, 4472) 'line'
HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapco

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

LOAD: success
test5
LOAD: success
test4
test5
LOAD: success
test3
test4
test5
LOAD: success
test2
test3
test4
test5
LOAD: success
test1
test2
test3
test4
test5
LOAD: success
test0
test1
test2
test3
test4
test5
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
INSERT: success
UPDATE: update 3 records
UPDATE: update 3 records
UPDATE: update 3 records
UPDATE: update 3 re