I am currently debugging a heap-use-after-free.
==16772==ERROR: AddressSanitizer: heap-use-after-free on address 0x0679a27e at pc 0x00c57ebb bp 0x005de524 sp 0x005de524
READ of size 2 at 0x0679a27e thread T0
--STACK TRACE--
However, Asan gives the following information about where that memory was allocated and where it was freed:
0x0679a27e is located 510 bytes inside of 3443-byte region [0x0679a080,0x0679adf3)
freed by thread T0 here:
#0 0x6c466f88 in __asan_wrap_RtlFreeHeap D:a_work1ssrcvctoolsasanllvmcompiler-rtlibasanasan_malloc_win.cpp:1735
#1 0x6a2fc2f7 (C:WindowsSystem32DriverStoreFileRepositoryu0402593.inf_amd64_66758692e35a2906B402774amdxn32.dll+0x10adc2f7)
#2 0x6a2ed2d7 (C:WindowsSystem32DriverStoreFileRepositoryu0402593.inf_amd64_66758692e35a2906B402774amdxn32.dll+0x10acd2d7)
#3 0x6a2e626e (C:WindowsSystem32DriverStoreFileRepositoryu0402593.inf_amd64_66758692e35a2906B402774amdxn32.dll+0x10ac626e)
#4 0x69887061 (C:WindowsSystem32DriverStoreFileRepositoryu0402593.inf_amd64_66758692e35a2906B402774amdxn32.dll+0x10067061)
#5 0x698857cf (C:WindowsSystem32DriverStoreFileRepositoryu0402593.inf_amd64_66758692e35a2906B402774amdxn32.dll+0x100657cf)
#6 0x698763d5 (C:WindowsSystem32DriverStoreFileRepositoryu0402593.inf_amd64_66758692e35a2906B402774amdxn32.dll+0x100563d5)
previously allocated by thread T0 here:
#0 0x6c466a41 in __asan_wrap_RtlAllocateHeap D:a_work1ssrcvctoolsasanllvmcompiler-rtlibasanasan_malloc_win.cpp:1573
#1 0x6a2fc34d (C:WindowsSystem32DriverStoreFileRepositoryu0402593.inf_amd64_66758692e35a2906B402774amdxn32.dll+0x10adc34d)
#2 0x6a2e62ac (C:WindowsSystem32DriverStoreFileRepositoryu0402593.inf_amd64_66758692e35a2906B402774amdxn32.dll+0x10ac62ac)
#3 0x698822d2 (C:WindowsSystem32DriverStoreFileRepositoryu0402593.inf_amd64_66758692e35a2906B402774amdxn32.dll+0x100622d2)
#4 0x698857cf (C:WindowsSystem32DriverStoreFileRepositoryu0402593.inf_amd64_66758692e35a2906B402774amdxn32.dll+0x100657cf)
#5 0x698763d5 (C:WindowsSystem32DriverStoreFileRepositoryu0402593.inf_amd64_66758692e35a2906B402774amdxn32.dll+0x100563d5)
What am I supposed to do with this kind of information? According to Asan, the memory wasn’t allocated by me and it was also not freed by me?
Is this a false positive?
I am using clang-cl on windows x86 if that’s relevant.
4