[Lldb-commits] [PATCH] D132397: [LLDB] Clean up after command fails

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 24 10:18:22 PDT 2022


jingham accepted this revision.
jingham added a comment.
This revision is now accepted and ready to land.

Actually, I think this is 100% correct, and corrects an error I made when I added argument number checking a little while back.

The comments on CheckRequirements say:

Every command should call

  // CommandObject::Cleanup() after it has completed.

The early exit in the error case bypassed the call to cleanup that the command was required to do.  The m_exe_ctx is probably the less important part of the cleanup that gets missed.  If you called a command that has eCommandTryTargetAPILock set in its requirements, but passed it the wrong number of arguments, then we would error out here w/o releasing the m_api_lock, and then if the next command was also a CommandObjectParsed command and required the API lock, it would deadlock.  You could probably even write a test that would show this deadlock.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132397/new/

https://reviews.llvm.org/D132397



More information about the lldb-commits mailing list