Skip to content

runtime: failed initialization of GODEBUG vars #9217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cookieo9 opened this issue Dec 7, 2014 · 7 comments
Closed

runtime: failed initialization of GODEBUG vars #9217

cookieo9 opened this issue Dec 7, 2014 · 7 comments
Milestone

Comments

@cookieo9
Copy link
Contributor

cookieo9 commented Dec 7, 2014

At tip on windows/amd64, setting GODEBUG options causes the following panic:

> set GODEBUG=gctrace=1
> go version
[signal 0xc0000005 code=0x1 addr=0x0 pc=0x49a7df]

runtime stack:
runtime.gothrow(0x921f50, 0x2a)
        C:/go-tip/src/runtime/panic.go:507 +0x98 fp=0x7fdc0 sp=0x7fda8
runtime.sigpanic()
        C:/go-tip/src/runtime/os_windows.go:16 +0x65 fp=0x7fde8 sp=0x7fdc0
runtime.parsedebugvars()
        C:/go-tip/src/runtime/runtime1.go:334 +0x2bf fp=0x7fee8 sp=0x7fde8
runtime.schedinit()
        C:/go-tip/src/runtime/proc1.go:124 +0x71 fp=0x7ff30 sp=0x7fee8
runtime.rt0_go(0x7ff60, 0x7fffb61c16ad, 0x7ff60, 0x0, 0x7fffb61c16ad, 0x0, 0x0, 0x0,
0x0, 0x0, ...)
        C:/go-tip/src/runtime/asm_amd64.s:96 +0x124 fp=0x7ff38 sp=0x7ff30

When the GODEBUG variable is cleared:
> set GODEBUG=
> go version
go version devel +2d1ab17a670a Fri Dec 05 21:33:07 2014 -0500 windows/amd64

I have tried several different values for GODEBUG:
 - GODEBUG=gctrace=0 (PANIC)
 - GODEBUG=allocfreetrace=1 (PANIC)
 - GODEBUG=allocfreetrace=1,gctrace=1 (PANIC)
 - GODEBUG=x=2 (NO PANIC)
 - GODEBUG=gctrace=1,x=2 (PANIC)

It looks like it only happens when valid debug vars are present in GODEBUG.

The issue is also present in windows/386. I have not tested elsewhere.
@minux
Copy link
Member

minux commented Dec 7, 2014

Comment 1:

known problem for 1.5, but still investigating the proper fix.
see https://golang.org/cl/172510043/

@dvyukov
Copy link
Member

dvyukov commented Dec 11, 2014

Can we have a stop gap fix soon please? And a test in all.bash. It broke perf dashboard at the most interesting moment:
http://build.golang.org/perf

@minux
Copy link
Member

minux commented Dec 11, 2014

initial investigation showed that gc is unable to statically initialize
a pointer into a struct variable, but it can statically initialize a pointer
into a variable of primitive types.

@dvyukov
Copy link
Member

dvyukov commented Dec 11, 2014

Can we move that particular var definition into the function with a TODO to fix bots and the functionality, and then continue investigation on the proper fix?

@minux
Copy link
Member

minux commented Dec 16, 2014

see #9355 for the underlying bug and one proposed solution.

@randall77
Copy link
Contributor

This bug will be fixed in tip by fixing #9355. For 1.4.1, however, we should do the simpler fix like https://codereview.appspot.com/172510043/ . It is a much safer fix.

@randall77 randall77 modified the milestones: Go1.4.1, Go1.5 Dec 17, 2014
@minux
Copy link
Member

minux commented Dec 17, 2014

Fortunately, this bug doesn't affect Go 1.4 because it's due to the
C->Go translation done in the dev.cc branch.

@bradfitz bradfitz removed the new label Dec 18, 2014
@randall77 randall77 modified the milestones: Go1.5, Go1.4.1 Dec 18, 2014
OlingCat referenced this issue in Go-zh/go.old Dec 19, 2014
When we do y = &x for global variables x and y, y gets initialized
at link time.  Do the same for y = &x.f if x is a struct and y=&x[5]
if x is an array.

fixes #9217
fixes #9355

Change-Id: Iea3c0ce2ce1b309e2b760e345608fd95460b5713
Reviewed-on: https://go-review.googlesource.com/1691
Reviewed-by: Minux Ma <minux@golang.org>
@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants