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

Comments

@YoshikiShibata
Copy link

@YoshikiShibata YoshikiShibata commented Sep 4, 2018

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
@heschik

This comment has been minimized.

Copy link
Contributor

@heschik heschik 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

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Sep 5, 2018

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 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

This comment has been minimized.

Copy link

@juhwany 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

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Sep 4, 2019

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

@juhwany

This comment has been minimized.

Copy link

@juhwany juhwany commented Nov 4, 2019

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

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Nov 5, 2019

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

This comment has been minimized.

Copy link
Member

@thanm 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

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 8, 2019

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

@aarzilli

This comment has been minimized.

Copy link
Contributor

@aarzilli 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

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 8, 2019

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>
@gopherbot gopherbot closed this in 275a7be Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.