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

Comments

@bradfitz
Copy link
Member

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 this to the Unplanned milestone Aug 2, 2018

@crawshaw

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Member

commented Aug 2, 2018

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

@bradfitz

This comment has been minimized.

Copy link
Member Author

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
Projects
None yet
4 participants
You can’t perform that action at this time.