[llvm-bugs] [Bug 52187] New: [llvm-symbolizer] new pm regression, symbolization fails to recover line number with -ffunction-sections -gdwarf-aranges

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 15 08:43:11 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=52187

            Bug ID: 52187
           Summary: [llvm-symbolizer] new pm regression, symbolization
                    fails to recover line number with -ffunction-sections
                    -gdwarf-aranges
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Tooling
          Assignee: unassignedclangbugs at nondot.org
          Reporter: pierregousseau14 at gmail.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 25367
  --> https://bugs.llvm.org/attachment.cgi?id=25367&action=edit
use-after-scope-capture.cpp

Asan's test case use-after-scope-capture.cpp fails if -ffunction-sections
-gdwarf-aranges and new pm is enabled.

The test is failing as the stack trace does not contain line number anymore.
>---------
#include <functional>

int main() {
  std::function<int()> f;
  {
    int x = 0;
    f = [&x]() __attribute__((noinline)) {
      return x;  // BOOM
      // CHECK: ERROR: AddressSanitizer: stack-use-after-scope
      // CHECK: #0 0x{{.*}} in {{.*}}use-after-scope-capture.cpp:[[@LINE-2]]
    };
  }
  return f();  // BOOM
}
-----------<

llvm-symbolizer-output:
>--------------------
$ clang++ -ffunction-sections -gdwarf-aranges -gline-tables-only -O1
use-after-scope-capture.cpp && llvm-nm a.out --print-size -C | grep operator |
cut -d" " -f1 | sed 's/^/0x/' | xargs llvm-symbolizer -e a.out

main::$_0::operator()() const
use-after-scope-capture.cpp:0:0
-------------------<

-- 
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/20211015/e99f2221/attachment.html>


More information about the llvm-bugs mailing list