Go: playground: fails to run program importing every package

Created on 2 Aug 2018  路  5Comments  路  Source: golang/go

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

NeedsInvestigation

Most helpful comment

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

All 5 comments

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

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

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

package main

import _ "plugin"

func main() {
}

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

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

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

Was this page helpful?
0 / 5 - 0 ratings