-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
DW_FORM_strx with no .debug_str_offsets section #3797
Comments
Can you upload a binary that shows this problem? You can do it by building with @cherrymui I think there might be new problems with the dsymutil of macOS 15, are you already aware? |
@aarzilli Hi! Followed you guidance but |
What is the C toolchain you're using, and what version? E.g. the output of |
@cherrymui hi. here you go: ❯ clang -v
Apple clang version 16.0.0 (clang-1600.0.26.3)
Target: arm64-apple-darwin24.0.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
❯ ld -v
@(#)PROGRAM:ld PROJECT:ld-1115.7.3
BUILD 07:00:06 Aug 10 2024
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
will use ld-classic for: armv6 armv7 armv7s i386 armv6m armv7k armv7m armv7em
LTO support using: LLVM version 16.0.0 (static support for 29, runtime is 29)
TAPI support using: Apple TAPI version 16.0.0 (tapi-1600.0.11.8)
❯ dsymutil -v
Apple LLVM version 16.0.0
(clang-1600.0.26.3)Optimized build. |
I have the same exact issue. Also running macOS 15.0 Beta (24A5327a). My clang, ld and dsymutil is also 16.0.0. I get the same |
Hello @cherrymui. Do you have any update on this issue? It impacts my ability to debug go code. If there any workarounds available, please advise 🙏🏻 |
I don't think the Go toolchain generate
This particular error looks like https://cs.opensource.google/go/go/+/master:src/debug/dwarf/entry.go;l=670 . Maybe Go's debug/dwarf package misses something? Do the system |
This is interesting. The name of sections in Mach-O executables is limited to 16 characters, apparently (if there is a way to store longer section names, somehow, I can't find it and debug/macho doesn't do it). |
PS the fix for this is going to be 🤮 |
Go 1.23 and earlier does not take into account that Mach-O section names are limited to 16 characters, which causes DWARF sections with long names to be truncated and become unreadable. Fixes go-delve#3797
Interesting. Could we have debug/dwarf understand __zdebug_str_off as __zdebug_str_offsets? (If it is not ambiguous?) |
@Jasstkn @AntonPieper can one of you test if #3799 fixes the problem? @cherrymui If the fix works I'll make something for the standard library, although it seems to me that this belongs more to debug/macho.(*File).DWARF. |
I built
|
Go 1.23 and earlier does not take into account that Mach-O section names are limited to 16 characters, which causes DWARF sections with long names to be truncated and become unreadable. Fixes go-delve#3797
Guys I'm with M3 Max chip and receive the same errors by trying to run the following code:
Just by importing anything from go-ethereum I receive the following error on trying to debug with dlv: Here are which version I'm using:
dlv:
go-ethereum:
Please help me fix this. |
The Mach-O file format truncates section names to 16 characters maximum, which makes some sections unrecognizable to debug/dwarf. This CL works around this problem by re-expanding the truncated section names. This problem was originally reported as: go-delve/delve#3797 Change-Id: I8c4a02493b8d5c3f63c831da43f6292124edf670 Reviewed-on: https://go-review.googlesource.com/c/go/+/608995 Auto-Submit: Ian Lance Taylor <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Cherry Mui <[email protected]>
I'm even using macOS 15.1 Beta, I reinstalled the system and the problem persists.
|
@aarzilli I tested your solution but it didn't work |
@cpeliciari GoLand uses it's own copy of dlv, you have to replace it, it's inside the GoLand directory somewhere. |
@aarzilli your fix works. Sorry for not testing it before :D I guess this fix will be released with the next version? |
@aarzilli Apparently, when starting the debug session, I need to manually resume it through GoLand, whereas before it would just go straight to the breakpoint. |
Go 1.23 and earlier does not take into account that Mach-O section names are limited to 16 characters, which causes DWARF sections with long names to be truncated and become unreadable. Fixes #3797
Thank you for sharing! For those having the application installed for all users, you may need to run this instead: GOBIN=/Applications/GoLand.app/Contents/plugins/go-plugin/lib/dlv/macarm go install github.com/go-delve/delve/cmd/dlv@master |
That works for me. Thanks! |
The above solution works for me, |
GoLand team released 2024.2.2.1 version of GoLand that includes the latest Delve version with the fix. You may consider updating the IDE instead of replacing Delve binary manually. |
MacOS 15, GoLand team released 2024.2.3, use (https://github.com/djimenez/iconv-go | https://github.com/faiface/beep | https://github.com/shirou/gopsutil/v3)will error like: Warning: no debug info found, some functionality will be missing such as stack traces and variable evaluation. |
Have you solved this problem? |
can you reproduce it with 1.23 version of Go? |
Have you able to resolve this issue? |
I get much the same as above, have been since I started learning go for a side project. API server listening at: 127.0.0.1:49730 |
I got a tougher problem: also Upgraded macOS to Sequoia 15.0.1
so I went to System Preferences --> Privacy & Security --> Full Disk Access --> enable radio button for terminal app. re-run the copy command in terminal (which works now).
then I discovered I edited the wrong properties file still facing |
Thanks |
Minimal code to reproduce an issue: https://go.dev/play/p/mT1pjsWIx9x. The same issue happens when using this dependency:
go build
works normally with no errors.dlv version
)?Delve Debugger Version: 1.23.0 Build: $Id: e673f2da02185a1c2b6dea52842b0a8c7e7a03b9 $
go version
)?MacOS on ARM, issue started to be reproduced since MacOS 15 Beta(24A5327a).
run dlv debugger via VSCode and manually
Debugger is working for my project.
The following error:
I wasn't able to dissect what exactly is causing the issue - any directions are appreciated!
I also found this issue with similar problem that is happening on MacOS 15 Beta mattn/go-sqlite3#1269
The text was updated successfully, but these errors were encountered: