[all-commits] [llvm/llvm-project] 791a2e: [OpenMP][libomp] Remove false positive for memory ...

Jonathan Peyton via All-commits all-commits at lists.llvm.org
Thu Mar 2 23:15:29 PST 2023


  Branch: refs/heads/release/16.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 791a2eccf87ad3375a62153e926e6d8a56e2b437
      https://github.com/llvm/llvm-project/commit/791a2eccf87ad3375a62153e926e6d8a56e2b437
  Author: Jonathan Peyton <jonathan.l.peyton at intel.com>
  Date:   2023-03-02 (Thu, 02 Mar 2023)

  Changed paths:
    M openmp/runtime/src/kmp_safe_c_api.h
    M openmp/runtime/src/kmp_str.cpp

  Log Message:
  -----------
  [OpenMP][libomp] Remove false positive for memory sanitizer

The memory sanitizer intercepts the memcpy() call but not the direct
assignment of last byte to 0. This leads the sanitizer to believe the
last byte of a string based on the kmp_str_buf_t type is uninitialized.
Hence, the eventual strlen() inside __kmp_env_dump() leads to an
use-of-uninitialized-value warning.

Using strncat() instead gives the sanitizer the information it needs.

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

Fixes #60501

(cherry picked from commit 4ce32d2f12ec0e7a2551e251c1453d4b338cc2a7)




More information about the All-commits mailing list