New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runtime: TestLldbPython failing with 'no intvar' #31188
Comments
I have LLDB on my laptop and it passes.
My LLDB is older though.
|
Fails quite nicely for me, with the matching lldb version. I assume this has something to do with updates to macOS. |
Don't try this with MacPorts Python:
|
I do, because of frustrations with gdb and codesigning. But I may be the only one. |
Gdb worked for me last week, but not this week. Seriously. |
I sometimes do as well. But my use case doesn't really involve the python part (or even nicely formatted variables, etc.). |
dwarfdump -verify is very whiny. |
@josharian sounds good to me. No objection on my end. |
It's not good that it causes all.bash to fail for Mojave users. |
Change https://golang.org/cl/170281 mentions this issue: |
It's broken on our builders (once we enabled dev mode on our Macs, see CL 170339) Updates #31188 Change-Id: Iceea65dc79576057b401a461bfe39254fed1f7ed Reviewed-on: https://go-review.googlesource.com/c/go/+/170281 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
This may be related to whatever is going on in #29244, which causes a somewhat different failure on some Linux machines with the right (or wrong) combination of lldb and kernel versions. |
It looks, though not quite proven, like this is a newish enhancement to a bug in lldb. The accompanying dwarf dumping tools fail to properly recognize "base address selection entries" (DWARF 4, section 2.6.2, page 30) and instead decodes them as beginning and ending address offsets, in turn mis-interpreting the actual beginning and ending offsets that follow. Apparently lldb has historically failed to properly process base address selection entries and we hacked around it for Darwin, but now their mere presence causes failure. The string "base address ent" appears nowhere in the lldb sources. |
It's reading the section start to finish rather than actually using the references? Great. Unfortunately a base address selector is shorter than a location list entry -- it doesn't have a location expression length -- so a simple strategy of just zeroing them out won't work. When I wrote this, I was uncomfortable actually changing the size of the .debug_loc section for fear of breaking subsequent link steps. We do have some precedent for that now, though, since DWARF compression does it. So it might be possible to actually strip the base address entries rather than leaving them around as junk data. |
Change https://golang.org/cl/170638 mentions this issue: |
@heschik we're already changing DWARF section sizes in the object file reader, e.g. patchDWARFName. |
That's changing the size of symbols on their way in to the linker, which should be pretty harmless. I'm pretty sure that |
To be clear, I am benchmarking a CL that removes the base address entries entirely, and though that made dwarfdump happy (and gnu objdump and delve remained happy), it did not fix the lldb test failure. |
Change https://golang.org/cl/170798 mentions this issue: |
It's broken on our builders (once we enabled dev mode on our Macs, see CL 170339) Updates #31188 Change-Id: Iceea65dc79576057b401a461bfe39254fed1f7ed Reviewed-on: https://go-review.googlesource.com/c/go/+/170281 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit 46c3e21) Reviewed-on: https://go-review.googlesource.com/c/go/+/170798 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
On Mojave, it looks like your option for debugging Go is Delve, even with the Go binaries fixed to make dwarfdump happy. The binaries on Macos were in fact technically incorrect because there were no references to the BAS entries in .debug_loc. Objdump (from macports, gobjdump) would diagnose this problem correctly, dwarfdump would get completely confused. Gdb from homebrew or from macports does not work, even with updated codesigning, even with with a properly configured .gdbinit (must contain |
Also, just to be clear, I'm going to work on other problems. I cannot see recommending anything but Delve to Go users on Macos, because so far attempting to use the other debuggers merely wastes time. |
Change https://golang.org/cl/171158 mentions this issue: |
This was originally Revert "cmd/link: fix up debug_range for dsymutil (revert CL 72371)" which has the effect of no longer using Base Address Selection Entries in DWARF. However, the build-time costs of that are about 2%, so instead the hacky fixup that generated technically incorrect DWARF was removed from the linker, and the choice is instead made in the compiler, dependent on platform, but also under control of a flag so that we can report this bug against LLDB/dsymutil/dwarfdump (really, the LLVM dwarf libraries). This however does not solve #31188; debugging still fails, but dwarfdump no longer complains. There are at least two LLDB bugs involved, and this change will at allow us to report them without them being rejected because our now-obsolete workaround for the first bug creates not-quite-DWARF. Updates #31188. Change-Id: I5300c51ad202147bab7333329ebe961623d2b47d Reviewed-on: https://go-review.googlesource.com/c/go/+/170638 Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com>
By-the-way, this is looking more like someone enhanced the bejeezus out of the LLVM Dwarf library concurrent with the Mojave-related XCode upgrade ; all sorts of stuff is broken, and it's not the Go side that's broken. This hasn't been proven in this case yet, but given how the last few weeks have been spent it looks like a good bet. Just for example, if you want to debug with lldb, you'll need to turn off compressed dwarf, because the splitdwarf trick no longer works. |
During all.bash, I 100% reproducibly get:
On macOS.
The builders aren't failing because of #31123.
cc @heschik @aarzilli @thanm @dr2chase
The text was updated successfully, but these errors were encountered: