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/go: -buildmode=plugin crashes if package imports "plugin" package #17624

Closed
rakyll opened this issue Oct 26, 2016 · 1 comment
Closed

cmd/go: -buildmode=plugin crashes if package imports "plugin" package #17624

rakyll opened this issue Oct 26, 2016 · 1 comment
Milestone

Comments

@rakyll
Copy link
Contributor

rakyll commented Oct 26, 2016

$ cat main.go

package main

import (
    "log"
    "plugin"
)

func main() {
    p, err := plugin.Open("main.so")
    if err != nil {
        log.Fatal(err)
    }
    s, err := p.Lookup("main.main")
    if err != nil {
        log.Fatal(err)
    }
    log.Println(s)
}

$ go build -buildmode=plugin
# hello/plugin
panic: found import cycle while visiting plugin

goroutine 1 [running]:
panic(0x19c4a0, 0xc4214f8950)
    /Users/jbd/go/src/runtime/panic.go:531 +0x1a0
cmd/link/internal/ld.dfs(0xc4204d6000, 0xc42003da78, 0xc42003da60)
    /Users/jbd/go/src/cmd/link/internal/ld/lib.go:2124 +0x2ef
cmd/link/internal/ld.dfs(0xc4204d6000, 0xc42003da78, 0xc42003da60)
    /Users/jbd/go/src/cmd/link/internal/ld/lib.go:2128 +0x129
cmd/link/internal/ld.postorder(0xc420075b00, 0x13, 0x20, 0x0, 0xc421435c30, 0xc4204c8038)
    /Users/jbd/go/src/cmd/link/internal/ld/lib.go:2114 +0x137
cmd/link/internal/ld.(*Link).loadlib(0xc4204be000)
    /Users/jbd/go/src/cmd/link/internal/ld/lib.go:619 +0xc01
cmd/link/internal/ld.Main()
    /Users/jbd/go/src/cmd/link/internal/ld/main.go:183 +0x7f0
main.main()
    /Users/jbd/go/src/cmd/link/main.go:55 +0x139
@rakyll rakyll added this to the Go1.8 milestone Oct 26, 2016
@crawshaw
Copy link
Member

crawshaw commented Nov 3, 2016

Fixed by 9da7058.

@crawshaw crawshaw closed this as completed Nov 3, 2016
@golang golang locked and limited conversation to collaborators Nov 3, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants