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

current tip segfaults godoc somewhere in parser #567

Closed
petar opened this issue Jan 26, 2010 · 5 comments
Closed

current tip segfaults godoc somewhere in parser #567

petar opened this issue Jan 26, 2010 · 5 comments

Comments

@petar
Copy link
Contributor

petar commented Jan 26, 2010

Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull -u" and retry what you did to
reproduce the problem.  Thanks.

What steps will reproduce the problem?
run godoc -http=:6060
browse to packages and click on, say, "netchan"

What is the expected output? What do you see instead?

godoc segfaults


What is your $GOOS?  $GOARCH?
darwin,amd64

Which revision are you using?  (hg identify)
2d8f69ef707f+ tip

Please provide any additional information below.
@rsc
Copy link
Contributor

rsc commented Jan 26, 2010

Comment 1:

i don't get the godoc crash, but i see
gofmt seg faulting on the example below,
in the new scoping code.
i don't know whether the two crashes are related.
package p
func f(func() func() int)

Owner changed to g...@golang.org.

Status changed to Accepted.

@petar
Copy link
Contributor Author

petar commented Jan 26, 2010

Comment 2:

I think they are b/c the footprint of the stacktrace looks the same.
Here's my stacktrace (happens when I click on "netchan" on the site):
 [10:39am] ~/go/src % godoc -http=:6060
2010/01/26 10:39:25 parser.parseDir: found 0 packages
SIGSEGV: segmentation violation
Faulting address: 0x20
pc: 0x20f34
go/parser.*parser·declIdent+0x13 
/Users/petar/go/src/pkg/go/parser/parser.go:325
       go/parser.*parser·declIdent(0x1b13c30, 0x0, 0x3d9b530, 0x0, 0x0, ...)
go/parser.*parser·declIdentList+0x6a
/Users/petar/go/src/pkg/go/parser/parser.go:334
       go/parser.*parser·declIdentList(0x1b13c30, 0x0, 0x3d9b530, 0x0, 0x3d9b5a0, 
...)
go/parser.*parser·declFieldList+0x72
/Users/petar/go/src/pkg/go/parser/parser.go:341
       go/parser.*parser·declFieldList(0x1b13c30, 0x0, 0x3d9b530, 0x0, 0x384c290, 
...)
go/parser.*parser·parseParameters+0xc3
/Users/petar/go/src/pkg/go/parser/parser.go:664
       go/parser.*parser·parseParameters(0x1b13c30, 0x0, 0x3d9b530, 0x0,
0x3074001, ...)
go/parser.*parser·parseSignature+0x81
/Users/petar/go/src/pkg/go/parser/parser.go:697
       go/parser.*parser·parseSignature(0x1b13c30, 0x0, 0x3d9b530, 0x0, 0x0, ...)
go/parser.*parser·parseFunctionDecl+0x148
/Users/petar/go/src/pkg/go/parser/parser.go:1962
       go/parser.*parser·parseFunctionDecl(0x1b13c30, 0x0, 0x10feb0, 0x0)
go/parser.*parser·parseDecl+0xd4
/Users/petar/go/src/pkg/go/parser/parser.go:1991
       go/parser.*parser·parseDecl(0x1b13c30, 0x0, 0x10feb0, 0x0)
go/parser.*parser·parseFile+0x1d5
/Users/petar/go/src/pkg/go/parser/parser.go:2055
       go/parser.*parser·parseFile(0x1b13c30, 0x0, 0x3d9b290, 0x0)
go/parser.ParseFile+0x107 /Users/petar/go/src/pkg/go/parser/interface.go:144
       go/parser.ParseFile(0x3d9b290, 0x0, 0xd, 0x0, 0x0, ...)
main.*Indexer·VisitFile+0x61 /Users/petar/go/src/cmd/godoc/index.go:603
       main.*Indexer·VisitFile(0x36b700, 0x0, 0x3d9b290, 0x0, 0xd, ...)
path.walk+0x5f /Users/petar/go/src/pkg/path/path.go:150
       path.walk(0x3d9b290, 0x0, 0xd, 0x0, 0x3557590, ...)
path.walk+0x1ab /Users/petar/go/src/pkg/path/path.go:166
       path.walk(0x1b846f8, 0x0, 0x4, 0x0, 0x3bd690, ...)
