Page MenuHomePhabricator

[lldb] Check SafeToCallFunctions before calling functions in GetExceptionObjectForThread
ClosedPublic

Authored by kubamracek on Dec 27 2018, 3:30 PM.

Diff Detail

Repository
rLLDB LLDB

Event Timeline

kubamracek created this revision.Dec 27 2018, 3:30 PM
aprantl accepted this revision.Jan 3 2019, 3:06 PM
aprantl added a subscriber: aprantl.

A testcase that triggers this situation would be nice, too.

source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
558

I recently started writing these early-exit returns as return {};

This revision is now accepted and ready to land.Jan 3 2019, 3:06 PM
This revision was automatically updated to reflect the committed changes.

I recently started writing these early-exit returns as return {};

Good suggestion!

A testcase that triggers this situation would be nice, too.

I think this is too tricky. If I understand correctly, an example of an unsafe-to-call thread state is when we're parked inside a __select system call, and if we do invoke other code on that thread, sometimes, some kernel data structures can get out of sync from the thread state and the __select system call can sometimes return wrong results. Sounds quite hard to write a reliable test case for this, since the exact behavior also depends on OS version. I hope you'll forgive me for not providing this test :)