[PATCH] D159378: [msan][s390x] Fix long double interceptors

Ulrich Weigand via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 1 12:56:47 PDT 2023


uweigand created this revision.
uweigand added a reviewer: MaskRay.
Herald added a subscriber: Enna1.
Herald added a project: All.
uweigand requested review of this revision.
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.

After https://reviews.llvm.org/D158943, the strtol test case is failing on the "long double" functions. This is due to two problems.

The first problem is that s390x is one of the architectures where the "long double" type was changed from a 64-bit IEEE to a 128-bit IEEE type back in the glibc 2.4 days.  This means that glibc still exports two versions of the long double functions (those that already existed back then), and we have to intercept the correct version.  There is already an existing define SANITIZER_NLDBL_VERSION that indicates this situation, we simply have to respect it when intercepting strtold and wcstold.

The second problem is that on s390x a long double return value is passed in memory via implicit reference.  This means the interceptor for functions returning long double has to unpoison that memory slot, or else we will get false-positive uninitialized memory reference warnings when the caller accesses that return value - similar to what is already done in the mallinfo interceptor.  Create a variant macro INTERCEPTOR_STRTO_SRET and use it on s390x.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D159378

Files:
  compiler-rt/lib/msan/msan_interceptors.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159378.555471.patch
Type: text/x-patch
Size: 6167 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230901/f1f5de02/attachment.bin>


More information about the llvm-commits mailing list