path.walk+0x1ab /Users/petar/go/src/pkg/path/path.go:166
       path.walk(0x8c470, 0x0, 0x1, 0x0, 0x3af000, ...)
path.Walk+0x91 /Users/petar/go/src/pkg/path/path.go:185
       path.Walk(0x8c470, 0x0, 0x1, 0x0, 0x3c6c00, ...)
main.NewIndex+0xa1 /Users/petar/go/src/cmd/godoc/index.go:643
       main.NewIndex(0x8c470, 0x0, 0x1, 0x0, 0x0, ...)
main.indexer+0x70 /Users/petar/go/src/cmd/godoc/godoc.go:1213
       main.indexer()
goexit /Users/petar/go/src/pkg/runtime/proc.c:140
       goexit()
goroutine 8817 [4]:
gosched+0x4e /Users/petar/go/src/pkg/runtime/proc.c:530
       gosched()
chanrecv+0x176 /Users/petar/go/src/pkg/runtime/chan.c:353
       chanrecv(0x180d840, 0x0, 0x372e38, 0x0, 0x0, ...)
runtime.chanrecv1+0x50 /Users/petar/go/src/pkg/runtime/chan.c:423
       runtime.chanrecv1(0x180d840, 0x0)
net.*pollServer·WaitRead+0x49 /Users/petar/go/src/pkg/net/fd.go:276
       net.*pollServer·WaitRead(0x159e400, 0x0, 0x150ec80, 0x0)
net.*netFD·Read+0x137 /Users/petar/go/src/pkg/net/fd.go:384
       net.*netFD·Read(0x150ec80, 0x0, 0x8d5000, 0x0, 0x1000, ...)
net.*TCPConn·Read+0x74 /Users/petar/go/src/pkg/net/tcpsock.go:92
       net.*TCPConn·Read(0x4f232f8, 0x0, 0x8d5000, 0x0, 0x1000, ...)
bufio.*Reader·fill+0x164 /Users/petar/go/src/pkg/bufio/bufio.go:95
       bufio.*Reader·fill(0x5120040, 0x0)
bufio.*Reader·ReadSlice+0x1f1 /Users/petar/go/src/pkg/bufio/bufio.go:221
       bufio.*Reader·ReadSlice(0x5120040, 0x0, 0xa, 0x0, 0x0, ...)
http.readLineBytes+0x39 /Users/petar/go/src/pkg/http/request.go:217
       http.readLineBytes(0x5120040, 0x0, 0x0, 0x0, 0x0, ...)
http.readLine+0x34 /Users/petar/go/src/pkg/http/request.go:241
       http.readLine(0x5120040, 0x0, 0x0, 0x0, 0x0, ...)
http.ReadRequest+0x64 /Users/petar/go/src/pkg/http/request.go:459
       http.ReadRequest(0x5120040, 0x0, 0x508fbe0, 0x0, 0x0, ...)
http.*Conn·readRequest+0x58 /Users/petar/go/src/pkg/http/server.go:77
       http.*Conn·readRequest(0x5106060, 0x0, 0x5106060, 0x0, 0x0, ...)
http.*Conn·serve+0x1c /Users/petar/go/src/pkg/http/server.go:277
       http.*Conn·serve(0x5106060, 0x0)
goexit /Users/petar/go/src/pkg/runtime/proc.c:140
       goexit()
0x5106060 unknown pc
goroutine 8814 [4]:
gosched+0x4e /Users/petar/go/src/pkg/runtime/proc.c:530
       gosched()
chanrecv+0x176 /Users/petar/go/src/pkg/runtime/chan.c:353
       chanrecv(0x4f18ea0, 0x0, 0x11b8c38, 0x0, 0x0, ...)
runtime.chanrecv1+0x50 /Users/petar/go/src/pkg/runtime/chan.c:423
       runtime.chanrecv1(0x4f18ea0, 0x0)
net.*pollServer·WaitRead+0x49 /Users/petar/go/src/pkg/net/fd.go:276
       net.*pollServer·WaitRead(0x159e400, 0x0, 0x4e0d820, 0x0)
net.*netFD·Read+0x137 /Users/petar/go/src/pkg/net/fd.go:384
       net.*netFD·Read(0x4e0d820, 0x0, 0x4821000, 0x0, 0x1000, ...)
net.*TCPConn·Read+0x74 /Users/petar/go/src/pkg/net/tcpsock.go:92
       net.*TCPConn·Read(0x51107e8, 0x0, 0x4821000, 0x0, 0x1000, ...)
bufio.*Reader·fill+0x164 /Users/petar/go/src/pkg/bufio/bufio.go:95
       bufio.*Reader·fill(0x4f1e3c0, 0x0)
bufio.*Reader·ReadSlice+0x1f1 /Users/petar/go/src/pkg/bufio/bufio.go:221
       bufio.*Reader·ReadSlice(0x4f1e3c0, 0x0, 0xa, 0x0, 0x0, ...)
http.readLineBytes+0x39 /Users/petar/go/src/pkg/http/request.go:217
       http.readLineBytes(0x4f1e3c0, 0x0, 0x0, 0x0, 0x0, ...)
http.readLine+0x34 /Users/petar/go/src/pkg/http/request.go:241
       http.readLine(0x4f1e3c0, 0x0, 0x0, 0x0, 0x0, ...)
http.ReadRequest+0x64 /Users/petar/go/src/pkg/http/request.go:459
       http.ReadRequest(0x4f1e3c0, 0x0, 0x51d5aa0, 0x0, 0x0, ...)
http.*Conn·readRequest+0x58 /Users/petar/go/src/pkg/http/server.go:77
       http.*Conn·readRequest(0x5106d20, 0x0, 0x5106d20, 0x0, 0x0, ...)
http.*Conn·serve+0x1c /Users/petar/go/src/pkg/http/server.go:277
       http.*Conn·serve(0x5106d20, 0x0)
goexit /Users/petar/go/src/pkg/runtime/proc.c:140
       goexit()
0x5106d20 unknown pc
goroutine 1556 [3]:
runtime.entersyscall+0x50 /Users/petar/go/src/pkg/runtime/proc.c:551
       runtime.entersyscall()
syscall.Syscall6+0x5 /Users/petar/go/src/pkg/syscall/asm_darwin_amd64.s:39
       syscall.Syscall6()
syscall.kevent+0x6d 
/Users/petar/go/src/pkg/syscall/zsyscall_darwin_amd64.go:108
       syscall.kevent(0x7, 0x0, 0x0, 0x0, 0x0, ...)
syscall.Kevent+0x99 /Users/petar/go/src/pkg/syscall/syscall_darwin.go:378
       syscall.Kevent(0x7, 0x0, 0x0, 0x0, 0x0, ...)
net.*pollster·WaitFD+0xf5 /Users/petar/go/src/pkg/net/fd_darwin.go:87
       net.*pollster·WaitFD(0x17bf160, 0x0, 0x0, 0x0, 0x0, ...)
net.*pollServer·Run+0x9e /Users/petar/go/src/pkg/net/fd.go:236
       net.*pollServer·Run(0x159e400, 0x0)
goexit /Users/petar/go/src/pkg/runtime/proc.c:140
       goexit()
0x159e400 unknown pc
goroutine 8631 [4]:
gosched+0x4e /Users/petar/go/src/pkg/runtime/proc.c:530
       gosched()
chanrecv+0x176 /Users/petar/go/src/pkg/runtime/chan.c:353
       chanrecv(0x180d600, 0x0, 0x370c38, 0x0, 0x0, ...)
runtime.chanrecv1+0x50 /Users/petar/go/src/pkg/runtime/chan.c:423
       runtime.chanrecv1(0x180d600, 0x0)
net.*pollServer·WaitRead+0x49 /Users/petar/go/src/pkg/net/fd.go:276
       net.*pollServer·WaitRead(0x159e400, 0x0, 0x150ea00, 0x0)
net.*netFD·Read+0x137 /Users/petar/go/src/pkg/net/fd.go:384
       net.*netFD·Read(0x150ea00, 0x0, 0x792000, 0x0, 0x1000, ...)
net.*TCPConn·Read+0x74 /Users/petar/go/src/pkg/net/tcpsock.go:92
       net.*TCPConn·Read(0x4f23050, 0x0, 0x792000, 0x0, 0x1000, ...)
bufio.*Reader·fill+0x164 /Users/petar/go/src/pkg/bufio/bufio.go:95
       bufio.*Reader·fill(0x4f1ea00, 0x0)
bufio.*Reader·ReadSlice+0x1f1 /Users/petar/go/src/pkg/bufio/bufio.go:221
       bufio.*Reader·ReadSlice(0x4f1ea00, 0x0, 0xa, 0x0, 0x0, ...)
