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

playground: fails to run program importing every package #26774

Open
bradfitz opened this issue Aug 2, 2018 · 5 comments
Open

playground: fails to run program importing every package #26774

bradfitz opened this issue Aug 2, 2018 · 5 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@bradfitz
Copy link
Contributor

bradfitz commented Aug 2, 2018

Here's a program that empty imports every std package:

https://play.golang.org/p/AgKFdQv1pDV

It runs fine locally on linux/amd64 (13MB binary, 344KB heap alloc), but fails to even compile on the playground.

I get:

.dynsym: missing Go type information for global symbol: size 60
go.link.addmoduledata: relocation target runtime.addmoduledata not defined
_cgo_notify_runtime_init_done: relocation target x_cgo_notify_runtime_init_done not defined
_cgo_thread_start: relocation target x_cgo_thread_start not defined
runtime.cgo_yield: relocation target _cgo_yield not defined
.dynsym: relocation target _cgo_topofstack not defined
go.link.addmoduledatainit: phase error: addr=0x74db81 but sym=0x0 type=29

/cc @andybons @ianlancetaylor

@bradfitz bradfitz added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 2, 2018
@bradfitz bradfitz added this to the Unplanned milestone Aug 2, 2018
@crawshaw
Copy link
Member

crawshaw commented Aug 2, 2018

The problem is the runtime/cgo package. This program fails to compile in the playground:

package main

import _ "runtime/cgo"

func main() {
}

https://play.golang.org/p/upwjplNDZos

@dgryski
Copy link
Contributor

dgryski commented Aug 2, 2018

Removing runtime/cgo from the first example still has a build failure on the playground:

go.link.addmoduledata: relocation target runtime.addmoduledata not defined
go.link.addmoduledatainit: phase error: addr=0x74db41 but sym=0x0 type=29

https://play.golang.org/p/QbbmJKqHE1E

@crawshaw
Copy link
Member

crawshaw commented Aug 2, 2018

That's another bug from the plugin package, reproducible with:

package main

import _ "plugin"

func main() {
}

https://play.golang.org/p/jjf4ohv_KJ4

@bcmills
Copy link
Contributor

bcmills commented Aug 2, 2018

Nice sleuthing. With those two notched out it works: https://play.golang.org/p/BbmnOc0m2Vc

@bradfitz
Copy link
Contributor Author

bradfitz commented Aug 2, 2018

Thanks. Let's still keep this open until we either fix or make the error message better.

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

4 participants