Skip to content

godoc segfaults #747

@petar

Description

@petar
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?

I run godoc using the following command line:

godoc -path=/Users/petar/tonika-git/src/pkg -http=:6060

When I navigate to the menu item "Source files" I get a
segfault. This does not happen if I use:

godoc -http=:6060

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

panic: interface conversion: interface is int64, not uint64 [recovered]
    panic: interface conversion: interface is int64, not uint64

panic PC=0x39bab8
runtime.panic+0x7c /Users/petar/go/src/pkg/runtime/proc.c:1012
    runtime.panic(0x0, 0x39bb00)
template.checkError+0xa2 /Users/petar/go/src/pkg/template/template.go:891
    template.checkError(0x13d320, 0xa63690)
runtime.panic+0xb2 /Users/petar/go/src/pkg/runtime/proc.c:994
    runtime.panic(0x70166, 0x8dca78)
runtime.ifaceE2T+0xf5 /Users/petar/go/src/pkg/runtime/iface.c:282
    runtime.ifaceE2T(0x13d320, 0xa63690, 0x1009b8, 0x0)
main.timeFmt+0x29 /Users/petar/go/src/cmd/godoc/godoc.go:786
    main.timeFmt(0x1009b8, 0x128b50, 0x11853b24269d5a00, 0x39bc88, 0x39bc78, ...)
template.*Template·writeVariable+0xff /Users/petar/go/src/pkg/template/template.go:717
    template.*Template·writeVariable(0x93bbd0, 0x3aa900, 0x128b50, 0x11853b24269d5a00, 
0x448129, ...)
template.*Template·executeElement+0xd5 /Users/petar/go/src/pkg/template/template.go:739
    template.*Template·executeElement(0x43f9b0, 0x414450, 0x8dcab0, 0x414450, 0x1, ...)
template._func_002+0xaa /Users/petar/go/src/pkg/template/template.go:832
    template._func_002(0x43f9b0, 0x100000021, 0x8dcab0, 0x21, 0x11536, ...)
template.*Template·executeRepeated+0x39f
/Users/petar/go/src/pkg/template/template.go:838
    template.*Template·executeRepeated(0x8dcab0, 0x9c42a0, 0xa382c0, 0x8dcab0, 0xa38e00, ...)
template.*Template·executeElement+0x330 /Users/petar/go/src/pkg/template/template.go:745
    template.*Template·executeElement(0x43f9b0, 0x4152a0, 0x8dca80, 0x4152a0, 0x1, ...)
template.*Template·execute+0x36 /Users/petar/go/src/pkg/template/template.go:756
    template.*Template·execute(0x43f9b0, 0x12, 0x8dca80, 0x12, 0x8, ...)
template.*Template·Execute+0xeb /Users/petar/go/src/pkg/template/template.go:923
    template.*Template·Execute(0x43f9b0, 0x2600000000, 0x8dca80, 0xa38e00, 0x91e6d0, ...)
main.applyTemplate+0x71 /Users/petar/go/src/cmd/godoc/godoc.go:970
    main.applyTemplate(0x43f9b0, 0x108af0, 0x91e6c0, 0x93bbd0, 0x3aa900, ...)
main.serveDirectory+0x241 /Users/petar/go/src/cmd/godoc/godoc.go:1091
    main.serveDirectory(0x43f9b0, 0xc8a30, 0xb, 0x108af0, 0x91e6c0, ...)
main.serveFile+0x5aa /Users/petar/go/src/cmd/godoc/godoc.go:1143
    main.serveFile(0xdb86c0, 0x430a480, 0x92c660, 0x300000013)
http.HandlerFunc·ServeHTTP+0x28 /Users/petar/go/src/pkg/http/server.go:326
    http.HandlerFunc·ServeHTTP(0xdb86c0, 0x430a480, 0x59658, 0x6b4a, 0xdb86c0, ...)
