[all-commits] [llvm/llvm-project] faef0d: Problem with realpath interceptor

Dmitry Vyukov via All-commits all-commits at lists.llvm.org
Tue Aug 10 07:29:56 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: faef0d042f523357fe5590e7cb6a8391cf0351a8
      https://github.com/llvm/llvm-project/commit/faef0d042f523357fe5590e7cb6a8391cf0351a8
  Author: Dmitry Vyukov <dvyukov at google.com>
  Date:   2021-08-10 (Tue, 10 Aug 2021)

  Changed paths:
    M compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc

  Log Message:
  -----------
  Problem with realpath interceptor

tsan in some cases (e.g. after fork from multithreaded program, which arguably is problematic) increments ignore_interceptors and in that case runs just the intercepted functions and not their wrappers.
For realpath the interceptor handles the resolved_path == nullptr case though and so when ignore_interceptors is non-zero, realpath (".", nullptr) will fail instead of succeeding.
This patch uses instead the COMMON_INTERCEPT_FUNCTION_GLIBC_VER_MIN macro to use realpath@@GLIBC_2.3 whenever possible (if not, then it is likely a glibc architecture
with more recent oldest symbol version than 2.3, for which any realpath in glibc will DTRT, or unsupported glibc older than 2.3), which never supported NULL as second argument.

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D107819




More information about the All-commits mailing list