http.readLineBytes+0x39 /Users/petar/go/src/pkg/http/request.go:217
       http.readLineBytes(0x4f1ea00, 0x0, 0x0, 0x0, 0x0, ...)
http.readLine+0x34 /Users/petar/go/src/pkg/http/request.go:241
       http.readLine(0x4f1ea00, 0x0, 0x0, 0x0, 0x0, ...)
http.ReadRequest+0x64 /Users/petar/go/src/pkg/http/request.go:459
       http.ReadRequest(0x4f1ea00, 0x0, 0x5016aa0, 0x0, 0x0, ...)
http.*Conn·readRequest+0x58 /Users/petar/go/src/pkg/http/server.go:77
       http.*Conn·readRequest(0x1068180, 0x0, 0x1068180, 0x0, 0x0, ...)
http.*Conn·serve+0x1c /Users/petar/go/src/pkg/http/server.go:277
       http.*Conn·serve(0x1068180, 0x0)
goexit /Users/petar/go/src/pkg/runtime/proc.c:140
       goexit()
0x1068180 unknown pc
goroutine 1 [4]:
gosched+0x4e /Users/petar/go/src/pkg/runtime/proc.c:530
       gosched()
chanrecv+0x176 /Users/petar/go/src/pkg/runtime/chan.c:353
       chanrecv(0x180dc00, 0x0, 0x36fc58, 0x0, 0x0, ...)
runtime.chanrecv1+0x50 /Users/petar/go/src/pkg/runtime/chan.c:423
       runtime.chanrecv1(0x180dc00, 0x0)
net.*pollServer·WaitRead+0x49 /Users/petar/go/src/pkg/net/fd.go:276
       net.*pollServer·WaitRead(0x159e400, 0x0, 0x1821460, 0x0)
net.*netFD·accept+0x2e2 /Users/petar/go/src/pkg/net/fd.go:512
       net.*netFD·accept(0x1821460, 0x0, 0x8277a, 0x0, 0x6a1cb, ...)
net.*TCPListener·AcceptTCP+0x5a /Users/petar/go/src/pkg/net/tcpsock.go:253
       net.*TCPListener·AcceptTCP(0x1864a80, 0x0, 0x4f5d630, 0x0, 0x0, ...)
net.*TCPListener·Accept+0x34 /Users/petar/go/src/pkg/net/tcpsock.go:263
       net.*TCPListener·Accept(0x1864a80, 0x0, 0x0, 0x0, 0x0, ...)
http.Serve+0x66 /Users/petar/go/src/pkg/http/server.go:532
       http.Serve(0x159ea40, 0x0, 0x1864a80, 0x0, 0x3c6a20, ...)
http.ListenAndServe+0x8e /Users/petar/go/src/pkg/http/server.go:576
       http.ListenAndServe(0x369006, 0x0, 0x5, 0x0, 0x3c6a20, ...)
main.main+0x606 /Users/petar/go/src/cmd/godoc/main.go:212
       main.main()
mainstart+0xf /Users/petar/go/src/pkg/runtime/amd64/asm.s:54
       mainstart()
goexit /Users/petar/go/src/pkg/runtime/proc.c:140
       goexit()
rax     0x0
rbx     0x0
rcx     0x3d9b5a0
rdx     0x371978
rdi     0x371a18
rsi     0x371a40
rbp     0x0
rsp     0x371970
r8      0x384c290
r9      0x3718c8
r10     0x52
r11     0x940d8
r12     0x20e
r13     0x0
r14     0x3a6000
r15     0x36e6c0
rip     0x20f34
rflags  0x10202
cs      0x27
fs      0x10
gs      0x48

@griesemer
Copy link
Contributor

Comment 3:

Status changed to Started.

@griesemer
Copy link
Contributor

Comment 4:

I can reproduce both bugs (it took some time for godoc to crash). Both crashes are 
probably related. The bug is not due to the new scoping code, in fact the bug has been 
around for a long time. The new scoping code simply exposed the issue. Fix pending 
review.

@griesemer
Copy link
Contributor

Comment 5:

This issue was closed by revision 70b92dd.

Status changed to Fixed.

Merged into issue #-.

@petar petar added the fixed label Jan 26, 2010
@golang golang locked and limited conversation to collaborators Jun 24, 2016
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

4 participants