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

Possible Compiler Bug #745

Closed
jgennis opened this issue Apr 25, 2010 · 3 comments
Closed

Possible Compiler Bug #745

jgennis opened this issue Apr 25, 2010 · 3 comments

Comments

@jgennis
Copy link

jgennis commented Apr 25, 2010

What steps will reproduce the problem?
1. Compile the attached bug.go file into an executable
2. Run the compiled executable
3. Watch it segfault


What is the expected output? What do you see instead?
The attached program should print:
func blah(x interface{}) (interface{}) {
}


What is your $GOOS?  $GOARCH?
$ echo $GOOS $GOARCH
linux amd64


Which revision are you using?  (hg identify)
$ hg identify
e7d0863b48db+ tip


Please provide any additional information below.
In the attached bug.go there are three pieces of code that are commented 
out.  Uncommenting any one of them (and removing the code just below the 
comment) makes the code execute correctly.  As far as I can see the 
commented code should do pretty much the same thing as the code causing the 
segfault.

Attachments:

  1. bug.go (1833 bytes)
@gopherbot
Copy link

Comment 1 by jgennis:

I forgot to include this in the original report, but the output I get from the
segfaulting case is:
panic: runtime error: SIGSEGV: segmentation violation
panic PC=0x7ffc76cb3028
runtime.panic+0x7c /home/jgennis/go/src/pkg/runtime/proc.c:1012
    runtime.panic(0x7ffc00000000, 0x406768)
panicstring+0x60 /home/jgennis/go/src/pkg/runtime/runtime.c:83
    panicstring(0x469500, 0x7ffc76d181f0)
sigpanic+0x48 /home/jgennis/go/src/pkg/runtime/linux/thread.c:296
    sigpanic()
go/printer.*printer·identList+0x94 /home/jgennis/go/src/pkg/go/printer/nodes.go:103
    go/printer.*printer·identList(0x464be0, 0x452620, 0x0, 0x7ffc76cef930, 0x0, ...)
go/printer.*printer·parameters+0x29f /home/jgennis/go/src/pkg/go/printer/nodes.go:309
    go/printer.*printer·parameters(0x7ffc76d12000, 0x7ffc76cf0420, 0x41f191, 0x0, 0x7ffc76ca32d8, ...)
go/printer.*printer·signature+0x155 /home/jgennis/go/src/pkg/go/printer/nodes.go:330
    go/printer.*printer·signature(0x7ffc76d12000, 0x7ffc76d170f0, 0x7ffc76ca32d8, 0x7ffc00000020, 0x41f19176cef090, ...)
go/printer.*printer·funcDecl+0x2a0 /home/jgennis/go/src/pkg/go/printer/nodes.go:1380
    go/printer.*printer·funcDecl(0x7ffc76d12000, 0x7ffc76d17000, 0x7ffc76d170f0, 0x7ffc76ca32d8, 0x7ffc76cef090, ...)
go/printer.*printer·decl+0xad /home/jgennis/go/src/pkg/go/printer/nodes.go:1393
    go/printer.*printer·decl(0x7ffc76d12000, 0x7ffc76cf0510, 0x7ffc76ca32d8, 0x7ffc76cf0510, 0x1, ...)
go/printer._func_001+0x25f /home/jgennis/go/src/pkg/go/printer/printer.go:1017
    go/printer._func_001(0x7ffc76d12000, 0x7ffc76cef810, 0x7ffc76cf0510, 0x7ffc00000000)
goexit /home/jgennis/go/src/pkg/runtime/proc.c:145
    goexit()
goroutine 1 [4]:
gosched+0x4e /home/jgennis/go/src/pkg/runtime/proc.c:542
    gosched()
chanrecv+0x3e6 /home/jgennis/go/src/pkg/runtime/chan.c:327
    chanrecv(0x7ffc76ca9bf0, 0x7ffc76cef570, 0x0, 0x7ffc76caef60, 0x43fc4e, ...)
runtime.chanrecv1+0x41 /home/jgennis/go/src/pkg/runtime/chan.c:429
    runtime.chanrecv1(0x7ffc76ca9ba0, 0x7ffc76caef80)
go/printer.*Config·Fprint+0x1e2 /home/jgennis/go/src/pkg/go/printer/printer.go:1032
    go/printer.*Config·Fprint(0x7ffc76ca9ba0, 0x41f1ab, 0x7ffc76d18000, 0x7ffc76d12000, 0x7ffc76cab680, ...)
go/printer.Fprint+0x57 /home/jgennis/go/src/pkg/go/printer/printer.go:1047
    go/printer.Fprint(0x7ffc76d053e0, 0x7ffc76cef4e0, 0x7ffc76d07000, 0x471cf8, 0x7ffc76cf0510, ...)
main.main+0x84 /home/jgennis/src/gobug/bug.go:95
    main.main()
mainstart+0xf /home/jgennis/go/src/pkg/runtime/amd64/asm.s:60
    mainstart()
goexit /home/jgennis/go/src/pkg/runtime/proc.c:145
    goexit()

@rsc
Copy link
Contributor

rsc commented Apr 28, 2010

Comment 2:

Labels changed: added priority-high, compilerbug, removed priority-medium.

Owner changed to r...@golang.org.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Apr 29, 2010

Comment 3:

This issue was closed by revision 10eb76b.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
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