[all-commits] [llvm/llvm-project] 9b853f: [libc++] Fix vector sanitization annotations on de...

Dominic Chen via All-commits all-commits at lists.llvm.org
Mon Jan 20 05:58:14 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9b853f63bef20fd1f19ec933667b1f619afc0f1d
      https://github.com/llvm/llvm-project/commit/9b853f63bef20fd1f19ec933667b1f619afc0f1d
  Author: Dominic Chen <1108560+ddcc at users.noreply.github.com>
  Date:   2025-01-20 (Mon, 20 Jan 2025)

  Changed paths:
    M libcxx/include/__vector/vector.h

  Log Message:
  -----------
  [libc++] Fix vector sanitization annotations on destruction (#121031)

In https://reviews.llvm.org/D136765 / https://reviews.llvm.org/D144155,
the asan annotations for `std::vector` were modified to unpoison freed
backing memory on destruction, instead of leaving it poisoned. However,
calling `__clear()` instead of `clear()` skips informing the asan runtime
of this decrease in the accessible container size, which breaks the
invariant that the value of `old_mid` should match the value of `new_mid`
from the previous call to `__sanitizer_annotate_contiguous_container`, which
can trip the sanity checks for the partial poison between [d1, d2) and the
container redzone between [d2, c), if enabled. To fix this, ensure that
`clear()` is called instead, as is already done by `__vdeallocate()`.
Also remove `__clear()`, since it is no longer called.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list