[Lldb-commits] [PATCH] D69273: ValueObject: Fix a crash related to children address type computation

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 24 17:21:43 PST 2020

jingham added a comment.

In D69273#1765235 <https://reviews.llvm.org/D69273#1765235>, @davide wrote:

> We've been off all the past week. I'll circle back with Jim about this once I get to the office.

Sorry, I've been busy with other things.

In answer to Pavel's direct question "What did we do about the swift crashes" the current answer is "we backed out the patch from the swift-lldb sources".  But that's clearly not the good answer...

The thing that's surprising about the crash in the swift testsuite is that it happens because, in the process of building the dynamic ValueObject of the synthetic child for the expression result ValueObject for a simple swift expression, with this code in place one of the Values we are using that is in fact a load address type gets mislabeled as a host address, and then we crash accessing it in our address space.  IIUC, that's of the opposite of what this patch was trying to do...

BTW, I also think this patch is formally wrong for const result objects, because once the stop ID has moved on, const result object values should never be converted back to load address types.  They are supposed to represent the state at the time of the capture, so checking the state of the process after that time can't be right.  But that wasn't the failure we were seeing in the Swift testsuite.

ConstResult objects are still implicated in this crash, because "expr var" crashes but "frame var" for this swift variable works.  The difference between the two cases is that in the succeeding case the root ValueObject is a ValueObjectVariable, and in the crashing case a ValueObjectConstResult.   But it doesn't have to do with the const result getting into an inconsistent state because it updates itself when it shouldn't.  It seems like there's just something in the logic of UpdateChildrenAddressType that is wrong for ValueObjectConstResult.  But it seems to take a fairly complex chain of values - ConstResult->ConstResultChild->SyntheticValue->DynamicValue to trigger the crash, and the crash is actually in getting the backing data for a ValueObjectDynamicValue...

It will take me some more head scratching to figure out why this is going wrong but I'm currently in the process of hastening my eventual balding.  Hopefully, once I've figured that out I can get a fix and if I'm lucky a C/C++ based test case that shows the same error.

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list