Revert "Problem with realpath interceptor"
authorVitaly Buka <vitalybuka@google.com>
Wed, 25 Aug 2021 20:34:19 +0000 (13:34 -0700)
committerVitaly Buka <vitalybuka@google.com>
Wed, 25 Aug 2021 20:55:23 +0000 (13:55 -0700)
commit5213f307abf2d2ce70c103e758f2e72b24539cb3
tree433d202bf9de650af4d8a67352dba744a9bf3eec
parent3c11e5722c302a9dcf01b97ace868e156e376bc6
Revert "Problem with realpath interceptor"

Breaks realpath(, nullptr) for all sanitizers.

Somehow INTERCEPT_FUNCTION and INTERCEPT_FUNCTION_VER return
false even if everything seemingly right.

And this is the issue for COMMON_INTERCEPT_FUNCTION_GLIBC_VER_MIN.
There is a check in every sanitlizer:
if (!INTERCEPT_FUNCTION_VER(name, ver) && !INTERCEPT_FUNCTION(name))

For non-versioned interceptors when INTERCEPT_FUNCTION returns false
it's not considered fatal, and it just prints a warning.

However INTERCEPT_FUNCTION_VER in this case will fallback to
INTERCEPT_FUNCTION replacing realpath with wrong version.

We need to investigate that before relanding the patch.

This reverts commit faef0d042f523357fe5590e7cb6a8391cf0351a8.
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc