src/runtime/mbitmap.go | 2 +- src/runtime/runtime1.go | 5 +++-- diff --git a/src/runtime/mbitmap.go b/src/runtime/mbitmap.go index b9b52a7bc416f8974a465534a9b9fa2579d0033c..c439158f078080f50d43685838cd24e6df01677d 100644 --- a/src/runtime/mbitmap.go +++ b/src/runtime/mbitmap.go @@ -201,7 +201,7 @@ // The following ensures that we are rigorous about what data // structures hold valid pointers. // TODO(rsc): Check if this still happens. - if true { + if debug.invalidptr != 0 { // Still happens sometimes. We don't know why. printlock() print("runtime:objectstart Span weird: p=", hex(p), " k=", hex(k)) diff --git a/src/runtime/runtime1.go b/src/runtime/runtime1.go index db269957033dc46d491f3fe54ca3cf192477b3dd..a50e5b618cfae4c7c19963e9eba3ed3af47e76d7 100644 --- a/src/runtime/runtime1.go +++ b/src/runtime/runtime1.go @@ -299,8 +299,6 @@ name string value *int32 } -// TODO(rsc): Make GC respect debug.invalidptr. - // Holds variables parsed from GODEBUG env var, // except for "memprofilerate" since there is an // existing int var for that value, which may @@ -340,6 +338,9 @@ {"wbshadow", &debug.wbshadow}, } func parsedebugvars() { + // defaults + debug.invalidptr = 1 + for p := gogetenv("GODEBUG"); p != ""; { field := "" i := index(p, ",")