http.*ServeMux·ServeHTTP+0x1fd /Users/petar/go/src/pkg/http/server.go:508
    http.*ServeMux·ServeHTTP(0x6b4a, 0xdb86c0, 0x430a480, 0x5, 0x6b01, ...)
http.*Conn·serve+0x7d /Users/petar/go/src/pkg/http/server.go:289
    http.*Conn·serve(0x38e300, 0xdb86c0)
goexit /Users/petar/go/src/pkg/runtime/proc.c:145
    goexit()

goroutine 90812 [4]:
gosched+0x4e /Users/petar/go/src/pkg/runtime/proc.c:542
    gosched()
chanrecv+0x164 /Users/petar/go/src/pkg/runtime/chan.c:355
    chanrecv(0xdb86b0, 0xa06e00, 0xab2e8, 0x100000001, 0x1, ...)
runtime.chanrecv1+0x41 /Users/petar/go/src/pkg/runtime/chan.c:429
    runtime.chanrecv1(0xdb8660, 0xd30ca8)
net.*pollServer·WaitRead+0x49 /Users/petar/go/src/pkg/net/fd.go:272
    net.*pollServer·WaitRead(0xdb8660, 0x150ec80, 0x93091, 0x480400)
net.*netFD·Read+0x14d /Users/petar/go/src/pkg/net/fd.go:380
    net.*netFD·Read(0x480400, 0x150ec80, 0x100000001001, 0x0, 0x473a20, ...)
net.*TCPConn·Read+0x74 /Users/petar/go/src/pkg/net/tcpsock.go:92
    net.*TCPConn·Read(0x150ec80, 0x14e4000, 0x100000001000, 0x0, 0x473a20, ...)
bufio.*Reader·fill+0x155 /Users/petar/go/src/pkg/bufio/bufio.go:95
    bufio.*Reader·fill(0x38ea48, 0x14e4000)
bufio.*Reader·ReadSlice+0x1d5 /Users/petar/go/src/pkg/bufio/bufio.go:221
    bufio.*Reader·ReadSlice(0x47a8c0, 0xe6e00000000, 0x1d80a, 0xffffffff, 0x3b87, ...)
http.readLineBytes+0x39 /Users/petar/go/src/pkg/http/request.go:225
    http.readLineBytes(0x47a8c0, 0x1450a, 0x0, 0x0, 0x0, ...)
http.readLine+0x34 /Users/petar/go/src/pkg/http/request.go:249
    http.readLine(0x47a8c0, 0x0, 0x0, 0x0, 0x0, ...)
http.ReadRequest+0x61 /Users/petar/go/src/pkg/http/request.go:467
    http.ReadRequest(0x47a8c0, 0x0, 0x0, 0x0, 0x0, ...)
http.*Conn·readRequest+0x58 /Users/petar/go/src/pkg/http/server.go:82
    http.*Conn·readRequest(0x47a8c0, 0x3b87300, 0x0, 0x0, 0x0, ...)
http.*Conn·serve+0x1c /Users/petar/go/src/pkg/http/server.go:282
    http.*Conn·serve(0xdb8cc0, 0xdb8cc0)
goexit /Users/petar/go/src/pkg/runtime/proc.c:145
    goexit()

goroutine 111 [4]:
gosched+0x4e /Users/petar/go/src/pkg/runtime/proc.c:542
    gosched()
runfinq+0x3f /Users/petar/go/src/pkg/runtime/mgc0.c:368
    runfinq()
goexit /Users/petar/go/src/pkg/runtime/proc.c:145
    goexit()

goroutine 4 [3]:
runtime.entersyscall+0x50 /Users/petar/go/src/pkg/runtime/proc.c:563
    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(0x16b, 0x8, 0x0, 0x0, 0x8ec008, ...)
syscall.Kevent+0x99 /Users/petar/go/src/pkg/syscall/syscall_bsd.go:375
    syscall.Kevent(0x8, 0x0, 0x0, 0x8ec008, 0xa, ...)
