Descriptionruntime: fix GODEBUG processing
Right now it fails with:
$ GODEBUG="allocfreetrace=1,efence=1" `which go`
Segmentation fault: 11
It appears there's a bug in the initialization order of
global variables. dbgvars is initialized before debug,
even though dbgvars references fields of debug, like
debug.allocfreetrace. This caused dbgVar.value to always be 0,
and parsedebugvars to fail when trying to write to it.
Work around this problem by moving dbgvars and its initialization
inside parsedebugvars. This is ok because dbgvars is only used
inside parsedebugvars anyway.
Patch Set 1 #Patch Set 2 : diff -r cc53451c5af3c6f2b45b8889e072c81dfb494164 https://code.google.com/p/go #Patch Set 3 : diff -r cc53451c5af3c6f2b45b8889e072c81dfb494164 https://code.google.com/p/go #Patch Set 4 : diff -r cc53451c5af3c6f2b45b8889e072c81dfb494164 https://code.google.com/p/go #Patch Set 5 : diff -r cc53451c5af3c6f2b45b8889e072c81dfb494164 https://code.google.com/p/go #Patch Set 6 : diff -r cc53451c5af3c6f2b45b8889e072c81dfb494164 https://code.google.com/p/go #Patch Set 7 : diff -r cc53451c5af3c6f2b45b8889e072c81dfb494164 https://code.google.com/p/go #MessagesTotal messages: 4
|