This is an archive of the discontinued LLVM Phabricator instance.

[llvm-exegesis] Add explicit error for segmenetation faults
AbandonedPublic

Authored by aidengrossman on Aug 15 2023, 10:25 PM.

Details

Summary

When benchmarking certain snippets that access memory, segmentation
faults are a very real possibility if the memory annotations are not
perfect. These situtations are currently difficult to debug as there is
no indication of which addresses need to be mapped. This patch adds in
support for printing the address a segmentation fault occurred at to
make it easier to gather this information.

Diff Detail

Event Timeline

aidengrossman created this revision.Aug 15 2023, 10:25 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 15 2023, 10:25 PM
Herald added a subscriber: mstojanovic. · View Herald Transcript
aidengrossman requested review of this revision.Aug 15 2023, 10:25 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 15 2023, 10:25 PM

I've structured this as a different class of error rather than as a SnippetCrash with the address inside a string as I intend to use this in a downstream basic block annotator application and need programatic access to the address at which the segmentation fault occurred.

Bump on this when reviewers have a chance. Thanks!

It looks like we'll have to implement such an escape for any crash type that client code wants to handle. Have you considered keeping only SnipetCrash, but storing si_signo and si_addr there ?

Or maybe even the whole siginfo_t actually.