[llvm-bugs] [Bug 42287] New: Add a function to undo __lsan_ignore_object

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jun 14 14:00:27 PDT 2019


            Bug ID: 42287
           Summary: Add a function to undo __lsan_ignore_object
           Product: compiler-rt
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: lsan
          Assignee: unassignedbugs at nondot.org
          Reporter: terrelln at fb.com
                CC: llvm-bugs at lists.llvm.org

I recently added leak sanitizer suppressions to Facebook's folly library [1].
We don't use __lsan_ignore_object() because you can't undo the operation. Can
we add a function to remember an object we've previously ignored?

An example where this is useful:

#include <folly/concurrency/AtomicSharedPtr.h>
#include <folly/memory/SanitizeLeak.h>

class Data;
class LeakedDataPtr {
  std::shared_ptr<const Data> get() const {
    return ptr_.load();

  void update(std::shared_ptr<const Data> data) {
    auto newPtr = data.get();
    auto old = ptr_.exchange(std::move(data));

  static LeakedDataPtr& instance() {
    static auto* instancePtr = new LeakedDataPtr();
    return *instancePtr;

  folly::atomic_shared_ptr<const Data> ptr_;

[1] https://github.com/facebook/folly/blob/master/folly/memory/SanitizeLeak.h

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190614/ba9a2872/attachment.html>

More information about the llvm-bugs mailing list