Skip to content
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

plugin: test fails for debug sections on Darwin #27502

Closed
YoshikiShibata opened this issue Sep 4, 2018 · 10 comments
Closed

plugin: test fails for debug sections on Darwin #27502

YoshikiShibata opened this issue Sep 4, 2018 · 10 comments
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@YoshikiShibata
Copy link

Please answer these questions before submitting your issue. Thanks!

What did you do?

Rebuild the lastest tip version with all.bash

What did you expect to see?

All tests pass.

What did you see instead?

##### ../misc/cgo/testso

##### ../misc/cgo/testsovar

##### ../misc/cgo/testcarchive
PASS

##### ../misc/cgo/testcshared
PASS

##### ../misc/cgo/testplugin
error opening DWARF: decoding dwarf section info at offset 0x0: too shortexit status 1
2018/09/05 07:43:23 Failed: exit status 1
2018/09/05 07:43:24 FAILED

Does this issue reproduce with the latest release (go1.11)?

N/A

System details

go version devel +b444215116 Tue Sep 4 20:41:58 2018 +0000 darwin/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/yoshiki.shibata/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/yoshiki.shibata/gocode"
GOPROXY=""
GORACE=""
GOROOT="/Users/yoshiki.shibata/tools/go"
GOTMPDIR=""
GOTOOLDIR="/Users/yoshiki.shibata/tools/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
GOROOT/bin/go version: go version devel +b444215116 Tue Sep 4 20:41:58 2018 +0000 darwin/amd64
GOROOT/bin/go tool compile -V: compile version devel +b444215116 Tue Sep 4 20:41:58 2018 +0000
uname -v: Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64
ProductName:	Mac OS X
ProductVersion:	10.13.6
BuildVersion:	17G65
lldb --version: lldb-902.0.79.7
  Swift-4.1
@heschi
Copy link
Contributor

heschi commented Sep 4, 2018

This was 9c83383. Sorry, I thought that the Mac trybots were enabled again so I didn't test it manually. I'm not in a position to do anything until tomorrow, maybe @aarzilli can take a look.

@gopherbot
Copy link

Change https://golang.org/cl/133435 mentions this issue: testplugin: disable DWARF tests on darwin

gopherbot pushed a commit that referenced this issue Sep 5, 2018
For some reason on darwin the linker still can't add debug sections to
plugins. Executables importing "plugin" do have them, however.

Because of issue 25841, plugins on darwin would likely have bad debug
info anyway so, for now, this isn't a great loss.

This disables the check for debug sections in plugins for darwin only.

Updates #27502

Change-Id: Ib8f62dac1e485006b0c2b3ba04f86d733db5ee9a
Reviewed-on: https://go-review.googlesource.com/133435
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@andybons andybons changed the title misc/cgo/testplugin failed misc/cgo/testplugin: fails for debug sections in plugins on Darwin Sep 5, 2018
@andybons andybons added the NeedsFix The path to resolution is known, but the work has not been done. label Sep 5, 2018
@andybons andybons added this to the Go1.12 milestone Sep 5, 2018
@ianlancetaylor ianlancetaylor changed the title misc/cgo/testplugin: fails for debug sections in plugins on Darwin plugin: test fails for debug sections on Darwin Dec 13, 2018
@ianlancetaylor ianlancetaylor modified the milestones: Go1.12, Unplanned Dec 13, 2018
@juhwany
Copy link

juhwany commented Sep 4, 2019

@ianlancetaylor

I can't debug plugin on mac even in Go 1.13.
@aarzilli said debugging section is missing in plugin. go-delve/delve#1628

Is there any progress?

@ianlancetaylor
Copy link
Contributor

@juhwany As far as I know nobody is working on this. Sorry.

@juhwany
Copy link

juhwany commented Nov 4, 2019

It's really hard to code plugin without supporting debugging. Hope next Go release will fix this.

@ianlancetaylor
Copy link
Contributor

It remains true that as far as I know nobody is working on this. This issue is marked "help wanted" and I hope that someone can help here.

@thanm
Copy link
Contributor

thanm commented Nov 8, 2019

I am working on a related bug 21647 and at this point I think I am getting close to getting this fixed. The patch I created to address the problems is: 1829590

If anyone wants to try testing it, that might be helpful. Thanks, Than

@gopherbot
Copy link

Change https://golang.org/cl/182959 mentions this issue: cmd/go: remove -w workaround for -buildmode=plugin on Darwin

@aarzilli
Copy link
Contributor

aarzilli commented Nov 8, 2019

The other impediment to debugging plugins on macOS is #25841, I don't know if it has been fixed in the meantime (I suspect it hasn't).

@gopherbot
Copy link

Change https://golang.org/cl/206198 mentions this issue: cmd/go: remove -w workaround for -buildmode=plugin on Darwin

gopherbot pushed a commit that referenced this issue Nov 11, 2019
Assorted fixups in the linker needed to enable turning back on
DWARF generation when building plugins for Darwin. Includes:

 - don't suppress import of runtime/cgo in the linker for
   Darwin if we are linking in plugin mode

 - in calcCompUnitRanges handle the case where we encounter
   linker-generated functions that have no associated Unit (and
   also have no DWARF)

 - generalize a guard in relocsym() include so as to avoid
   triggering a spurious error on go.info symbols in plugin mode

Updates #21647.
Updates #27502.

Change-Id: I317fea97bef2f3461e31498e63f9fd6d8b8f4b23
Reviewed-on: https://go-review.googlesource.com/c/go/+/182959
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
@golang golang locked and limited conversation to collaborators Nov 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

8 participants