Skip to content
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

runtime: environment variable GODEBUG (possibly others) treated case sensitively on Windows. #28557

Closed
Zyl9393 opened this issue Nov 2, 2018 · 1 comment
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. OS-Windows
Milestone

Comments

@Zyl9393
Copy link

Zyl9393 commented Nov 2, 2018

What version of Go are you using (go version)?

1.11.1

What operating system and processor architecture are you using (go env)?

set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Zyl\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=D:\Projects\Code\Go
set GOPROXY=
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\Zyl\AppData\Local\Temp\go-build244566434=/tmp/go-build -gno-record-gcc-switches

What did you do?

  • Open a console window.
  • SET godebug=cgocheck=0
  • Run my program, wherein I check that os.GetEnv("GODEBUG") contains "cgocheck=0". (Currently mandatory to be able to use OpenGL bindings at all; see these issues: go-gl/gl#80, go-gl/glow#63)
  • Correctly, receive the string "cgocheck=0". (since environment variables are case-insensitive on Windows)

What did you expect to see?

My program executing normally.

What did you see instead?

panic: runtime error: cgo argument has Go pointer to Go pointer.
I am unable to predict this, since what os.GetEnv() correctly reports mismatches what Go sees internally.

What did you try to fix it?

Open a new console window, wherein I SET GODEBUG=cgocheck=0, followed by execution of my program, which resulted in the expected behaviour, despite Windows environment variables supposedly being case-insensitive.

@bradfitz bradfitz changed the title Environment variable GODEBUG (possibly others) treated case sensitively on Windows. runtime: environment variable GODEBUG (possibly others) treated case sensitively on Windows. Nov 2, 2018
@bradfitz bradfitz added OS-Windows NeedsFix The path to resolution is known, but the work has not been done. labels Nov 2, 2018
@bradfitz bradfitz added this to the Unplanned milestone Nov 2, 2018
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/147039 mentions this issue: runtime: look up runtime env variables case insensitively on Windows

@golang golang locked and limited conversation to collaborators Nov 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. OS-Windows
Projects
None yet
Development

No branches or pull requests

3 participants