From: Chaoqun Han Date: Thu, 25 Nov 2021 13:16:28 +0000 (+0800) Subject: runtime: add invalidptr=0 for TestGcZombieReporting X-Git-Tag: go1.18beta1~143 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5f63f168daa9644bcc723077e9e2e1796639f6bb;p=gostls13.git runtime: add invalidptr=0 for TestGcZombieReporting pointers in zombies slice may cross-span, add invalidptr=0 for avoiding the badPointer check Fixes #49613 Change-Id: Ifb1931922170e87e799e2e6081dc85dab3890205 Reviewed-on: https://go-review.googlesource.com/c/go/+/367044 Trust: Emmanuel Odeke Run-TryBot: Emmanuel Odeke TryBot-Result: Go Bot Reviewed-by: Bryan C. Mills Reviewed-by: Emmanuel Odeke --- diff --git a/src/runtime/gc_test.go b/src/runtime/gc_test.go index 7b979afd55..d81cb3a3d5 100644 --- a/src/runtime/gc_test.go +++ b/src/runtime/gc_test.go @@ -196,7 +196,10 @@ func TestPeriodicGC(t *testing.T) { func TestGcZombieReporting(t *testing.T) { // This test is somewhat sensitive to how the allocator works. - got := runTestProg(t, "testprog", "GCZombie") + // Pointers in zombies slice may cross-span, thus we + // add invalidptr=0 for avoiding the badPointer check. + // See issue https://golang.org/issues/49613/ + got := runTestProg(t, "testprog", "GCZombie", "GODEBUG=invalidptr=0") want := "found pointer to free object" if !strings.Contains(got, want) { t.Fatalf("expected %q in output, but got %q", want, got)