sasha-s / go-deadlock

Online deadlock detection in go (golang)
Apache License 2.0
1.03k stars 76 forks source link

Bug in 1595213edefa28ca5047b00340c63557f9c051d0 #19

Closed tsachiherman closed 3 years ago

tsachiherman commented 4 years ago

In the above change, you introduce a bug :

Instead of getting the callers for the goroutine which was calling the lock, you exchanged that with the monitoring goroutine. i.e. this is wrong :

fmt.Fprintf(Opts.LogBuf, "goroutine %v lock %p\n", goid.Get(), ptr)
printStack(Opts.LogBuf, callers(2))
sasha-s commented 3 years ago

https://github.com/sasha-s/go-deadlock/commit/00ee193ea4a32e0dea6c837f4fa6416c12242cc8