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

net/http: panic: runtime error: slice bounds out of range #12339

Closed
sebcat opened this issue Aug 26, 2015 · 17 comments
Closed

net/http: panic: runtime error: slice bounds out of range #12339

sebcat opened this issue Aug 26, 2015 · 17 comments
Milestone

Comments

@sebcat
Copy link

sebcat commented Aug 26, 2015

Hello,

I experience a panic intermittently when using a Transport concurrently against certain URLs. It happens when I read the response body using an io.LimitedReader with ioutil.ReadAll.

I've isolated the problem from a larger application and I would like to share the code for issue reproduction privately, as I am only able to reproduce it for certain URLs and I don't want those URLs in the issue tracker.

I've tested the example with go 1.4.2 and go 1.5 on a couple of different machines. If I run the example locally, I may have to run it a few times before experiencing a panic. If I run the example on a remote machine with different network/hardware/linux distribution that I have access to, it occurs 100% of the time. I don't know why.

Complete stack trace:

panic: runtime error: slice bounds out of range [recovered]
    panic: runtime error: slice bounds out of range

goroutine 8 [running]:
io/ioutil.readAll.func1(0xc820040db0)
    /home/sebastian/go/src/io/ioutil/ioutil.go:30 +0x11e
bufio.(*Reader).ReadSlice(0xc820021c20, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/bufio/bufio.go:306 +0x229
net/http/internal.readLine(0xc820021c20, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/http/internal/chunked.go:110 +0x4b
net/http/internal.(*chunkedReader).beginChunk(0xc82028e210)
    /home/sebastian/go/src/net/http/internal/chunked.go:47 +0x39
net/http/internal.(*chunkedReader).Read(0xc82028e210, 0xc8201f8600, 0x200, 0x200, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/http/internal/chunked.go:77 +0xb7
net/http.(*body).readLocked(0xc8200a9600, 0xc8201f8600, 0x200, 0x200, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transfer.go:632 +0x98
net/http.(*body).Read(0xc8200a9600, 0xc8201f8600, 0x200, 0x200, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transfer.go:624 +0x110
net/http.(*bodyEOFSignal).Read(0xc8200a9640, 0xc8201f8600, 0x200, 0x200, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:1296 +0x26a
io.(*LimitedReader).Read(0xc820221280, 0xc8201f8600, 0x200, 0x200, 0x200, 0x0, 0x0)
    /home/sebastian/go/src/io/io.go:427 +0xbd
bytes.(*Buffer).ReadFrom(0xc820040d08, 0x7f9bbcb26b68, 0xc820221280, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/bytes/buffer.go:173 +0x23f
io/ioutil.readAll(0x7f9bbcb26b68, 0xc820221280, 0x200, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/io/ioutil/ioutil.go:33 +0x154
io/ioutil.ReadAll(0x7f9bbcb26b68, 0xc820221280, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/io/ioutil/ioutil.go:42 +0x51
main.main.func1(0xc820020120, 0xc82001c1b0, 0xc82000ad40)
    /home/sebastian/urls.go:75 +0x4d1
created by main.main
    /home/sebastian/urls.go:83 +0x1ff

goroutine 1 [chan send]:
main.main()
    /home/sebastian/urls.go:87 +0x2c3

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /home/sebastian/go/src/runtime/asm_amd64.s:1696 +0x1

goroutine 5 [select]:
net/http.(*persistConn).roundTrip(0xc820118840, 0xc820335290, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:1164 +0xb0d
net/http.(*Transport).RoundTrip(0xc82001c1b0, 0xc8200ad500, 0x737ef0, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:235 +0x530
main.main.func1(0xc820020120, 0xc82001c1b0, 0xc82000ad40)
    /home/sebastian/urls.go:66 +0x1e2
created by main.main
    /home/sebastian/urls.go:83 +0x1ff

goroutine 6 [select]:
net/http.(*persistConn).roundTrip(0xc8200b0000, 0xc8200d0080, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:1164 +0xb0d
net/http.(*Transport).RoundTrip(0xc82001c1b0, 0xc8200ce0e0, 0x737f30, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:235 +0x530
main.main.func1(0xc820020120, 0xc82001c1b0, 0xc82000ad40)
    /home/sebastian/urls.go:66 +0x1e2
created by main.main
    /home/sebastian/urls.go:83 +0x1ff

goroutine 7 [select]:
net/http.(*persistConn).roundTrip(0xc8200de000, 0xc8202e4190, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:1164 +0xb0d
net/http.(*Transport).RoundTrip(0xc82001c1b0, 0xc82010e7e0, 0x7431e0, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:235 +0x530
main.main.func1(0xc820020120, 0xc82001c1b0, 0xc82000ad40)
    /home/sebastian/urls.go:66 +0x1e2
created by main.main
    /home/sebastian/urls.go:83 +0x1ff

goroutine 9 [select]:
net/http.(*persistConn).roundTrip(0xc8200de210, 0xc8200cc140, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:1164 +0xb0d
net/http.(*Transport).RoundTrip(0xc82001c1b0, 0xc8200c8380, 0x743240, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:235 +0x530
main.main.func1(0xc820020120, 0xc82001c1b0, 0xc82000ad40)
    /home/sebastian/urls.go:66 +0x1e2
created by main.main
    /home/sebastian/urls.go:83 +0x1ff

goroutine 10 [select]:
net/http.(*persistConn).roundTrip(0xc8200de160, 0xc8202683b0, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:1164 +0xb0d
net/http.(*Transport).RoundTrip(0xc82001c1b0, 0xc8200acfc0, 0x759440, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:235 +0x530
main.main.func1(0xc820020120, 0xc82001c1b0, 0xc82000ad40)
    /home/sebastian/urls.go:66 +0x1e2
created by main.main
    /home/sebastian/urls.go:83 +0x1ff

goroutine 11 [runnable]:
syscall.Syscall(0x0, 0x4, 0xc82015ab68, 0x1498, 0x1498, 0x1498, 0x0)
    /home/sebastian/go/src/syscall/asm_linux_amd64.s:18 +0x5
syscall.read(0x4, 0xc82015ab68, 0x1498, 0x1498, 0x72, 0x0, 0x0)
    /home/sebastian/go/src/syscall/zsyscall_linux_amd64.go:783 +0x5f
syscall.Read(0x4, 0xc82015ab68, 0x1498, 0x1498, 0xffffffffffffff01, 0x0, 0x0)
    /home/sebastian/go/src/syscall/syscall_unix.go:160 +0x4d
net.(*netFD).Read(0xc8200180e0, 0xc82015ab68, 0x1498, 0x1498, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/fd_unix.go:228 +0x18b
net.(*conn).Read(0xc820120000, 0xc82015ab68, 0x1498, 0x1498, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/net.go:172 +0xe4
crypto/tls.(*block).readFromUntil(0xc8200ca3c0, 0x7f9bb9a6bfc0, 0xc820120000, 0x1f5d, 0x0, 0x0)
    /home/sebastian/go/src/crypto/tls/conn.go:455 +0xcc
crypto/tls.(*Conn).readRecord(0xc820124000, 0x77fa17, 0x0, 0x0)
    /home/sebastian/go/src/crypto/tls/conn.go:583 +0xccf
crypto/tls.(*Conn).Read(0xc820124000, 0xc82040998f, 0x2191, 0x2471, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/crypto/tls/conn.go:901 +0x167
net/http.noteEOFReader.Read(0x7f9bb9a2b090, 0xc820124000, 0xc8200dc268, 0xc82040998f, 0x2191, 0x2471, 0x1f40, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:1370 +0x67
net/http.(*noteEOFReader).Read(0xc8200da460, 0xc82040998f, 0x2191, 0x2471, 0x1f40, 0x0, 0x0)
    <autogenerated>:126 +0xd0
bufio.(*Reader).Read(0xc8200d2e40, 0xc82040998f, 0x2191, 0x2471, 0x1f40, 0x0, 0x0)
    /home/sebastian/go/src/bufio/bufio.go:197 +0x126
io.(*LimitedReader).Read(0xc82033a860, 0xc82040998f, 0x2191, 0x2471, 0xc820151a88, 0x0, 0x0)
    /home/sebastian/go/src/io/io.go:427 +0xbd
net/http.(*body).readLocked(0xc82025b240, 0xc82040998f, 0x2471, 0x2471, 0xc800000000, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transfer.go:632 +0x98
net/http.(*body).Read(0xc82025b240, 0xc82040998f, 0x2471, 0x2471, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transfer.go:624 +0x110
net/http.(*bodyEOFSignal).Read(0xc82025b280, 0xc82040998f, 0x2471, 0x2471, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:1296 +0x26a
io.(*LimitedReader).Read(0xc82033a8c0, 0xc82040998f, 0x2471, 0x2471, 0x1f40, 0x0, 0x0)
    /home/sebastian/go/src/io/io.go:427 +0xbd
bytes.(*Buffer).ReadFrom(0xc820151cf8, 0x7f9bbcb26b68, 0xc82033a8c0, 0xd98f, 0x0, 0x0)
    /home/sebastian/go/src/bytes/buffer.go:173 +0x23f
io/ioutil.readAll(0x7f9bbcb26b68, 0xc82033a8c0, 0x200, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/io/ioutil/ioutil.go:33 +0x154
io/ioutil.ReadAll(0x7f9bbcb26b68, 0xc82033a8c0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/io/ioutil/ioutil.go:42 +0x51
main.main.func1(0xc820020120, 0xc82001c1b0, 0xc82000ad40)
    /home/sebastian/urls.go:75 +0x4d1
created by main.main
    /home/sebastian/urls.go:83 +0x1ff

goroutine 12 [select]:
net/http.(*persistConn).roundTrip(0xc8200b13f0, 0xc8203351d0, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:1164 +0xb0d
net/http.(*Transport).RoundTrip(0xc82001c1b0, 0xc8200ad420, 0x737ed0, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:235 +0x530
main.main.func1(0xc820020120, 0xc82001c1b0, 0xc82000ad40)
    /home/sebastian/urls.go:66 +0x1e2
created by main.main
    /home/sebastian/urls.go:83 +0x1ff

goroutine 13 [select]:
net/http.(*persistConn).roundTrip(0xc8200b14a0, 0xc8202e4b40, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:1164 +0xb0d
net/http.(*Transport).RoundTrip(0xc82001c1b0, 0xc82010e9a0, 0x743180, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:235 +0x530
main.main.func1(0xc820020120, 0xc82001c1b0, 0xc82000ad40)
    /home/sebastian/urls.go:66 +0x1e2
created by main.main
    /home/sebastian/urls.go:83 +0x1ff

goroutine 14 [runnable]:
io.(*LimitedReader).Read(0xc820281360, 0xc82041be00, 0x10000, 0x10000, 0x4b7, 0x0, 0x0)
    /home/sebastian/go/src/io/io.go:420
bytes.(*Buffer).ReadFrom(0xc820055cf8, 0x7f9bbcb26b68, 0xc820281360, 0xfe00, 0x0, 0x0)
    /home/sebastian/go/src/bytes/buffer.go:173 +0x23f
io/ioutil.readAll(0x7f9bbcb26b68, 0xc820281360, 0x200, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/io/ioutil/ioutil.go:33 +0x154
io/ioutil.ReadAll(0x7f9bbcb26b68, 0xc820281360, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/io/ioutil/ioutil.go:42 +0x51
main.main.func1(0xc820020120, 0xc82001c1b0, 0xc82000ad40)
    /home/sebastian/urls.go:75 +0x4d1
created by main.main
    /home/sebastian/urls.go:83 +0x1ff

goroutine 43 [IO wait]:
net.runtime_pollWait(0x7f9bb9a6bf00, 0x72, 0xc82000a270)
    /home/sebastian/go/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc82011c060, 0x72, 0x0, 0x0)
    /home/sebastian/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc82011c060, 0x0, 0x0)
    /home/sebastian/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc82011c000, 0xc8202f4000, 0x2000, 0x2000, 0x0, 0x7f9bbcb22168, 0xc82000a270)
    /home/sebastian/go/src/net/fd_unix.go:232 +0x23a
net.(*conn).Read(0xc820132000, 0xc8202f4000, 0x2000, 0x2000, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/net.go:172 +0xe4
crypto/tls.(*block).readFromUntil(0xc82028e4e0, 0x7f9bb9a6bfc0, 0xc820132000, 0x5, 0x0, 0x0)
    /home/sebastian/go/src/crypto/tls/conn.go:455 +0xcc
crypto/tls.(*Conn).readRecord(0xc820138000, 0x77fa17, 0x0, 0x0)
    /home/sebastian/go/src/crypto/tls/conn.go:540 +0x2d1
crypto/tls.(*Conn).Read(0xc820138000, 0xc8201ac000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/crypto/tls/conn.go:901 +0x167
net/http.noteEOFReader.Read(0x7f9bb9a2b090, 0xc820138000, 0xc8200de1b8, 0xc8201ac000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:1370 +0x67
net/http.(*noteEOFReader).Read(0xc8200da580, 0xc8201ac000, 0x1000, 0x1000, 0xc82021fef0, 0x0, 0x0)
    <autogenerated>:126 +0xd0
bufio.(*Reader).fill(0xc8200d3080)
    /home/sebastian/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).Peek(0xc8200d3080, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/bufio/bufio.go:132 +0xcc
net/http.(*persistConn).readLoop(0xc8200de160)
    /home/sebastian/go/src/net/http/transport.go:876 +0xf7
created by net/http.(*Transport).dialConn
    /home/sebastian/go/src/net/http/transport.go:685 +0xc78

goroutine 23 [select]:
net/http.(*persistConn).readLoop(0xc8200de0b0)
    /home/sebastian/go/src/net/http/transport.go:976 +0xac7
created by net/http.(*Transport).dialConn
    /home/sebastian/go/src/net/http/transport.go:685 +0xc78

goroutine 26 [select]:
net/http.(*persistConn).writeLoop(0xc8200de000)
    /home/sebastian/go/src/net/http/transport.go:1009 +0x40c
created by net/http.(*Transport).dialConn
    /home/sebastian/go/src/net/http/transport.go:686 +0xc9d

goroutine 44 [select]:
net/http.(*persistConn).writeLoop(0xc8200de160)
    /home/sebastian/go/src/net/http/transport.go:1009 +0x40c
created by net/http.(*Transport).dialConn
    /home/sebastian/go/src/net/http/transport.go:686 +0xc9d

goroutine 87 [select]:
net/http.(*persistConn).writeLoop(0xc8200b0fd0)
    /home/sebastian/go/src/net/http/transport.go:1009 +0x40c
created by net/http.(*Transport).dialConn
    /home/sebastian/go/src/net/http/transport.go:686 +0xc9d

goroutine 48 [select]:
net/http.(*persistConn).writeLoop(0xc8200de210)
    /home/sebastian/go/src/net/http/transport.go:1009 +0x40c
created by net/http.(*Transport).dialConn
    /home/sebastian/go/src/net/http/transport.go:686 +0xc9d

goroutine 41 [select]:
net/http.(*persistConn).readLoop(0xc8200dc210)
    /home/sebastian/go/src/net/http/transport.go:976 +0xac7
created by net/http.(*Transport).dialConn
    /home/sebastian/go/src/net/http/transport.go:685 +0xc78

goroutine 70 [IO wait]:
net.runtime_pollWait(0x7f9bb9a6bb40, 0x72, 0xc82000a270)
    /home/sebastian/go/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc82011e0d0, 0x72, 0x0, 0x0)
    /home/sebastian/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc82011e0d0, 0x0, 0x0)
    /home/sebastian/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc82011e070, 0xc8201e8000, 0x2000, 0x2000, 0x0, 0x7f9bbcb22168, 0xc82000a270)
    /home/sebastian/go/src/net/fd_unix.go:232 +0x23a
net.(*conn).Read(0xc820134000, 0xc8201e8000, 0x2000, 0x2000, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/net.go:172 +0xe4
crypto/tls.(*block).readFromUntil(0xc8200c63c0, 0x7f9bb9a6bfc0, 0xc820134000, 0x5, 0x0, 0x0)
    /home/sebastian/go/src/crypto/tls/conn.go:455 +0xcc
crypto/tls.(*Conn).readRecord(0xc820140000, 0x77fa17, 0x0, 0x0)
    /home/sebastian/go/src/crypto/tls/conn.go:540 +0x2d1
crypto/tls.(*Conn).Read(0xc820140000, 0xc8201bb000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/crypto/tls/conn.go:901 +0x167
net/http.noteEOFReader.Read(0x7f9bb9a2b090, 0xc820140000, 0xc8200b0058, 0xc8201bb000, 0x1000, 0x1000, 0x36300000000, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:1370 +0x67
net/http.(*noteEOFReader).Read(0xc8201d3a60, 0xc8201bb000, 0x1000, 0x1000, 0x7f9bb9a2b110, 0x0, 0x0)
    <autogenerated>:126 +0xd0
bufio.(*Reader).fill(0xc820112d80)
    /home/sebastian/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).Peek(0xc820112d80, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/bufio/bufio.go:132 +0xcc
net/http.(*persistConn).readLoop(0xc8200b0000)
    /home/sebastian/go/src/net/http/transport.go:876 +0xf7
created by net/http.(*Transport).dialConn
    /home/sebastian/go/src/net/http/transport.go:685 +0xc78

goroutine 84 [IO wait]:
net.runtime_pollWait(0x7f9bb9a6b900, 0x72, 0xc82000a270)
    /home/sebastian/go/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc82011a140, 0x72, 0x0, 0x0)
    /home/sebastian/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc82011a140, 0x0, 0x0)
    /home/sebastian/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc82011a0e0, 0xc82026e000, 0x2000, 0x2000, 0x0, 0x7f9bbcb22168, 0xc82000a270)
    /home/sebastian/go/src/net/fd_unix.go:232 +0x23a
net.(*conn).Read(0xc820132008, 0xc82026e000, 0x2000, 0x2000, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/net.go:172 +0xe4
crypto/tls.(*block).readFromUntil(0xc82010c330, 0x7f9bb9a6bfc0, 0xc820132008, 0x5, 0x0, 0x0)
    /home/sebastian/go/src/crypto/tls/conn.go:455 +0xcc
crypto/tls.(*Conn).readRecord(0xc8201382c0, 0x77fa17, 0x0, 0x0)
    /home/sebastian/go/src/crypto/tls/conn.go:540 +0x2d1
crypto/tls.(*Conn).Read(0xc8201382c0, 0xc820235000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/crypto/tls/conn.go:901 +0x167
net/http.noteEOFReader.Read(0x7f9bb9a2b090, 0xc8201382c0, 0xc8200dc108, 0xc820235000, 0x1000, 0x1000, 0xc82028c180, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:1370 +0x67
net/http.(*noteEOFReader).Read(0xc820294080, 0xc820235000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    <autogenerated>:126 +0xd0
bufio.(*Reader).fill(0xc820290120)
    /home/sebastian/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).Peek(0xc820290120, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/bufio/bufio.go:132 +0xcc
net/http.(*persistConn).readLoop(0xc8200dc0b0)
    /home/sebastian/go/src/net/http/transport.go:876 +0xf7
created by net/http.(*Transport).dialConn
    /home/sebastian/go/src/net/http/transport.go:685 +0xc78

goroutine 62 [select]:
net/http.(*persistConn).writeLoop(0xc8200b14a0)
    /home/sebastian/go/src/net/http/transport.go:1009 +0x40c
created by net/http.(*Transport).dialConn
    /home/sebastian/go/src/net/http/transport.go:686 +0xc9d

goroutine 25 [IO wait]:
net.runtime_pollWait(0x7f9bb9a6ba80, 0x72, 0xc82000a270)
    /home/sebastian/go/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc82011c0d0, 0x72, 0x0, 0x0)
    /home/sebastian/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc82011c0d0, 0x0, 0x0)
    /home/sebastian/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc82011c070, 0xc82022c000, 0x2000, 0x2000, 0x0, 0x7f9bbcb22168, 0xc82000a270)
    /home/sebastian/go/src/net/fd_unix.go:232 +0x23a
net.(*conn).Read(0xc820132010, 0xc82022c000, 0x2000, 0x2000, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/net.go:172 +0xe4
crypto/tls.(*block).readFromUntil(0xc82010c3f0, 0x7f9bb9a6bfc0, 0xc820132010, 0x5, 0x0, 0x0)
    /home/sebastian/go/src/crypto/tls/conn.go:455 +0xcc
crypto/tls.(*Conn).readRecord(0xc820138580, 0x77fa17, 0x0, 0x0)
    /home/sebastian/go/src/crypto/tls/conn.go:540 +0x2d1
crypto/tls.(*Conn).Read(0xc820138580, 0xc820255000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/crypto/tls/conn.go:901 +0x167
net/http.noteEOFReader.Read(0x7f9bb9a2b090, 0xc820138580, 0xc8200de058, 0xc820255000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:1370 +0x67
net/http.(*noteEOFReader).Read(0xc82025ed40, 0xc820255000, 0x1000, 0x1000, 0xc82021fef0, 0x0, 0x0)
    <autogenerated>:126 +0xd0
bufio.(*Reader).fill(0xc8202604e0)
    /home/sebastian/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).Peek(0xc8202604e0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/bufio/bufio.go:132 +0xcc
net/http.(*persistConn).readLoop(0xc8200de000)
    /home/sebastian/go/src/net/http/transport.go:876 +0xf7
created by net/http.(*Transport).dialConn
    /home/sebastian/go/src/net/http/transport.go:685 +0xc78

goroutine 47 [IO wait]:
net.runtime_pollWait(0x7f9bb9a6bc00, 0x72, 0xc82000a270)
    /home/sebastian/go/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc82011a0d0, 0x72, 0x0, 0x0)
    /home/sebastian/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc82011a0d0, 0x0, 0x0)
    /home/sebastian/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc82011a070, 0xc820210000, 0x2000, 0x2000, 0x0, 0x7f9bbcb22168, 0xc82000a270)
    /home/sebastian/go/src/net/fd_unix.go:232 +0x23a
net.(*conn).Read(0xc820134010, 0xc820210000, 0x2000, 0x2000, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/net.go:172 +0xe4
crypto/tls.(*block).readFromUntil(0xc8200c6540, 0x7f9bb9a6bfc0, 0xc820134010, 0x5, 0x0, 0x0)
    /home/sebastian/go/src/crypto/tls/conn.go:455 +0xcc
crypto/tls.(*Conn).readRecord(0xc820140580, 0x77fa17, 0x0, 0x0)
    /home/sebastian/go/src/crypto/tls/conn.go:540 +0x2d1
crypto/tls.(*Conn).Read(0xc820140580, 0xc82022a000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/crypto/tls/conn.go:901 +0x167
net/http.noteEOFReader.Read(0x7f9bb9a2b090, 0xc820140580, 0xc8200de268, 0xc82022a000, 0x1000, 0x1000, 0xc8200d5bc0, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:1370 +0x67
net/http.(*noteEOFReader).Read(0xc8200da740, 0xc82022a000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    <autogenerated>:126 +0xd0
bufio.(*Reader).fill(0xc8200d3560)
    /home/sebastian/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).Peek(0xc8200d3560, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/bufio/bufio.go:132 +0xcc
net/http.(*persistConn).readLoop(0xc8200de210)
    /home/sebastian/go/src/net/http/transport.go:876 +0xf7
created by net/http.(*Transport).dialConn
    /home/sebastian/go/src/net/http/transport.go:685 +0xc78

goroutine 42 [select]:
net/http.(*persistConn).writeLoop(0xc8200dc210)
    /home/sebastian/go/src/net/http/transport.go:1009 +0x40c
created by net/http.(*Transport).dialConn
    /home/sebastian/go/src/net/http/transport.go:686 +0xc9d

goroutine 24 [select]:
net/http.(*persistConn).writeLoop(0xc8200de0b0)
    /home/sebastian/go/src/net/http/transport.go:1009 +0x40c
created by net/http.(*Transport).dialConn
    /home/sebastian/go/src/net/http/transport.go:686 +0xc9d

goroutine 71 [select]:
net/http.(*persistConn).writeLoop(0xc8200b0000)
    /home/sebastian/go/src/net/http/transport.go:1009 +0x40c
created by net/http.(*Transport).dialConn
    /home/sebastian/go/src/net/http/transport.go:686 +0xc9d

goroutine 58 [IO wait]:
net.runtime_pollWait(0x7f9bb9a6b9c0, 0x72, 0xc82000a270)
    /home/sebastian/go/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc82011b640, 0x72, 0x0, 0x0)
    /home/sebastian/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc82011b640, 0x0, 0x0)
    /home/sebastian/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc82011b5e0, 0xc8203c8000, 0x1000, 0x1000, 0x0, 0x7f9bbcb22168, 0xc82000a270)
    /home/sebastian/go/src/net/fd_unix.go:232 +0x23a
net.(*conn).Read(0xc820120008, 0xc8203c8000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/net.go:172 +0xe4
net/http.noteEOFReader.Read(0x7f9bb9a6bfc0, 0xc820120008, 0xc820118898, 0xc8203c8000, 0x1000, 0x1000, 0xc820113d40, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:1370 +0x67
net/http.(*noteEOFReader).Read(0xc820221320, 0xc8203c8000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    <autogenerated>:126 +0xd0
bufio.(*Reader).fill(0xc82028c300)
    /home/sebastian/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).Peek(0xc82028c300, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/bufio/bufio.go:132 +0xcc
net/http.(*persistConn).readLoop(0xc820118840)
    /home/sebastian/go/src/net/http/transport.go:876 +0xf7
created by net/http.(*Transport).dialConn
    /home/sebastian/go/src/net/http/transport.go:685 +0xc78

goroutine 91 [select]:
net/http.(*persistConn).writeLoop(0xc8200b13f0)
    /home/sebastian/go/src/net/http/transport.go:1009 +0x40c
created by net/http.(*Transport).dialConn
    /home/sebastian/go/src/net/http/transport.go:686 +0xc9d

goroutine 86 [IO wait]:
net.runtime_pollWait(0x7f9bb9a6b6c0, 0x72, 0xc82000a270)
    /home/sebastian/go/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc8202700d0, 0x72, 0x0, 0x0)
    /home/sebastian/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc8202700d0, 0x0, 0x0)
    /home/sebastian/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc820270070, 0xc8202f6000, 0x2000, 0x2000, 0x0, 0x7f9bbcb22168, 0xc82000a270)
    /home/sebastian/go/src/net/fd_unix.go:232 +0x23a
net.(*conn).Read(0xc820032080, 0xc8202f6000, 0x2000, 0x2000, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/net.go:172 +0xe4
crypto/tls.(*block).readFromUntil(0xc8201a7650, 0x7f9bb9a6bfc0, 0xc820032080, 0x5, 0x0, 0x0)
    /home/sebastian/go/src/crypto/tls/conn.go:455 +0xcc
crypto/tls.(*Conn).readRecord(0xc8200b2dc0, 0x77fa17, 0x0, 0x0)
    /home/sebastian/go/src/crypto/tls/conn.go:540 +0x2d1
crypto/tls.(*Conn).Read(0xc8200b2dc0, 0xc82031b000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/crypto/tls/conn.go:901 +0x167
net/http.noteEOFReader.Read(0x7f9bb9a2b090, 0xc8200b2dc0, 0xc8200b1028, 0xc82031b000, 0x1000, 0x1000, 0xc820260b40, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:1370 +0x67
net/http.(*noteEOFReader).Read(0xc8202fd8e0, 0xc82031b000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    <autogenerated>:126 +0xd0
bufio.(*Reader).fill(0xc820290900)
    /home/sebastian/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).Peek(0xc820290900, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/bufio/bufio.go:132 +0xcc
net/http.(*persistConn).readLoop(0xc8200b0fd0)
    /home/sebastian/go/src/net/http/transport.go:876 +0xf7
created by net/http.(*Transport).dialConn
    /home/sebastian/go/src/net/http/transport.go:685 +0xc78

goroutine 90 [IO wait]:
net.runtime_pollWait(0x7f9bb9a6b780, 0x72, 0xc82000a270)
    /home/sebastian/go/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc820270990, 0x72, 0x0, 0x0)
    /home/sebastian/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc820270990, 0x0, 0x0)
    /home/sebastian/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc820270930, 0xc820361000, 0x1000, 0x1000, 0x0, 0x7f9bbcb22168, 0xc82000a270)
    /home/sebastian/go/src/net/fd_unix.go:232 +0x23a
net.(*conn).Read(0xc820134028, 0xc820361000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/net.go:172 +0xe4
net/http.noteEOFReader.Read(0x7f9bb9a6bfc0, 0xc820134028, 0xc8200b1448, 0xc820361000, 0x1000, 0x1000, 0xc820261560, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:1370 +0x67
net/http.(*noteEOFReader).Read(0xc8202fd9e0, 0xc820361000, 0x1000, 0x1000, 0xc82002ccf0, 0x0, 0x0)
    <autogenerated>:126 +0xd0
bufio.(*Reader).fill(0xc820290a80)
    /home/sebastian/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).Peek(0xc820290a80, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/bufio/bufio.go:132 +0xcc
net/http.(*persistConn).readLoop(0xc8200b13f0)
    /home/sebastian/go/src/net/http/transport.go:876 +0xf7
created by net/http.(*Transport).dialConn
    /home/sebastian/go/src/net/http/transport.go:685 +0xc78

goroutine 85 [select]:
net/http.(*persistConn).writeLoop(0xc8200dc0b0)
    /home/sebastian/go/src/net/http/transport.go:1009 +0x40c
created by net/http.(*Transport).dialConn
    /home/sebastian/go/src/net/http/transport.go:686 +0xc9d

goroutine 61 [IO wait]:
net.runtime_pollWait(0x7f9bb9a6bd80, 0x72, 0xc82000a270)
    /home/sebastian/go/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc82011d410, 0x72, 0x0, 0x0)
    /home/sebastian/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc82011d410, 0x0, 0x0)
    /home/sebastian/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc82011d3b0, 0xc8203cc000, 0x1000, 0x1000, 0x0, 0x7f9bbcb22168, 0xc82000a270)
    /home/sebastian/go/src/net/fd_unix.go:232 +0x23a
net.(*conn).Read(0xc820120010, 0xc8203cc000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/net/net.go:172 +0xe4
net/http.noteEOFReader.Read(0x7f9bb9a6bfc0, 0xc820120010, 0xc8200b14f8, 0xc8203cc000, 0x1000, 0x1000, 0xc820113da0, 0x0, 0x0)
    /home/sebastian/go/src/net/http/transport.go:1370 +0x67
net/http.(*noteEOFReader).Read(0xc820221400, 0xc8203cc000, 0x1000, 0x1000, 0x1, 0x0, 0x0)
    <autogenerated>:126 +0xd0
bufio.(*Reader).fill(0xc82028c480)
    /home/sebastian/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).Peek(0xc82028c480, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go/src/bufio/bufio.go:132 +0xcc
net/http.(*persistConn).readLoop(0xc8200b14a0)
    /home/sebastian/go/src/net/http/transport.go:876 +0xf7
created by net/http.(*Transport).dialConn
    /home/sebastian/go/src/net/http/transport.go:685 +0xc78

goroutine 59 [select]:
net/http.(*persistConn).writeLoop(0xc820118840)
    /home/sebastian/go/src/net/http/transport.go:1009 +0x40c
created by net/http.(*Transport).dialConn
    /home/sebastian/go/src/net/http/transport.go:686 +0xc9d
exit status 2
@davecheney
Copy link
Contributor

Thank you for this bug report.

Have you confirmed your code is free of data races ? If so, can you please include some sample code that demonstrates the issue so that others can try to confirm the issue you are seeing.

@sebcat
Copy link
Author

sebcat commented Aug 26, 2015

Code used to replicate issue seen in another application (with URLs redacted):

package main

import (
    "crypto/tls"
    "io"
    "io/ioutil"
    "log"
    "net"
    "net/http"
    "sync"
    "time"
)

var urllist = []string{
// redacted
}

const nconcurrent = 10

func main() {
    t := http.Transport{
        TLSHandshakeTimeout:   20 * time.Second,
        ResponseHeaderTimeout: 1 * time.Minute,
        Proxy: http.ProxyFromEnvironment,
        Dial: (&net.Dialer{
            Timeout:   20 * time.Second,
            KeepAlive: 30 * time.Second,
            DualStack: true,
        }).Dial,
        TLSClientConfig: &tls.Config{
            InsecureSkipVerify: true,
        },
    }

    ch := make(chan string)
    var wg sync.WaitGroup
    wg.Add(nconcurrent)
    for i := 0; i < nconcurrent; i++ {
        go func() {
            for urlstr := range ch {
                req, err := http.NewRequest("GET", urlstr, nil)
                if err != nil {
                    log.Fatal(err)
                }

                resp, err := t.RoundTrip(req)
                if err != nil {
                    log.Println("RoundTrip", req.URL, err)
                } else {
                    log.Println("RoundTrip", req.URL, resp.Status, resp.Proto)
                    if resp.Body != nil {
                        b := io.LimitReader(resp.Body, 10000000)
                        _, err = ioutil.ReadAll(b)
                        if err != nil {
                            log.Println("ReadAll", req.URL, err)
                        }
                    }
                }
            }

            wg.Done()
        }()
    }

    for _, urlstr := range urllist {
        ch <- urlstr
    }

    log.Println("Feed completed")
    close(ch)
    wg.Wait()
}

-race yields:

==================
WARNING: DATA RACE
Read by goroutine 9:
  bufio.(*Reader).ReadSlice()
      /home/sebastian/go/src/bufio/bufio.go:306 +0x75
  net/http/internal.readLine()
      /home/sebastian/go/src/net/http/internal/chunked.go:110 +0x61
  net/http/internal.(*chunkedReader).beginChunk()
      /home/sebastian/go/src/net/http/internal/chunked.go:47 +0x5a
  net/http/internal.(*chunkedReader).Read()
      /home/sebastian/go/src/net/http/internal/chunked.go:77 +0x11a
  net/http.(*body).readLocked()
      /home/sebastian/go/src/net/http/transfer.go:632 +0x113
  net/http.(*body).Read()
      /home/sebastian/go/src/net/http/transfer.go:624 +0x157
  net/http.(*bodyEOFSignal).Read()
      /home/sebastian/go/src/net/http/transport.go:1296 +0x2df
  io.(*LimitedReader).Read()
      /home/sebastian/go/src/io/io.go:427 +0x15d
  bytes.(*Buffer).ReadFrom()
      /home/sebastian/go/src/bytes/buffer.go:173 +0x414
  io/ioutil.readAll()
      /home/sebastian/go/src/io/ioutil/ioutil.go:33 +0x1a0
  io/ioutil.ReadAll()
      /home/sebastian/go/src/io/ioutil/ioutil.go:42 +0x71
  main.main.func1()
      /home/sebastian/urls.go:75 +0x5b7

Previous write by goroutine 45:
  bufio.(*Reader).fill()
      /home/sebastian/go/src/bufio/bufio.go:88 +0x1cf
  bufio.(*Reader).Peek()
      /home/sebastian/go/src/bufio/bufio.go:132 +0x186
  net/http.(*persistConn).readLoop()
      /home/sebastian/go/src/net/http/transport.go:876 +0x14d

Goroutine 9 (running) created at:
  main.main()
      /home/sebastian/urls.go:83 +0x2e5

Goroutine 45 (running) created at:
  net/http.(*Transport).dialConn()
      /home/sebastian/go/src/net/http/transport.go:685 +0x11bf
  net/http.(*Transport).getConn.func4()
      /home/sebastian/go/src/net/http/transport.go:549 +0x73
==================
==================
WARNING: DATA RACE
Read by goroutine 9:
  bufio.(*Reader).ReadSlice()
      /home/sebastian/go/src/bufio/bufio.go:306 +0x94
  net/http/internal.readLine()
      /home/sebastian/go/src/net/http/internal/chunked.go:110 +0x61
  net/http/internal.(*chunkedReader).beginChunk()
      /home/sebastian/go/src/net/http/internal/chunked.go:47 +0x5a
  net/http/internal.(*chunkedReader).Read()
      /home/sebastian/go/src/net/http/internal/chunked.go:77 +0x11a
  net/http.(*body).readLocked()
      /home/sebastian/go/src/net/http/transfer.go:632 +0x113
  net/http.(*body).Read()
      /home/sebastian/go/src/net/http/transfer.go:624 +0x157
  net/http.(*bodyEOFSignal).Read()
      /home/sebastian/go/src/net/http/transport.go:1296 +0x2df
  io.(*LimitedReader).Read()
      /home/sebastian/go/src/io/io.go:427 +0x15d
  bytes.(*Buffer).ReadFrom()
      /home/sebastian/go/src/bytes/buffer.go:173 +0x414
  io/ioutil.readAll()
      /home/sebastian/go/src/io/ioutil/ioutil.go:33 +0x1a0
  io/ioutil.ReadAll()
      /home/sebastian/go/src/io/ioutil/ioutil.go:42 +0x71
  main.main.func1()
      /home/sebastian/urls.go:75 +0x5b7

Previous write by goroutine 45:
  bufio.(*Reader).fill()
      /home/sebastian/go/src/bufio/bufio.go:87 +0x189
  bufio.(*Reader).Peek()
      /home/sebastian/go/src/bufio/bufio.go:132 +0x186
  net/http.(*persistConn).readLoop()
      /home/sebastian/go/src/net/http/transport.go:876 +0x14d

Goroutine 9 (running) created at:
  main.main()
      /home/sebastian/urls.go:83 +0x2e5

Goroutine 45 (running) created at:
  net/http.(*Transport).dialConn()
      /home/sebastian/go/src/net/http/transport.go:685 +0x11bf
  net/http.(*Transport).getConn.func4()
      /home/sebastian/go/src/net/http/transport.go:549 +0x73

EDIT: changed the code above to only access resp if RoundTrip was successful. Reran test to confirm that the issue persists (it does).
EDIT2: Also reproducible with http.DefaultTransport

@davecheney
Copy link
Contributor

Thank you for providing your sample code. Although it should not matter for this issue, I cannot see where you are closing the response body.

/cc @bradfitz

@sebcat
Copy link
Author

sebcat commented Aug 26, 2015

I wanted a small piece of example code exhibiting the problem I saw in another application. I should have taken more care in writing it. I've now tested the example above with resp.Body.Close(). The problem persists.

@ianlancetaylor ianlancetaylor added this to the Go1.5.1 milestone Aug 26, 2015
@ianlancetaylor
Copy link
Contributor

I'm not clear on your initial report: does this failure happen with 1.4.2, or only with 1.5?

@sebcat
Copy link
Author

sebcat commented Aug 26, 2015

It happens on both 1.4.2 and 1.5.

EDIT: paths above relating to /home/sebastian/go is go 1.5

@ianlancetaylor ianlancetaylor modified the milestones: Go1.6, Go1.5.1 Aug 27, 2015
@bradfitz
Copy link
Contributor

bradfitz commented Dec 1, 2015

Can you email me privately the URL(s) I can hit to reproduce this?

I am <my github username>@golang.org.

@sebcat
Copy link
Author

sebcat commented Dec 2, 2015

Email sent

@bradfitz
Copy link
Contributor

bradfitz commented Dec 2, 2015

I can't reproduce. Can you reproduce with Go tip? (what is to become Go 1.6 soon-ish)

@sebcat
Copy link
Author

sebcat commented Dec 3, 2015

With same code/line-numbers as in email, using master (assuming master == tip):

$ go version
go version devel +bb6fb92 Thu Dec 3 03:53:35 2015 +0000 linux/amd64
$ go build -race golang_crash.go 
$ ./golang_crash 
2015/12/03 14:03:06 RoundTrip [url] 200 OK HTTP/1.1
2015/12/03 14:03:06 RoundTrip [url] 204 Request format is unrecognized for URL unexpectedly ending in '/'. HTTP/1.1
==================
WARNING: DATA RACE
Read by goroutine 9:
  bufio.(*Reader).ReadSlice()
      /home/sebastian/go-tip/src/bufio/bufio.go:306 +0x75
  net/http/internal.readChunkLine()
      /home/sebastian/go-tip/src/net/http/internal/chunked.go:110 +0x60
  net/http/internal.(*chunkedReader).beginChunk()
      /home/sebastian/go-tip/src/net/http/internal/chunked.go:47 +0x5a
  net/http/internal.(*chunkedReader).Read()
      /home/sebastian/go-tip/src/net/http/internal/chunked.go:77 +0x11a
  net/http.(*body).readLocked()
      /home/sebastian/go-tip/src/net/http/transfer.go:642 +0x113
  net/http.(*body).Read()
      /home/sebastian/go-tip/src/net/http/transfer.go:634 +0x157
  net/http.(*bodyEOFSignal).Read()
      /home/sebastian/go-tip/src/net/http/transport.go:1480 +0x2df
  io.(*LimitedReader).Read()
      /home/sebastian/go-tip/src/io/io.go:426 +0x15d
  bytes.(*Buffer).ReadFrom()
      /home/sebastian/go-tip/src/bytes/buffer.go:173 +0x414
  io/ioutil.readAll()
      /home/sebastian/go-tip/src/io/ioutil/ioutil.go:33 +0x1a2
  io/ioutil.ReadAll()
      /home/sebastian/go-tip/src/io/ioutil/ioutil.go:42 +0x71
  main.main.func1()
      /home/sebastian/src/golang_crash.go:75 +0x8bb

Previous write by goroutine 51:
  bufio.(*Reader).fill()
      /home/sebastian/go-tip/src/bufio/bufio.go:88 +0x1cf
  bufio.(*Reader).Peek()
      /home/sebastian/go-tip/src/bufio/bufio.go:132 +0x186
  net/http.(*persistConn).readLoop()
      /home/sebastian/go-tip/src/net/http/transport.go:995 +0x13e

Goroutine 9 (running) created at:
  main.main()
      /home/sebastian/src/golang_crash.go:84 +0x2eb

Goroutine 51 (running) created at:
  net/http.(*Transport).dialConn()
      /home/sebastian/go-tip/src/net/http/transport.go:790 +0x14c0
  net/http.(*Transport).getConn.func4()
      /home/sebastian/go-tip/src/net/http/transport.go:648 +0x73
==================
==================
WARNING: DATA RACE
Read by goroutine 9:
  bufio.(*Reader).ReadSlice()
      /home/sebastian/go-tip/src/bufio/bufio.go:306 +0x94
  net/http/internal.readChunkLine()
      /home/sebastian/go-tip/src/net/http/internal/chunked.go:110 +0x60
  net/http/internal.(*chunkedReader).beginChunk()
      /home/sebastian/go-tip/src/net/http/internal/chunked.go:47 +0x5a
  net/http/internal.(*chunkedReader).Read()
      /home/sebastian/go-tip/src/net/http/internal/chunked.go:77 +0x11a
  net/http.(*body).readLocked()
      /home/sebastian/go-tip/src/net/http/transfer.go:642 +0x113
  net/http.(*body).Read()
      /home/sebastian/go-tip/src/net/http/transfer.go:634 +0x157
2015/12/03 14:03:06 RoundTrip [url] 403 Forbidden HTTP/1.1
  net/http.(*bodyEOFSignal).Read()
      /home/sebastian/go-tip/src/net/http/transport.go:1480 +0x2df
  io.(*LimitedReader).Read()
      /home/sebastian/go-tip/src/io/io.go:426 +0x15d
  bytes.(*Buffer).ReadFrom()
      /home/sebastian/go-tip/src/bytes/buffer.go:173 +0x414
  io/ioutil.readAll()
      /home/sebastian/go-tip/src/io/ioutil/ioutil.go:33 +0x1a2
  io/ioutil.ReadAll()
      /home/sebastian/go-tip/src/io/ioutil/ioutil.go:42 +0x71
  main.main.func1()
      /home/sebastian/src/golang_crash.go:75 +0x8bb

Previous write by goroutine 51:
  bufio.(*Reader).fill()
      /home/sebastian/go-tip/src/bufio/bufio.go:87 +0x189
  bufio.(*Reader).Peek()
      /home/sebastian/go-tip/src/bufio/bufio.go:132 +0x186
  net/http.(*persistConn).readLoop()
      /home/sebastian/go-tip/src/net/http/transport.go:995 +0x13e

Goroutine 9 (running) created at:
  main.main()
      /home/sebastian/src/golang_crash.go:84 +0x2eb

Goroutine 51 (running) created at:
  net/http.(*Transport).dialConn()
      /home/sebastian/go-tip/src/net/http/transport.go:790 +0x14c0
  net/http.(*Transport).getConn.func4()
      /home/sebastian/go-tip/src/net/http/transport.go:648 +0x73
==================
2015/12/03 14:03:06 RoundTrip [url] 403 Forbidden HTTP/1.1
2015/12/03 14:03:06 RoundTrip [url] 200 OK HTTP/1.1
2015/12/03 14:03:06 RoundTrip [url] 403 Forbidden HTTP/1.1
2015/12/03 14:03:06 RoundTrip [url] 403 Forbidden HTTP/1.1
2015/12/03 14:03:06 RoundTrip [url] 404 Not Found HTTP/1.1
2015/12/03 14:03:06 RoundTrip [url] 403 Forbidden HTTP/1.1
==================
WARNING: DATA RACE
Read by goroutine 51:
  bufio.(*Reader).ReadSlice()
      /home/sebastian/go-tip/src/bufio/bufio.go:333 +0x281
  bufio.(*Reader).ReadLine()
      /home/sebastian/go-tip/src/bufio/bufio.go:357 +0x6c
  net/textproto.(*Reader).readLineSlice()
      /home/sebastian/go-tip/src/net/textproto/reader.go:55 +0xa2
  net/textproto.(*Reader).ReadLine()
      /home/sebastian/go-tip/src/net/textproto/reader.go:36 +0x4d
  net/http.ReadResponse()
      /home/sebastian/go-tip/src/net/http/response.go:128 +0x182
  net/http.(*persistConn).readLoop()
      /home/sebastian/go-tip/src/net/http/transport.go:1018 +0x675

Previous write by goroutine 9:
  runtime.slicecopy()
      /home/sebastian/go-tip/src/runtime/slice.go:113 +0x0
  crypto/tls.(*Conn).Read()
      /home/sebastian/go-tip/src/crypto/tls/conn.go:928 +0x39f
  net/http.noteEOFReader.Read()
      /home/sebastian/go-tip/src/net/http/transport.go:1554 +0x74
  net/http.(*noteEOFReader).Read()
      <autogenerated>:260 +0xf7
  bufio.(*Reader).fill()
      /home/sebastian/go-tip/src/bufio/bufio.go:97 +0x364
  bufio.(*Reader).ReadSlice()
      /home/sebastian/go-tip/src/bufio/bufio.go:328 +0x5a8
  net/http/internal.readChunkLine()
      /home/sebastian/go-tip/src/net/http/internal/chunked.go:110 +0x60
  net/http/internal.(*chunkedReader).beginChunk()
      /home/sebastian/go-tip/src/net/http/internal/chunked.go:47 +0x5a
  net/http/internal.(*chunkedReader).Read()
      /home/sebastian/go-tip/src/net/http/internal/chunked.go:77 +0x11a
  net/http.(*body).readLocked()
      /home/sebastian/go-tip/src/net/http/transfer.go:642 +0x113
  net/http.(*body).Read()
      /home/sebastian/go-tip/src/net/http/transfer.go:634 +0x157
  net/http.(*bodyEOFSignal).Read()
      /home/sebastian/go-tip/src/net/http/transport.go:1480 +0x2df
  io.(*LimitedReader).Read()
      /home/sebastian/go-tip/src/io/io.go:426 +0x15d
  bytes.(*Buffer).ReadFrom()
      /home/sebastian/go-tip/src/bytes/buffer.go:173 +0x414
  io/ioutil.readAll()
      /home/sebastian/go-tip/src/io/ioutil/ioutil.go:33 +0x1a2
  io/ioutil.ReadAll()
      /home/sebastian/go-tip/src/io/ioutil/ioutil.go:42 +0x71
  main.main.func1()
      /home/sebastian/src/golang_crash.go:75 +0x8bb

Goroutine 51 (running) created at:
  net/http.(*Transport).dialConn()
      /home/sebastian/go-tip/src/net/http/transport.go:790 +0x14c0
  net/http.(*Transport).getConn.func4()
      /home/sebastian/go-tip/src/net/http/transport.go:648 +0x73

Goroutine 9 (running) created at:
  main.main()
      /home/sebastian/src/golang_crash.go:84 +0x2eb
==================
panic: runtime error: slice bounds out of range [recovered]
    panic: runtime error: slice bounds out of range

goroutine 22 [running]:
io/ioutil.readAll.func1(0xc82004bd78)
    /home/sebastian/go-tip/src/io/ioutil/ioutil.go:30 +0x17d
bufio.(*Reader).ReadSlice(0xc8202d6060, 0xc82010f40a, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go-tip/src/bufio/bufio.go:306 +0x5b3
net/http/internal.readChunkLine(0xc8202d6060, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go-tip/src/net/http/internal/chunked.go:110 +0x61
net/http/internal.(*chunkedReader).beginChunk(0xc8202fafc0)
    /home/sebastian/go-tip/src/net/http/internal/chunked.go:47 +0x5b
net/http/internal.(*chunkedReader).Read(0xc8202fafc0, 0xc8202a8600, 0x200, 0x200, 0x0, 0x0, 0x0)
    /home/sebastian/go-tip/src/net/http/internal/chunked.go:77 +0x11b
net/http.(*body).readLocked(0xc820075f80, 0xc8202a8600, 0x200, 0x200, 0xc820075fd0, 0x0, 0x0)
    /home/sebastian/go-tip/src/net/http/transfer.go:642 +0x114
net/http.(*body).Read(0xc820075f80, 0xc8202a8600, 0x200, 0x200, 0x0, 0x0, 0x0)
    /home/sebastian/go-tip/src/net/http/transfer.go:634 +0x158
net/http.(*bodyEOFSignal).Read(0xc820075fc0, 0xc8202a8600, 0x200, 0x200, 0x0, 0x0, 0x0)
    /home/sebastian/go-tip/src/net/http/transport.go:1480 +0x2e0
io.(*LimitedReader).Read(0xc82032ad80, 0xc8202a8600, 0x200, 0x200, 0x774360, 0x0, 0x0)
    /home/sebastian/go-tip/src/io/io.go:426 +0x15e
bytes.(*Buffer).ReadFrom(0xc82004bcd0, 0x7f4eaf2538c0, 0xc82032ad80, 0x0, 0x0, 0x0)
    /home/sebastian/go-tip/src/bytes/buffer.go:173 +0x415
io/ioutil.readAll(0x7f4eaf2538c0, 0xc82032ad80, 0x200, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go-tip/src/io/ioutil/ioutil.go:33 +0x1a3
io/ioutil.ReadAll(0x7f4eaf2538c0, 0xc82032ad80, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go-tip/src/io/ioutil/ioutil.go:42 +0x72
main.main.func1(0xc820072180, 0xc8200ec210, 0xc820076c70)
    /home/sebastian/src/golang_crash.go:75 +0x8bc
created by main.main
    /home/sebastian/src/golang_crash.go:84 +0x2ec

@bradfitz
Copy link
Contributor

@sebcat, can you try again with the latest code from master? I was never able to reproduce this myself but I wonder if one my recent commits might have fixed this.

The same output as before would be great.

Thanks!

@bradfitz
Copy link
Contributor

(In particular, I think https://golang.org/cl/17890 could've fixed this)

@sebcat
Copy link
Author

sebcat commented Dec 18, 2015

I am afraid that I am still able to reproduce. I'm looking into the possibility to set up a reproducible test environment. I tried reproducing it on a virtual instance at DO, but no luck (maybe related to difference in latency/different responses from server due to geoloc? purely speculation).

$ go version
go version devel +90a6893 Fri Dec 18 01:23:00 2015 +0000 linux/amd64
$ go build -race -o g golang_crash.go 
$ ./g
2015/12/18 13:00:43 RoundTrip [url] 200 OK HTTP/1.1
2015/12/18 13:00:43 RoundTrip [url] 204 Request format is unrecognized for URL unexpectedly ending in '/'. HTTP/1.1
==================
WARNING: DATA RACE
Read by goroutine 41:
  bufio.(*Reader).Peek()
      /home/sebastian/go-tip/src/bufio/bufio.go:131 +0x133
  net/http.(*persistConn).readLoop()
      /home/sebastian/go-tip/src/net/http/transport.go:988 +0x159

Previous write by goroutine 9:
  bufio.(*Reader).fill()
      /home/sebastian/go-tip/src/bufio/bufio.go:87 +0x189
  bufio.(*Reader).ReadSlice()
      /home/sebastian/go-tip/src/bufio/bufio.go:328 +0x5a8
  net/http/internal.readChunkLine()
      /home/sebastian/go-tip/src/net/http/internal/chunked.go:110 +0x60
  net/http/internal.(*chunkedReader).beginChunk()
      /home/sebastian/go-tip/src/net/http/internal/chunked.go:47 +0x5a
  net/http/internal.(*chunkedReader).Read()
      /home/sebastian/go-tip/src/net/http/internal/chunked.go:77 +0x11a
  net/http.(*body).readLocked()
      /home/sebastian/go-tip/src/net/http/transfer.go:650 +0x113
  net/http.(*body).Read()
      /home/sebastian/go-tip/src/net/http/transfer.go:642 +0x157
  io.(*LimitedReader).Read()
      /home/sebastian/go-tip/src/io/io.go:426 +0x15d
  bytes.(*Buffer).ReadFrom()
      /home/sebastian/go-tip/src/bytes/buffer.go:173 +0x414
  io/ioutil.readAll()
      /home/sebastian/go-tip/src/io/ioutil/ioutil.go:33 +0x1a2
  io/ioutil.ReadAll()
      /home/sebastian/go-tip/src/io/ioutil/ioutil.go:42 +0x71
  main.main.func1()
      /home/sebastian/src/golang_crash.go:75 +0x8bb

Goroutine 41 (running) created at:
  net/http.(*Transport).dialConn()
      /home/sebastian/go-tip/src/net/http/transport.go:781 +0x14c0
  net/http.(*Transport).getConn.func4()
      /home/sebastian/go-tip/src/net/http/transport.go:639 +0x73

Goroutine 9 (running) created at:
  main.main()
      /home/sebastian/src/golang_crash.go:84 +0x2eb
==================
==================
WARNING: DATA RACE
Read by goroutine 41:
  bufio.(*Reader).Peek()
      /home/sebastian/go-tip/src/bufio/bufio.go:131 +0x146
  net/http.(*persistConn).readLoop()
      /home/sebastian/go-tip/src/net/http/transport.go:988 +0x159

Previous write by goroutine 9:
  bufio.(*Reader).fill()
      /home/sebastian/go-tip/src/bufio/bufio.go:88 +0x1cf
  bufio.(*Reader).ReadSlice()
      /home/sebastian/go-tip/src/bufio/bufio.go:328 +0x5a8
  net/http/internal.readChunkLine()
      /home/sebastian/go-tip/src/net/http/internal/chunked.go:110 +0x60
  net/http/internal.(*chunkedReader).beginChunk()
      /home/sebastian/go-tip/src/net/http/internal/chunked.go:47 +0x5a
  net/http/internal.(*chunkedReader).Read()
      /home/sebastian/go-tip/src/net/http/internal/chunked.go:77 +0x11a
  net/http.(*body).readLocked()
      /home/sebastian/go-tip/src/net/http/transfer.go:650 +0x113
  net/http.(*body).Read()
      /home/sebastian/go-tip/src/net/http/transfer.go:642 +0x157
  io.(*LimitedReader).Read()
      /home/sebastian/go-tip/src/io/io.go:426 +0x15d
  bytes.(*Buffer).ReadFrom()
      /home/sebastian/go-tip/src/bytes/buffer.go:173 +0x414
  io/ioutil.readAll()
      /home/sebastian/go-tip/src/io/ioutil/ioutil.go:33 +0x1a2
  io/ioutil.ReadAll()
      /home/sebastian/go-tip/src/io/ioutil/ioutil.go:42 +0x71
  main.main.func1()
      /home/sebastian/src/golang_crash.go:75 +0x8bb

Goroutine 41 (running) created at:
  net/http.(*Transport).dialConn()
      /home/sebastian/go-tip/src/net/http/transport.go:781 +0x14c0
  net/http.(*Transport).getConn.func4()
      /home/sebastian/go-tip/src/net/http/transport.go:639 +0x73

Goroutine 9 (running) created at:
  main.main()
      /home/sebastian/src/golang_crash.go:84 +0x2eb
==================
2015/12/18 13:00:43 RoundTrip [url] 200 OK HTTP/1.1
2015/12/18 13:00:43 RoundTrip [url] 200 OK HTTP/1.1
2015/12/18 13:00:43 RoundTrip [url] 200 OK HTTP/1.1
2015/12/18 13:00:43 RoundTrip [url] 403 Forbidden HTTP/1.1
2015/12/18 13:00:43 RoundTrip [url] 200 OK HTTP/1.1
2015/12/18 13:00:43 RoundTrip [url] 403 Forbidden HTTP/1.1
2015/12/18 13:00:43 RoundTrip [url] 403 Forbidden HTTP/1.1
2015/12/18 13:00:43 RoundTrip [url] 403 Forbidden HTTP/1.1
2015/12/18 13:00:43 RoundTrip [url] 403 Forbidden HTTP/1.1
2015/12/18 13:00:43 RoundTrip [url] 404 Not Found HTTP/1.1
2015/12/18 13:00:43 ReadAll [url] invalid byte in chunk length
==================
WARNING: DATA RACE
Write by goroutine 41:
  runtime.slicecopy()
      /home/sebastian/go-tip/src/runtime/slice.go:113 +0x0
  crypto/tls.(*Conn).Read()
      /home/sebastian/go-tip/src/crypto/tls/conn.go:928 +0x39f
  net/http.noteEOFReader.Read()
      /home/sebastian/go-tip/src/net/http/transport.go:1573 +0x74
  net/http.(*noteEOFReader).Read()
      <autogenerated>:259 +0xf7
  bufio.(*Reader).fill()
      /home/sebastian/go-tip/src/bufio/bufio.go:97 +0x364
  bufio.(*Reader).Peek()
      /home/sebastian/go-tip/src/bufio/bufio.go:132 +0x186
  net/http.(*persistConn).readLoop()
      /home/sebastian/go-tip/src/net/http/transport.go:988 +0x159

Previous read by goroutine 9:
  net/http/internal.parseHexUint()
      /home/sebastian/go-tip/src/net/http/internal/chunked.go:223 +0xa0
  net/http/internal.(*chunkedReader).beginChunk()
      /home/sebastian/go-tip/src/net/http/internal/chunked.go:51 +0x12c
  net/http/internal.(*chunkedReader).Read()
      /home/sebastian/go-tip/src/net/http/internal/chunked.go:77 +0x11a
  net/http.(*body).readLocked()
      /home/sebastian/go-tip/src/net/http/transfer.go:650 +0x113
  net/http.(*body).Read()
      /home/sebastian/go-tip/src/net/http/transfer.go:642 +0x157
  io.(*LimitedReader).Read()
      /home/sebastian/go-tip/src/io/io.go:426 +0x15d
  bytes.(*Buffer).ReadFrom()
      /home/sebastian/go-tip/src/bytes/buffer.go:173 +0x414
  io/ioutil.readAll()
      /home/sebastian/go-tip/src/io/ioutil/ioutil.go:33 +0x1a2
  io/ioutil.ReadAll()
      /home/sebastian/go-tip/src/io/ioutil/ioutil.go:42 +0x71
  main.main.func1()
      /home/sebastian/src/golang_crash.go:75 +0x8bb

Goroutine 41 (running) created at:
  net/http.(*Transport).dialConn()
      /home/sebastian/go-tip/src/net/http/transport.go:781 +0x14c0
  net/http.(*Transport).getConn.func4()
      /home/sebastian/go-tip/src/net/http/transport.go:639 +0x73

Goroutine 9 (running) created at:
  main.main()
      /home/sebastian/src/golang_crash.go:84 +0x2eb
==================
==================
WARNING: DATA RACE
Write by goroutine 41:
  runtime.slicecopy()
      /home/sebastian/go-tip/src/runtime/slice.go:113 +0x0
  crypto/tls.(*Conn).Read()
      /home/sebastian/go-tip/src/crypto/tls/conn.go:928 +0x39f
  net/http.noteEOFReader.Read()
      /home/sebastian/go-tip/src/net/http/transport.go:1573 +0x74
  net/http.(*noteEOFReader).Read()
      <autogenerated>:259 +0xf7
  bufio.(*Reader).fill()
      /home/sebastian/go-tip/src/bufio/bufio.go:97 +0x364
  bufio.(*Reader).Peek()
      /home/sebastian/go-tip/src/bufio/bufio.go:132 +0x186
  net/http.(*persistConn).readLoop()
      /home/sebastian/go-tip/src/net/http/transport.go:988 +0x159

Previous read by goroutine 9:
  bufio.(*Reader).ReadSlice()
      /home/sebastian/go-tip/src/bufio/bufio.go:333 +0x281
  net/http/internal.readChunkLine()
      /home/sebastian/go-tip/src/net/http/internal/chunked.go:110 +0x60
  net/http/internal.(*chunkedReader).beginChunk()
      /home/sebastian/go-tip/src/net/http/internal/chunked.go:47 +0x5a
  net/http/internal.(*chunkedReader).Read()
      /home/sebastian/go-tip/src/net/http/internal/chunked.go:77 +0x11a
  net/http.(*body).readLocked()
      /home/sebastian/go-tip/src/net/http/transfer.go:650 +0x113
  net/http.(*body).Read()
      /home/sebastian/go-tip/src/net/http/transfer.go:642 +0x157
  io.(*LimitedReader).Read()
      /home/sebastian/go-tip/src/io/io.go:426 +0x15d
  bytes.(*Buffer).ReadFrom()
      /home/sebastian/go-tip/src/bytes/buffer.go:173 +0x414
  io/ioutil.readAll()
      /home/sebastian/go-tip/src/io/ioutil/ioutil.go:33 +0x1a2
  io/ioutil.ReadAll()
      /home/sebastian/go-tip/src/io/ioutil/ioutil.go:42 +0x71
  main.main.func1()
      /home/sebastian/src/golang_crash.go:75 +0x8bb

Goroutine 41 (running) created at:
  net/http.(*Transport).dialConn()
      /home/sebastian/go-tip/src/net/http/transport.go:781 +0x14c0
  net/http.(*Transport).getConn.func4()
      /home/sebastian/go-tip/src/net/http/transport.go:639 +0x73

Goroutine 9 (running) created at:
  main.main()
      /home/sebastian/src/golang_crash.go:84 +0x2eb
==================
panic: runtime error: slice bounds out of range

goroutine 55 [running]:
bufio.(*Reader).ReadSlice(0xc82011b200, 0x43cb0a, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go-tip/src/bufio/bufio.go:306 +0x5b3
bufio.(*Reader).ReadLine(0xc82011b200, 0x0, 0x0, 0x0, 0xa000000000f00, 0x0, 0x0)
    /home/sebastian/go-tip/src/bufio/bufio.go:357 +0x6d
net/textproto.(*Reader).readLineSlice(0xc820143d10, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go-tip/src/net/textproto/reader.go:55 +0xa3
net/textproto.(*Reader).ReadLine(0xc820143d10, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go-tip/src/net/textproto/reader.go:36 +0x4e
net/http.ReadResponse(0xc82011b200, 0xc8201057a0, 0xc820143ea8, 0x0, 0x0)
    /home/sebastian/go-tip/src/net/http/response.go:138 +0x183
net/http.(*persistConn).readResponse(0xc8201240c0, 0xc8201057a0, 0xc82027c7e0, 0x1, 0x0, 0x0, 0x0, 0x0)
    /home/sebastian/go-tip/src/net/http/transport.go:1132 +0x62
net/http.(*persistConn).readLoop(0xc8201240c0)
    /home/sebastian/go-tip/src/net/http/transport.go:1005 +0x3c0
created by net/http.(*Transport).dialConn
    /home/sebastian/go-tip/src/net/http/transport.go:781 +0x14c1

@bradfitz
Copy link
Contributor

Thanks for the update. The updated crash with new line numbers helps. I'll look again.

@bradfitz
Copy link
Contributor

bradfitz commented Jan 6, 2016

Sorry, I haven't forgotten about this. I'm just getting back to things after the holidays.

Can I trouble you to try once again from master? Some changes just went in which have a small but non-zero chance of fixing this.

If you can reproduce the race again (or not), please include the git version number in your reply.

Thanks!

@sebcat
Copy link
Author

sebcat commented Jan 6, 2016

I am no longer able to reproduce the problem. Building with -race and executing produces no output from the race detector and no panic occurs over multiple runs.

$ go version
go version devel +91f997b Wed Jan 6 06:08:34 2016 +0000 linux/amd64

Thank you!

@bradfitz
Copy link
Contributor

bradfitz commented Jan 6, 2016

Excellent. Thank you for your help testing.

For the record, I suspect the change which fixed it was git rev 7fa9846 (https://go-review.googlesource.com/18282) or less likely 7de71c8 (https://go-review.googlesource.com/18260)

@bradfitz bradfitz closed this as completed Jan 6, 2016
@golang golang locked and limited conversation to collaborators Jan 7, 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

5 participants