Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/goPublic

Commitfcfb7aa

Browse files
committed
[release-branch.go1.3] runtime: fix GOTRACEBACK reading on Windows, Plan 9
Only Unix was resetting the traceback_cache variableafter initializing the environment. Reset it on all systemsby resetting in parsedebugvars.Fixes#8813.LGTM=adg, alex.brainmanR=golang-codereviews, adg, alex.brainmanCC=golang-codereviews, iant, rhttps://golang.org/cl/152760043
1 parentca70c91 commitfcfb7aa

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

‎src/pkg/runtime/runtime.c‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ runtime·goenvs_unix(void)
138138
syscall·envs.array= (byte*)s;
139139
syscall·envs.len=n;
140140
syscall·envs.cap=n;
141-
142-
traceback_cache= ~(uint32)0;
143141
}
144142

145143
int32
@@ -343,6 +341,16 @@ runtime·parsedebugvars(void)
343341
{
344342
byte*p;
345343
intgoi,n;
344+
booltmp;
345+
346+
// gotraceback caches the GOTRACEBACK setting in traceback_cache.
347+
// gotraceback can be called before the environment is available.
348+
// traceback_cache must be reset after the environment is made
349+
// available, in order for the environment variable to take effect.
350+
// The code is fixed differently in Go 1.4.
351+
// This is a limited fix for Go 1.3.3.
352+
traceback_cache= ~(uint32)0;
353+
runtime·gotraceback(&tmp);
346354

347355
p=runtime·getenv("GODEBUG");
348356
if(p==nil)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp