Open nsadeveloper789 opened 1 month ago
@llvm/issue-subscribers-lldb
Author: Dan (nsadeveloper789)
I fixed this in https://github.com/apple/llvm-project/pull/8821
Oops, make that:
https://github.com/llvm/llvm-project/pull/93880
The previous one was for the wrong project...
a92f7832f35c6c4792d8693e724c19802da75b36
This commit actually fixes a bug we were encountering with LLDB 1500 in Xcode, but trades it for a segfault in the latest
main
. The commit adds some calls toValueObjectConstResult::Create(nullptr, error)
. If, in Python, you callrepr(value)
on such a value, LLDB will crash:(I've scrubbed addresses and file paths.)
While I had my own script I was working from, I suspect it's fairly easy to reproduce by amending
TestRunLocker.py
to assert onrepr(val)
, not justrepr(error)
orerror.GetCString()
.I was able to fix it by replacing
nullptr
withexe_ctx.GetBestExecutionContextScope()
, but I only tried this withSBTarget.cpp
. I'm not certain this is the correct fix, or if the formatters need fixing to handle nullptr. There are also other places that pass in nullptr besides those added by the referenced commit.Aside
If you're curious, the actual problem we were investigating involved
SBProcess.GetMemoryRegionInfo
. We eventually devised a script that turned out to be very similar to yourTestRunLocker.py
case:$pc
.) It correctly returned an error, because the target is running.If, for the second query, we used
GetMemoryRegions
, we got an empty list. If we usedGetMemoryRegionInfo
, we got an error:qMemoryRegionInfo not supported
.In preparing to submit that bug, we built the latest and re-ran our script, but it crashed instead. We can confirm the
qMemoryRegionInfo
thing is no longer an issue in the latestmain
branch, but this new bug remains. So long as we avoid printing the evaluated value, our script now behaves correctly.