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

Jonathan Peyton via All-commits all-commits at lists.llvm.org
Tue Feb 7 08:01:05 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4ce32d2f12ec0e7a2551e251c1453d4b338cc2a7
      https://github.com/llvm/llvm-project/commit/4ce32d2f12ec0e7a2551e251c1453d4b338cc2a7
  Author: Jonathan Peyton <jonathan.l.peyton at intel.com>
  Date:   2023-02-07 (Tue, 07 Feb 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




More information about the All-commits mailing list