net.*pollster·WaitFD+0xfb /Users/petar/go/src/pkg/net/fd_darwin.go:87
    net.*pollster·WaitFD(0x8, 0x0, 0x0, 0x8ec008, 0xa0000000a, ...)
net.*pollServer·Run+0x9e /Users/petar/go/src/pkg/net/fd.go:232
    net.*pollServer·Run(0x8ec000, 0x0)
goexit /Users/petar/go/src/pkg/runtime/proc.c:145
    goexit()

goroutine 3 [3]:
runtime.entersyscall+0x50 /Users/petar/go/src/pkg/runtime/proc.c:563
    runtime.entersyscall()
syscall.Syscall6+0x5 /Users/petar/go/src/pkg/syscall/asm_darwin_amd64.s:39
    syscall.Syscall6()
syscall.Select+0x5d /Users/petar/go/src/pkg/syscall/zsyscall_darwin_amd64.go:512
    syscall.Select(0x5d, 0x0, 0x0, 0x0, 0x0, ...)
syscall.Sleep+0x71 /Users/petar/go/src/pkg/syscall/syscall_bsd.go:145
    syscall.Sleep(0xd00000000, 0x0, 0x0, 0x0)
time.Sleep+0x3b /Users/petar/go/src/pkg/time/sleep.go:19
    time.Sleep(0xdf8475800, 0x5f2c8, 0x3945c0, 0x2)
main.indexer+0x410 /Users/petar/go/src/cmd/godoc/godoc.go:1414
    main.indexer()
goexit /Users/petar/go/src/pkg/runtime/proc.c:145
    goexit()

goroutine 1 [4]:
gosched+0x4e /Users/petar/go/src/pkg/runtime/proc.c:542
    gosched()
chanrecv+0x164 /Users/petar/go/src/pkg/runtime/chan.c:355
    chanrecv(0x911050, 0x48d660, 0xab2e8, 0x100000001, 0x1, ...)
runtime.chanrecv1+0x41 /Users/petar/go/src/pkg/runtime/chan.c:429
    runtime.chanrecv1(0x911000, 0x397b50)
net.*pollServer·WaitRead+0x49 /Users/petar/go/src/pkg/net/fd.go:272
    net.*pollServer·WaitRead(0x911000, 0x8f60a0, 0x93b0e, 0x480400)
net.*netFD·accept+0x2f2 /Users/petar/go/src/pkg/net/fd.go:508
    net.*netFD·accept(0x480400, 0x8f60a0, 0x0, 0x0, 0x23, ...)
net.*TCPListener·AcceptTCP+0x5a /Users/petar/go/src/pkg/net/tcpsock.go:253
    net.*TCPListener·AcceptTCP(0x8f60a0, 0x990de, 0x0, 0x0, 0x0, ...)
net.*TCPListener·Accept+0x34 /Users/petar/go/src/pkg/net/tcpsock.go:263
    net.*TCPListener·Accept(0x47b788, 0x132cb, 0x0, 0x0, 0x8, ...)
http.Serve+0x66 /Users/petar/go/src/pkg/http/server.go:551
    http.Serve(0x47b788, 0x0, 0x0, 0x0, 0x0, ...)
http.ListenAndServe+0x8e /Users/petar/go/src/pkg/http/server.go:596
    http.ListenAndServe(0x480880, 0x47b788, 0x473810, 0x38e300, 0x480880, ...)
main.main+0x6f7 /Users/petar/go/src/cmd/godoc/main.go:285
    main.main()
mainstart+0xf /Users/petar/go/src/pkg/runtime/amd64/asm.s:60
    mainstart()
goexit /Users/petar/go/src/pkg/runtime/proc.c:145
    goexit()


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

Which revision are you using?  (hg identify)
9c15ff12bfe3+ tip

Please provide any additional information below.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions