Commit d3ffc975 authored by Russ Cox's avatar Russ Cox Committed by Andrew Gerrand

runtime: set invalidptr=1 by default, as documented

Also make invalidptr control the recently added GC pointer check,
as documented.

Change-Id: Iccfdf49480219d12be8b33b8f03d8312d8ceabed
Reviewed-on: https://go-review.googlesource.com/12857
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: default avatarRob Pike <r@golang.org>
parent e4bd8e04
......@@ -201,7 +201,7 @@ func heapBitsForObject(p uintptr) (base uintptr, hbits heapBits, s *mspan) {
// 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))
......
......@@ -299,8 +299,6 @@ type dbgVar struct {
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 @@ var dbgvars = []dbgVar{
}
func parsedebugvars() {
// defaults
debug.invalidptr = 1
for p := gogetenv("GODEBUG"); p != ""; {
field := ""
i := index(p, ",")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment