Figure out why Xcode invoked lldb has started outputting `KeyError: 'topsrcdir'`
Categories
(Firefox Build System :: General, defect)
Tracking
(firefox73 fixed)
Tracking | Status | |
---|---|---|
firefox73 | --- | fixed |
People
(Reporter: jwatt, Assigned: jwatt)
Details
Attachments
(1 file)
I just updated to Xcode 11.3 and now when I start debugging the console starts with the following error:
Traceback (most recent call last):
File "temp.py", line 33, in lldb_autogen_python_bp_callback_func__21
KeyError: 'topsrcdir'
Assignee | ||
Comment 1•4 years ago
•
|
||
This turns out to be coming from the 'topsrcdir' variable in the .lldbinit that is generated from .lldbinit.in (which is placed in the top object directory).
Surprisingly, this error does not occur when the variable is set, but rather it appears that the error occurs when the temporary global object created for HandleCommand()
calls is torn down (and an unexpected global variable is found?...or something like that?). This is apparent because the Python statement after the assignment (another, nested, HandleCommand()
call) is still run successfully).
Assignee | ||
Comment 2•4 years ago
|
||
Further backing up the observation that this is a teardown issue is that if I add the following at the end of the .lldbinit file to delete 'topsrcdir' from the global scope, then the error goes away:
script del globals()["topsrcdir"]
Or more accurately, it just switches to complaining about lldbutils
instead. Getting rid of all errors requires:
script del globals()["topsrcdir"]
script del globals()["lldbutils"]
Assignee | ||
Comment 3•4 years ago
•
|
||
This is presumably a new bug in lldb when invoked through the driver that Xcode uses by linking to liblldb (it does not invoke the lldb binary as a separate process - see bug 942133).
There's not much we can do about this on our end. Either we remove the global variables as per the previous comment, or alternatively we could define a dummy variable with this bugs number in the variable name so that users are at least alerted to the fact that they can ignore the error. I would lean towards the latter since it seems unexpected that we would scrub the global scope of topsrcdir
and the lldbutils
module reference.
Assignee | ||
Comment 4•4 years ago
|
||
Pushed by jwatt@jwatt.org: https://hg.mozilla.org/integration/autoland/rev/0433c276ce9b Notify Xcode debugger users that the KeyError can be ignored. r=heycam
Comment 6•4 years ago
|
||
bugherder |
Assignee | ||
Comment 7•4 years ago
|
||
I reported this to LLVM upstream: https://bugs.llvm.org/show_bug.cgi?id=44352
Description
•