This is an archive of the discontinued LLVM Phabricator instance.

[libunwind] Fix CIE v1 return address parsing
ClosedPublic

Authored by rprichard on Jul 13 2020, 10:06 PM.

Details

Reviewers
mstorsjo
Group Reviewers
Restricted Project
Commits
rG52d0a78b8315: [libunwind] Fix CIE v1 return address parsing
Summary
  • For CIE version 1 (e.g. in DWARF 2.0.0), the return_address_register field is a ubyte [0..255].
  • For CIE version 3 (e.g. in DWARF 3), the field is instead a ULEB128 constant.

Previously, libunwind accepted a CIE version of 1 or 3, but always
parsed the field as ULEB128.

Clang always outputs CIE version 1 into .eh_frame. (It can output CIE
version 3 or 4, but only into .debug_frame.)

Diff Detail

Event Timeline

rprichard created this revision.Jul 13 2020, 10:06 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 13 2020, 10:06 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript

Stylistic changes.

mstorsjo accepted this revision.Jul 13 2020, 10:42 PM
mstorsjo added a subscriber: mstorsjo.

LGTM

This revision is now accepted and ready to land.Jul 13 2020, 10:42 PM
This revision was automatically updated to reflect the committed changes.

Would it make sense to pick this to 11.0? CC @hans

hans added a comment.Jul 16 2020, 7:48 AM

Would it make sense to pick this to 11.0? CC @hans

Sounds good to me. Please go ahead and cherry-pick with the -x option, or let me know if you'd prefer me to do it.

Would it make sense to pick this to 11.0? CC @hans

Sounds good to me. Please go ahead and cherry-pick with the -x option, or let me know if you'd prefer me to do it.

Sorry, wasn't sure if this was directed to me or @rprichard (the diff author). I'm happy to do the cherry-pick, but I don't have a way of testing it.

hans added a comment.Jul 21 2020, 7:11 AM

Sorry, wasn't sure if this was directed to me or @rprichard (the diff author). I'm happy to do the cherry-pick, but I don't have a way of testing it.

I meant you, since I interpreted your question as a request. But if it's more of a question, maybe @rprichard is the right person to answer. Is there a need for this in 11.x, or should we just wait and let it ship in the next release?

There's only an issue if the return address register is in the range [128..255], and my impression is that probably never happens. It's also not a regression.

hans added a comment.Jul 22 2020, 6:46 AM

There's only an issue if the return address register is in the range [128..255], and my impression is that probably never happens. It's also not a regression.

Okay, let's not worry about it for the release then. Thanks!