Skip to content

[llvm-symbolizer] new pm regression, symbolization fails to recover line number with -ffunction-sections -gdwarf-aranges #51529

@goussepi

Description

@goussepi
Bugzilla Link 52187
Version unspecified
OS Windows NT
Attachments use-after-scope-capture.cpp
CC @aeubanks,@dwblaikie,@jmorse,@pogo59,@pogo59

Extended Description

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

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
-------------------<

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions