This is an archive of the discontinued LLVM Phabricator instance.

[NativeProcessLinux] Remove logging and error callbacks
ClosedPublic

Authored by labath on Apr 29 2015, 6:43 AM.

Details

Summary

These are remnants of the thread state coordinator, which are now unnecessary. I have basically
inlined the callbacks. No functional change.

PS: This is logically independent on D9321, but should be applied on top of it. Otherwise,
trivial but annoing merge errors may occur.

Diff Detail

Event Timeline

labath updated this revision to Diff 24630.Apr 29 2015, 6:43 AM
labath retitled this revision from to [NativeProcessLinux] Remove logging and error callbacks.
labath updated this object.
labath edited the test plan for this revision. (Show Details)
labath added reviewers: chaoren, vharron.
labath added a subscriber: Unknown Object (MLST).
vharron accepted this revision.Apr 29 2015, 7:12 AM
vharron edited edge metadata.

I have ran dosep.py (-A i386 -A x86_64 -C gcc -C clang-3.5 -C clang-tot) about 20 times. The results improved. I'm running another 80 times to get more resolution.

This revision is now accepted and ready to land.Apr 29 2015, 7:12 AM
chaoren added inline comments.May 1 2015, 6:21 PM
source/Plugins/Process/Linux/NativeProcessLinux.cpp
4256

I know it's probably going to be a pain in the ass, but could you make all of these return Error (and propagate them?) since you're getting rid of the error_function?

4265

Please use lldb_assert (#include "lldb/Utility/LLDBAssert.h") instead. Stack traces! This specific case would probably go back to returning Error though.

labath added inline comments.May 6 2015, 6:36 AM
source/Plugins/Process/Linux/NativeProcessLinux.cpp
4256

I've propagated these errors up to the Monitor*** functions and similar. There, they get ignored. I'm not really sure what we can do with these (hypthetical?) errors. Right now, the only thing that can generate an Error here is if the PTRACE_CONT call fails. If this happens, then we either have a kernel bug or lldb bug. In any case, the best we can do is log it (which was already done in ResumeOperation) and cross our fingers.

4265

Changed to lldb_assert. I think this condition is serious enough to warrant a hard failure. This signifies a discrepancy between the thread list maintained by NPL and the one by the (almost-dead) TSC. It is definitely a programming error, and an attempt to continue beyond this will very likely fail at a later point, where it could be more difficult to diagnose the problem (or worse, we could actually continue, but introduce subtle errors). Asserts like these (the original error function also asserted) have helped me find the original waitpid<->ptrace race.

In any case, I am already preparing a change to remove this double accounting of threads, so these asserts will go away then.

labath updated this revision to Diff 25043.May 6 2015, 6:37 AM
labath edited edge metadata.

Address review comments. Please take another look.

chaoren accepted this revision.May 6 2015, 10:19 AM
chaoren edited edge metadata.

LGTM.

This revision was automatically updated to reflect the committed changes.