@dmitshur requested issue #73922 to be considered for backport to the next 1.23 minor release.

Thanks @cherrymui, that was it. I can confirm that release-branch.go1.23 with CL 608995 applied fixes the "DW_FORM_strx with no .debug_str_offsets section" error, though the test doesn't pass right away because it begins to run into #70669. Applying CL 633038 on top fixes the "invalid memory address or nil pointer dereference" panic, and with the two CLs the TestScript/build_trimpath_cgo test begins to pass. all.bash passes locally too.

I'll close this issue since it doesn't need more investigation: we know that the problem is that Go 1.23 doesn't have fixes for https://github.com/go-delve/delve/issues/3797 and for #70669, they're available in Go 1.2​4 and newer. This wasn't uncovered earlier because it only reproduces on darwin/arm64 without -short flag, and we didn't have a darwin-arm64-longtest builder when Go 1.23 was being developed.

@gopherbot Please create a backport issue for Go 1.23. We either need to fix debug/macho's DWARF handling of section names longer than 16 chars, or otherwise add a skip for this test since it can't work without that fix. The fix probably doesn't meet the bar to be backported, so we can skip the test.

Comment From: gopherbot

Change https://go.dev/cl/689917 mentions this issue: [release-branch.go1.23] cmd/go: skip known TestScript/build_trimpath_cgo failure on darwin/arm64