The kyua in ASAN-built-world reports: the 65 __asan_report_{load4|store8|load8}_noabort examples

From: Mark Millard <marklmi_at_yahoo.com>
Date: Wed, 12 Jan 2022 22:59:58 UTC
# kyua report --verbose | grep _noabort 
    #7 0x1111227 in __asan_report_load4_noabort /usr/main-src/contrib/llvm-project/compiler-rt/lib/asan/asan_rtl.cpp:122:1
    #7 0x111163a in __asan_report_store8_noabort /usr/main-src/contrib/llvm-project/compiler-rt/lib/asan/asan_rtl.cpp:128:1
. . .
    #7 0x10ce357 in __asan_report_load8_noabort /usr/main-src/contrib/llvm-project/compiler-rt/lib/asan/asan_rtl.cpp:123:1
. . .

(The others are examples of the same 3 routines. In fact there is
only that one _load4_ example in the list. The rest are _load8_ or
_store8_ examples.)

But when I look, I find that all of these fail to actually report the
load* or store* information, instead running into another problem while
trying to do that. It is this other problem that ends up being reported.
It is the same problem for all of them.

Picking an example:

=================================================================
AddressSanitizer: CHECK failed: asan_thread.cpp:371 "((ptr[0] == kCurrentStackFrameMagic)) != (0)" (0x0, 0x0) (tid=102427)
    #0 0x1112b31 in __asan::CheckUnwind() /usr/main-src/contrib/llvm-project/compiler-rt/lib/asan/asan_rtl.cpp:67:3
    #1 0x112e00b in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) /usr/main-src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_termin
ation.cpp:86:5
    #2 0x11153c1 in __asan::AsanThread::GetStackFrameAccessByAddr(unsigned long, __asan::AsanThread::StackFrameAccess*) /usr/main-src/contrib/llvm-project/compiler-rt/lib/asan/asan_thread.cpp
    #3 0x10bc5a3 in __asan::GetStackAddressInformation(unsigned long, unsigned long, __asan::StackAddressDescription*) /usr/main-src/contrib/llvm-project/compiler-rt/lib/asan/asan_descriptions.cpp:202
:11
    #4 0x10bc5a3 in __asan::AddressDescription::AddressDescription(unsigned long, unsigned long, bool) /usr/main-src/contrib/llvm-project/compiler-rt/lib/asan/asan_descriptions.cpp:454:21
    #5 0x10be09e in __asan::ErrorGeneric::ErrorGeneric(unsigned int, unsigned long, unsigned long, unsigned long, unsigned long, bool, unsigned long) /usr/main-src/contrib/llvm-project/compiler-rt/lib
/asan/asan_errors.cpp:390:7
    #6 0x11104fc in __asan::ReportGenericError(unsigned long, unsigned long, unsigned long, unsigned long, bool, unsigned long, unsigned int, bool) /usr/main-src/contrib/llvm-project/compiler-rt/lib/a
san/asan_report.cpp:475:16
    #7 0x1111227 in __asan_report_load4_noabort /usr/main-src/contrib/llvm-project/compiler-rt/lib/asan/asan_rtl.cpp:122:1
. . .

In each case, __asan::AsanThread::GetStackFrameAccessByAddr attempts to CHECK
ptr[0] == kCurrentStackFrameMagic and the CHECK fails --so that is what ends
up being reported.

My first guess would be that the load* and store* reports are for
misaligned stack accesses. But it is just a guess from my lack of
managing to think of anything else it would be checking where the
only context-usage apparently involved is: load or store with a size
in Bytes.

===
Mark Millard
marklmi at yahoo.com