mirror of https://github.com/golang/go.git
runtime: add race detector tips to reportZombies func
We can find a few issues finally turned out to be a race condition, such as #47513. I believe such a tip can eliminate the need for developers to file this kind of issue in the first place.
This commit is contained in:
parent
2eac154b1c
commit
9f136f5b3b
|
|
@ -855,7 +855,7 @@ func (sl *sweepLocked) sweep(preserve bool) bool {
|
|||
// pointer to that object and marked it.
|
||||
func (s *mspan) reportZombies() {
|
||||
printlock()
|
||||
print("runtime: marked free object in span ", s, ", elemsize=", s.elemsize, " freeindex=", s.freeindex, " (bad use of unsafe.Pointer? try -d=checkptr)\n")
|
||||
print("runtime: marked free object in span ", s, ", elemsize=", s.elemsize, " freeindex=", s.freeindex, " (bad use of unsafe.Pointer or having race conditions? try -d=checkptr or -race)\n")
|
||||
mbits := s.markBitsForBase()
|
||||
abits := s.allocBitsForIndex(0)
|
||||
for i := uintptr(0); i < uintptr(s.nelems); i++ {
|
||||
|
|
|
|||
Loading…
Reference in New Issue