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

Comments

Projects
None yet
@aarzilli
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 derekparker/delve#1118)

@heschik heschik added the Debugging label Feb 7, 2018

@heschik

This comment has been minimized.

Contributor

heschik 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

This comment has been minimized.

Contributor

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

This comment has been minimized.

gopherbot commented May 3, 2018

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

@gopherbot

This comment has been minimized.

gopherbot commented May 3, 2018

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

@chaplin89

This comment has been minimized.

chaplin89 commented May 5, 2018

Is there any workaround for this?

@OliviaSong

This comment has been minimized.

OliviaSong commented May 6, 2018

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

@heschik

This comment has been minimized.

Contributor

heschik 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

This comment has been minimized.

chaplin89 commented May 8, 2018

Thanks

@jufengyao

This comment has been minimized.

jufengyao commented May 24, 2018

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

@tty5

This comment has been minimized.

tty5 commented Jun 19, 2018

any update for thsi bug?

@heschik

This comment has been minimized.

Contributor

heschik 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

This comment has been minimized.

vladbarosan commented Jun 22, 2018

Please prioritize this as it blocks debugging applications with plugins.

@ianlancetaylor

This comment has been minimized.

Contributor

ianlancetaylor commented Jun 23, 2018

@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

Makefile support for creating non-stripped builds with full debug sup…
…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

plugin: disable plugins through tags
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

plugin: disable plugins through tags
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

config: disable plugin backend through 'noplugin' tag
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

config: disable plugin backend through 'noplugin' tag (#986)
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

cmd/link: move type name mangling after deadcode elimination
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>

@gopherbot gopherbot closed this in 9c83383 Sep 4, 2018

@juhwany

This comment has been minimized.

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

This comment has been minimized.

Contributor

ianlancetaylor commented Sep 6, 2018

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

@juhwany

This comment has been minimized.

juhwany commented Sep 6, 2018

@ianlancetaylor

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

@sh0umik

This comment has been minimized.

sh0umik commented Sep 10, 2018

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

@hongliang5316

This comment has been minimized.

hongliang5316 commented Sep 21, 2018

How about to solve this problem?

@JVerwolf

This comment has been minimized.

JVerwolf commented Sep 27, 2018

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.

@heschik

This comment has been minimized.

Contributor

heschik 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

This comment has been minimized.

GodloveD commented Sep 29, 2018

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

@aarzilli

This comment has been minimized.

Contributor

aarzilli commented Sep 29, 2018

@GodloveD it should be fixed in 1.12

@wenjun001

This comment has been minimized.

wenjun001 commented Oct 14, 2018

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

@heschik

This comment has been minimized.

Contributor

heschik 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 join this conversation on GitHub. Already have an account? Sign in to comment