This is an archive of the discontinued LLVM Phabricator instance.

[Sanitizers][Darwin] In DlAddrSymbolizer, return only the module file name instead of the comlpete module path during symbolication.
ClosedPublic

Authored by usama54321 on Jun 2 2023, 1:47 PM.

Details

Summary

There is an inconsistency between the stack traces of AtosSymbolizer and DlAddrSymbolizer. AtosSymbolizer removes the module file path prefix from the module file name during symbolication in the function ParseCommandOutput. This patch makes DlAddrSymbolizer consistent with this behavior.

rdar://108858834

Diff Detail

Event Timeline

usama54321 created this revision.Jun 2 2023, 1:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 2 2023, 1:47 PM
Herald added a subscriber: Enna1. · View Herald Transcript
usama54321 requested review of this revision.Jun 2 2023, 1:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 2 2023, 1:47 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
usama54321 edited the summary of this revision. (Show Details)Jun 2 2023, 2:06 PM
usama54321 edited the summary of this revision. (Show Details)
usama54321 edited the summary of this revision. (Show Details)Jun 2 2023, 2:21 PM
thetruestblue accepted this revision.EditedJun 5 2023, 3:04 PM

A little surprised we don't have "basename" utility functionality anywhere (looks like fuzzer has it). But this looks fine/clean to me.

This revision is now accepted and ready to land.Jun 5 2023, 3:04 PM
delcypher added inline comments.
compiler-rt/test/sanitizer_common/TestCases/Darwin/symbolizer-file-name-dladdr.cpp
9

Is this test case sufficient? It looks like it pass even without your change due to the {{.*}}

thetruestblue added inline comments.Jun 5 2023, 6:01 PM
compiler-rt/test/sanitizer_common/TestCases/Darwin/symbolizer-file-name-dladdr.cpp
9

I had this thought too, but I think the open paren is where the file path usually is... so I think this works.