Page MenuHomePhabricator

Force unwind frame with user-defined personality.
ClosedPublic

Authored by logan on Jan 17 2015, 12:07 AM.

Details

Summary

If libcxxabi is compiled as a shared library, and the
executable references the user-defined personality routines
(e.g. gxx_personality_v0), then the pointer comparison in
Unwind-EHABI.cpp won't work. This is due to the fact that
the PREL31 will point to the PLT stubs for the personality
routines (in the executable), while the
gxx_personality_v0
symbol reference is yet another (different) PLT stub (in the
libunwind.)

This will cause _Unwind_Backtrace() stops to unwind the frame
whenever it reaches __gxx_personality_v0(). This CL fix the
problem by calling the user-defined personality routines
with an undocumented API for force unwinding.

Diff Detail

Event Timeline

logan updated this revision to Diff 18339.Jan 17 2015, 12:07 AM
logan retitled this revision from to Force unwind frame with user-defined personality..
logan updated this object.
logan edited the test plan for this revision. (Show Details)
logan added reviewers: danalbert, rengolin, jroelofs.
logan added a subscriber: Unknown Object (MLST).
rengolin edited edge metadata.Jan 20 2015, 6:18 AM

I'll leave this one for @jroelofs... :)

jroelofs added inline comments.Jan 20 2015, 6:56 AM
src/Unwind/UnwindLevel1-gcc-ext.c
107

would be nice to re-use signExtendPrel31 instead.

144

which part specifically are you calling out as undocumented here? (would be useful info in the comment)

161

I think you want _US_VIRTUAL_UNWIND_FRAME | _US_FORCE_UNWIND here.

jroelofs accepted this revision.Jan 20 2015, 7:05 AM
jroelofs edited edge metadata.

LGTM with those changes.

This revision is now accepted and ready to land.Jan 20 2015, 7:05 AM
logan updated this revision to Diff 18530.Jan 21 2015, 9:29 AM
logan edited edge metadata.

Address the review comments.

logan added inline comments.Jan 21 2015, 9:32 AM
src/Unwind/UnwindLevel1-gcc-ext.c
107

Done.

144

Revised. Mentioned the undocumented flag _US_FORCE_UNWIND in the next revision.

161

Done.

logan updated this revision to Diff 18611.Jan 22 2015, 5:36 AM

Update.

logan closed this revision.Jan 22 2015, 5:39 AM

Thanks. Committed as rL226822.