Record Case Detail

Notes

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

Stderr

/in/dictionary.c:168:17: runtime error: member access within misaligned address 0xbebebebebebebebe for type 'struct node', which requires 8 byte alignment
0xbebebebebebebebe: note: pointer points here
<memory cannot be printed>
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /in/dictionary.c:168:17 in 
/in/dictionary.c:168:17: runtime error: load of misaligned address 0xbebebebebebebece for type 'int', which requires 8 byte alignment
0xbebebebebebebece: note: pointer points here
<memory cannot be printed>
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /in/dictionary.c:168:17 in 
AddressSanitizer:DEADLYSIGNAL
=================================================================
==53467==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x000000516778 bp 0x7ffe62d0ff20 sp 0x7ffe62d0ff10 T0)
==53467==The signal is caused by a READ memory access.
==53467==Hint: address points to the zero page.
    #0 0x516777  (/out/package/dictionary+0x516777)
    #1 0x514d57  (/out/package/diction

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

0
***Print Dictionary***
Original: {1:5, }.
Reversed: {1:5, }.
****Print Finished****
1
***Print Dictionary***
Original: {0:6, 1:5, }.
Reversed: {1:5, 0:6, }.
****Print Finished****
2
***Print Dictionary***
Original: {0:6, 1:5, 3:4, }.
Reversed: {3:4, 1:5, 0:6, }.
****Print Finished****
3
***Print Dictionary***
Original: {0:6, 1:5, 2:8, 3:4, }.
Reversed: {3:4, 2:8, 1:5, 0:6, }.
****Print Finished****
4
The value is 4.
***Print Dictionary***
Original: {0:6, 1:5, 2:8, 3:4, }.
Reversed: {3:4, 2:8, 1:5, 0:6, }.
****Print Finished****