This is an archive of the discontinued LLVM Phabricator instance.

https://reviews.llvm.org/D58394 done right
ClosedPublic

Authored by jingham on Feb 27 2019, 10:40 AM.

Details

Summary

I was running the lit tests by hand (since you can't actually run them with the Xcode build) and missed one crucial fact. The lit tests are all run in batch mode with command files. Normally, in lldb, the main interpreter in in Async mode, and individual commands choose to be in sync or async mode based, for instance, on whether we are handing the inferior's stdout in our terminal or not. But when sourcing command files, the interpreter runs in Sync mode - since it never makes sense for batch files to run in Async mode.

Normally that doesn't make any difference, but there was an error in how "run by starting stopped and then attaching" in sync mode was implemented. It hijacked the process state events so that it could handle the initial SIGSTOP that came from the attach. Then when it decided to continue synchronously, it didn't do so by calling ResumeSynchronous, but just kept the old hijack listener in place and waited for the events by hand. So other code couldn't tell that a sync resume was in progress. That was the difference that was causing the failure Pavel saw (and I should have seen had I been more careful in running the lit tests by hand.)

This is the same patch as D58394 except that I changed how Target::Launch handles the sync case, just replacing the hand-rolled Resume with a call to ResumeSynchronous.

BTW, is it possible to re-open a closed review, I didn't see a way to do that, so I had to make another.

Diff Detail

Repository
rLLDB LLDB

Event Timeline

jingham created this revision.Feb 27 2019, 10:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 27 2019, 10:40 AM
labath accepted this revision.Mar 1 2019, 5:55 AM

Yes, that did the trick. The new test is passing on linux now as well.

Regarding BTW, I see the option to "reopen a revision" in the drop down menu at the bottom of the page (the same one you use to accept the revision and stuff). AFAICT, even I am able to reopen that other revision.

This revision is now accepted and ready to land.Mar 1 2019, 5:55 AM

Excellent, thanks! I didn't think to look there.

This revision was automatically updated to reflect the committed changes.