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

cmd/link: missing debug_frame section if package plugin is imported #23733

Closed
aarzilli opened this issue Feb 7, 2018 · 24 comments
Closed

cmd/link: missing debug_frame section if package plugin is imported #23733

aarzilli opened this issue Feb 7, 2018 · 24 comments
Labels
Debugging FrozenDueToAge help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@aarzilli
Copy link
Contributor

aarzilli commented Feb 7, 2018

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version devel +00587e8 Fri Jan 26 23:55:04 2018 +0000 linux/amd64

but this also happens with the latest release candidate for 1.10.

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/a/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/a/n/go/"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build091711191=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Compile anything that imports plugin:

package main

import (
	"plugin"
	"fmt"
)

func main() {
	test := plugin.Plugin{}
	fmt.Println(test)
}

The executable used to have .debug_frame in 1.9 but has eh_frame now.

Was this done intentionally?

(originally reported as https://github.com/derekparker/delve/issues/1118)

@heschi
Copy link
Contributor

heschi commented Feb 7, 2018

.eh_frame is a red herring; I'm fairly certain that the external linker is adding that because .debug_frame is missing and it doesn't know where to put its own stuff. The real issue is that .debug_frame is missing entirely in 1.10.

Bisects to 24e4a12, which I think may have been a little overzealous; we could have kept some of the DWARF. But it's not going to be a good debugging experience regardless.

cc @crawshaw

@aarzilli
Copy link
Contributor Author

aarzilli commented Feb 7, 2018

Got it, thanks for looking into it. I see now that it doesn't really have a debug_info section either.

@gopherbot
Copy link

Change https://golang.org/cl/111237 mentions this issue: cmd/link: move dwarf part of DWARF generation before type name mangling

@gopherbot
Copy link

Change https://golang.org/cl/111236 mentions this issue: cmd/link: move type name mangling after deadcode elimination

@chaplin89
Copy link

Is there any workaround for this?

@OliviaSong
Copy link

I encountered this problem . project really have a plugin package. Which version is good?

@heschi
Copy link
Contributor

heschi commented May 7, 2018

There is no workaround other than to remove the plugin dependency, sorry. The Go 1.11 freeze was a week ago, so the CLs above will have to wait for 1.12.

@chaplin89
Copy link

Thanks

@VmFree
Copy link

VmFree commented May 24, 2018

no fix for this problem? I also encountered such problem under ubuntu 16.4

@tty5
Copy link

tty5 commented Jun 19, 2018

any update for thsi bug?

@heschi
Copy link
Contributor

heschi commented Jun 19, 2018

As I said above, there will be no updates until the 1.12 development cycle opens. That will be in August; see https://github.com/golang/go/wiki/Go-Release-Cycle.

@vladbarosan
Copy link

Please prioritize this as it blocks debugging applications with plugins.

@ianlancetaylor
Copy link
Contributor

@vladbarosan We'll do our best but to be honest we have few resources to improve the plugin development experience. Go is an open source project, and this is an area where external contributions would be very valuable.

Danw33 added a commit to Danw33/go-build that referenced this issue Jul 7, 2018
…port.

(NB: Should be compatible with dlv when run under go 1.9, however due to golang/go#23733 go 1.10 and 1.11 will cause dlv to produce an error)
glerchundi added a commit to glerchundi/hydra that referenced this issue Aug 13, 2018
Debugging Hydra in Go 1.10 and 1.11 (confirmed by one of its members),
is not possible due to [this unresolved
bug](golang/go#23733) which is related to the
use of the plugin functionality.

This change allows passing a build tag which will disable plugin
implementation and therefore allow to debug in all the use-cases where
plugin backend is not needed.

Signed-of-by: Gorka Lerchundi Osa <glertxundi@gmail.com>
glerchundi added a commit to glerchundi/hydra that referenced this issue Aug 13, 2018
Debugging Hydra in Go 1.10 and 1.11 (confirmed by one of its members),
is not possible due to [this unresolved
bug](golang/go#23733) which is related to the
use of the plugin functionality.

This change allows passing a build tag which will disable plugin
implementation and therefore allow to debug in all the use-cases where
plugin backend is not needed.

Signed-off-by: Gorka Lerchundi Osa <glertxundi@gmail.com>
glerchundi added a commit to glerchundi/hydra that referenced this issue Aug 13, 2018
Debugging Hydra in Go 1.10 and 1.11 (confirmed by one of its members),
is not possible due to [this unresolved
bug](golang/go#23733) which is related to the
use of the plugin functionality.

This change allows passing a build tag which will disable plugin
implementation and therefore allow to debug in all the use-cases where
plugin backend is not needed.

Signed-off-by: Gorka Lerchundi Osa <glertxundi@gmail.com>
aeneasr pushed a commit to ory/hydra that referenced this issue Aug 13, 2018
Debugging Hydra in Go 1.10 and 1.11 (confirmed by one of its members),
is not possible due to [this unresolved
bug](golang/go#23733) which is related to the
use of the plugin functionality.

This change allows passing a build tag which will disable plugin
implementation and therefore allow to debug in all the use-cases where
plugin backend is not needed.

Signed-off-by: Gorka Lerchundi Osa <glertxundi@gmail.com>
gopherbot pushed a commit that referenced this issue Aug 28, 2018
Moves type name mangling after deadcode elimination. The motivation for
doing this is to create a space between deadcode elimination and type name
mangling where DWARF generation for types and variables can exist, to fix
issue #23733.

Change-Id: I9db8ecc0f4efe3df6c1e4025f02642fd452f9a39
Reviewed-on: https://go-review.googlesource.com/111236
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@juhwany
Copy link

juhwany commented Sep 6, 2018

@ianlancetaylor
I've encountered same problem. Is this issue solved? then which go version should I use for debugging plugin?

@ianlancetaylor
Copy link
Contributor

@juhwany This issue is reportedly closed on tip. Would you be able to try that out and see?

@juhwany
Copy link

juhwany commented Sep 6, 2018

@ianlancetaylor

OK let me try. But which Go version should I use for testing?

@sh0umik
Copy link

sh0umik commented Sep 10, 2018

Having the same problem after upgrading from golang10.0 to golang11.1

@hongliang5316
Copy link

How about to solve this problem?

@JVerwolf
Copy link

I solved this problem by downgrading my GO version from 1.11 to 1.10.4. I'm on Ubuntu 16.4, and I fixed this problem by I deleting my /usr/local/go directory, downloading 1.10.4, then extracting with tar -C /usr/local -xzf go1.10.4.linux-amd64.tar.gz. IntelliJ debugger worked fine afterwards. Hope this helps.

@heschi
Copy link
Contributor

heschi commented Sep 27, 2018

Nothing about this bug was supposed to change, certainly not get worse, with the upgrade to 1.11. Importing the plugin package should have disabled debugging in both. If you have a program that uses plugins that is debuggable in 1.10 but not in 1.11, please give precise instructions to reproduce the problem here. If the program doesn't use plugin, it's not this issue, and it would help to file a new one, again with a reproducer. Thanks.

@GodloveD
Copy link

Why is this issue closed? Seems like it is still a problem no?

@aarzilli
Copy link
Contributor Author

@GodloveD it should be fixed in 1.12

@wenjun001
Copy link

I just try 1.9 works fine 1.10 and 1.11 has this kind of problem

@heschi
Copy link
Contributor

heschi commented Oct 15, 2018

@wenjun001 Please see my comments in #23733 (comment). Nobody can do anything to help without more detail.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Debugging FrozenDueToAge help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests