[all-commits] [llvm/llvm-project] ca0fff: Make two texts static in `ReplayInlineAdvisor`

Tacet via All-commits all-commits at lists.llvm.org
Thu Jan 25 12:02:00 PST 2024


  Branch: refs/heads/users/AdvenamTacet/short-string-annotations-v3-testing
  Home:   https://github.com/llvm/llvm-project
  Commit: ca0fff7d20b5a57c4139998c3450f444d5105897
      https://github.com/llvm/llvm-project/commit/ca0fff7d20b5a57c4139998c3450f444d5105897
  Author: Advenam Tacet <advenam.tacet at trailofbits.com>
  Date:   2024-01-25 (Thu, 25 Jan 2024)

  Changed paths:
    M llvm/lib/Analysis/ReplayInlineAdvisor.cpp

  Log Message:
  -----------
  Make two texts static in `ReplayInlineAdvisor`

This commit makes two variables static.
That makes two buildbot tests pass with short string annotations.

Short string annotations PR (reverted):
- https://github.com/llvm/llvm-project/pull/79049

Tests fixed with this PR:
``
  LLVM :: Transforms/Inline/cgscc-inline-replay.ll
  LLVM :: Transforms/SampleProfile/inline-replay.ll
```
Buildbot output: https://lab.llvm.org/buildbot/#/builders/5/builds/40364/steps/9/logs/stdio

This PR does not resolve a problem with `Clang :: SemaCXX/builtins.cpp`.

I suspect that there may be use after end of life bug and it's fixed by this change.


  Commit: 0a1d3fd60d166c0633fd3343285963b32bc30794
      https://github.com/llvm/llvm-project/commit/0a1d3fd60d166c0633fd3343285963b32bc30794
  Author: Tacet <advenam.tacet at trailofbits.com>
  Date:   2024-01-25 (Thu, 25 Jan 2024)

  Changed paths:
    M libcxx/include/string
    A libcxx/test/libcxx/containers/strings/basic.string/asan_deque_integration.pass.cpp
    A libcxx/test/libcxx/containers/strings/basic.string/asan_short.pass.cpp
    A libcxx/test/libcxx/containers/strings/basic.string/asan_vector_integration.pass.cpp
    M libcxx/test/support/asan_testing.h

  Log Message:
  -----------
  Turn on ASan annotations for short strings (#79049)

Originally merged here: https://github.com/llvm/llvm-project/pull/75882
Reverted here: https://github.com/llvm/llvm-project/pull/78627

Reverted due to failing buildbots. The problem was not caused by the
annotations code, but by code in the `UniqueFunctionBase` class and in
the `JSON.h` file. That code caused the program to write to memory that
was already being used by string objects, which resulted in an ASan
error.

Fixes are implemented in:
- https://github.com/llvm/llvm-project/pull/79065
- https://github.com/llvm/llvm-project/pull/79066

Problematic code from `UniqueFunctionBase` for example:
```cpp
#ifndef NDEBUG
    // In debug builds, we also scribble across the rest of the storage.
    memset(RHS.getInlineStorage(), 0xAD, InlineStorageSize);
#endif
```


  Commit: a48e8cc6c792ee1c3d5c34c6b88cd01eefb3d1b4
      https://github.com/llvm/llvm-project/commit/a48e8cc6c792ee1c3d5c34c6b88cd01eefb3d1b4
  Author: Advenam Tacet <advenam.tacet at trailofbits.com>
  Date:   2024-01-25 (Thu, 25 Jan 2024)

  Changed paths:
    M clang/lib/AST/ExprConstant.cpp

  Log Message:
  -----------
  TESTING fix buildbot

This is not intended to be upstreamed, but resolves a problem locally.

I tested locally without `(void) RHS.data();`.


Compare: https://github.com/llvm/llvm-project/compare/ca0fff7d20b5%5E...a48e8cc6c792


More information about the All-commits mailing list