arriven / db1000n

MIT License
1.17k stars 201 forks source link

SIGSEGV incoming #537

Closed deputinizer closed 2 years ago

deputinizer commented 2 years ago

This will cause memory issues. Nil pointer dereference probably

req := fasthttp.AcquireRequest()
fasthttp.ReleaseRequest(req)
// using req later

https://github.com/Arriven/db1000n/blob/12b3db0d757d3bdcb83ff3b893555c6db6870a98/src/job/http.go#L149

arriven commented 2 years ago

ah, right. It doesn't cause SIGSEGV as it just returns the request to the pool, but it probably reuses it between different goroutines making a mess anyway

deputinizer commented 2 years ago

It caused SIGSEGV in stoppropaganda :rofl:

arriven commented 2 years ago

hmm, I've quickly run through the source of that pool and I'm not sure I see anything that could lead to a crash except race detection. Anyway that's not a good code and I fixed it already