Skip to content

Commit 2950bb0

Browse files
linsitepull[bot]
authored andcommitted
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. Change-Id: I1597fa09fde641882e8e87453470941747705272 GitHub-Last-Rev: 9f136f5 GitHub-Pull-Request: #70331 Reviewed-on: https://go-review.googlesource.com/c/go/+/627816 LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Michael Pratt <[email protected]> Reviewed-by: Cherry Mui <[email protected]> Reviewed-by: Jorropo <[email protected]> Reviewed-by: Michael Pratt <[email protected]>
1 parent bad54d1 commit 2950bb0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/runtime/mgcsweep.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ func (sl *sweepLocked) sweep(preserve bool) bool {
855855
// pointer to that object and marked it.
856856
func (s *mspan) reportZombies() {
857857
printlock()
858-
print("runtime: marked free object in span ", s, ", elemsize=", s.elemsize, " freeindex=", s.freeindex, " (bad use of unsafe.Pointer? try -d=checkptr)\n")
858+
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")
859859
mbits := s.markBitsForBase()
860860
abits := s.allocBitsForIndex(0)
861861
for i := uintptr(0); i < uintptr(s.nelems); i++ {

0 commit comments

Comments
 (0)