Line 67: Char 28:
=================================================================
==22==ERROR: AddressSanitizer: stack-use-after-return on address 0x7fd95bd00028 at pc 0x561220a3030c bp 0x7fffb5ca0db0 sp 0x7fffb5ca0da8
READ of size 8 at 0x7fd95bd00028 thread T0
#0 0x561220a3030b in __ListNodeUtils__::hasCycle(ListNode*) (solution+0x19030b)
#1 0x561220a23414 in void _Serializer_::serialize<ListNode>(ListNode* const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) (solution+0x183414)
#2 0x561220a2562a in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> _Serializer_::serialize<ListNode>(ListNode* const&) (solution+0x18562a)
#3 0x561220a0d85b in main solution.cpp:67:28
#4 0x7fd95db56d8f (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: 490fef8403240c91833978d494d39e537409b92e)
#5 0x7fd95db56e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f) (BuildId: 490fef8403240c91833978d494d39e537409b92e)
#6 0x56122093c974 in _start (solution+0x9c974)
Address 0x7fd95bd00028 is located in stack of thread T0 at offset 40 in frame
#0 0x561220a0dc8f in Solution::insertGreatestCommonDivisors(ListNode*) solution.cpp:67
This frame has 1 object(s):
[32, 48) 'n' (line 44) <== Memory access at offset 40 is inside this variable
HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
(longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-use-after-return (solution+0x19030b) in __ListNodeUtils__::hasCycle(ListNode*)
Shadow bytes around the buggy address:
0x7fd95bcffd80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x7fd95bcffe00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x7fd95bcffe80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x7fd95bcfff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x7fd95bcfff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x7fd95bd00000: f5 f5 f5 f5 f5[f5]f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
0x7fd95bd00080: f5 f5 f5 f5 f5 f5 f5 f5 00 00 00 00 00 00 00 00
0x7fd95bd00100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x7fd95bd00180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x7fd95bd00200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x7fd95bd00280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==22==ABORTING