tcnksm / go-httpstat

Tracing golang HTTP request latency
MIT License
421 stars 72 forks source link

eliminate race condition when writing to Results struct #22

Closed thundercat1 closed 4 years ago

thundercat1 commented 5 years ago

21

dewey commented 5 years ago

I tried this out and I think you still got a nil pointer in your fix:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x46eafd]

goroutine 1951 [running]:
sync.(*Mutex).Lock(0x0)
    /usr/local/go/src/sync/mutex.go:74 +0x2d
example.com/testproject/vendor/github.com/dewey/go-httpstat.withClientTrace.func5()
    /go/src/example.com/testproject/vendor/github.com/dewey/go-httpstat/go18.go:86 +0x36
net/http.(*persistConn).addTLS.func2(0xc420e1ac40, 0xc4200d1c00, 0xc420b75e50, 0xc42066b680)
    /usr/local/go/src/net/http/transport.go:1066 +0xa6
created by net/http.(*persistConn).addTLS
    /usr/local/go/src/net/http/transport.go:1064 +0x19f
thundercat1 commented 5 years ago

What usage creates this nil pointer? The test suite is running without error for me on the fork.