criteo / haproxy-spoe-go

An implementation of the SPOP protocol in Go. https://www.haproxy.org/download/2.0/doc/SPOE.txt
Apache License 2.0
28 stars 14 forks source link

Remove lib go-buffer-pool #14

Closed cpaillet closed 3 years ago

cpaillet commented 3 years ago

We have a crash with the following stacktrace


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

goroutine 222 [running]: sync.(WaitGroup).state(...) /usr/local/go/src/sync/waitgroup.go:33 sync.(WaitGroup).Add(0x0, 0xffffffffffffffff) /usr/local/go/src/sync/waitgroup.go:54 +0x26 sync.(WaitGroup).Done(...) /usr/local/go/src/sync/waitgroup.go:99 github.com/criteo/haproxy-spoe-go.(conn).run.func3(0xc0005d63f0, 0xc0003d60c0) /home/c.paillet/git/haproxy-spoe-go/conn.go:119 +0x194 github.com/criteo/haproxy-spoe-go.(conn).run(0xc0004b4050, 0xc0003d60c0, 0xefd0a0, 0xc000550590) /home/c.paillet/git/haproxy-spoe-go/conn.go:166 +0xeea github.com/criteo/haproxy-spoe-go.(Agent).Serve.func1(0xf17d20, 0xc00038c060, 0xc0003d60c0) /home/c.paillet/git/haproxy-spoe-go/spoe.go:100 +0xcc created by github.com/criteo/haproxy-spoe-go.(*Agent).Serve /home/c.paillet/git/haproxy-spoe-go/spoe.go:93 +0x167


The problem seems in the lib go-buffer-pool. ReadFull in frame.go:187 modify others variable (include acksKey), and create a crash when we try to modify a.acksWG[acksKey] ( conn.go:104 )