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

Comments

Projects
None yet
3 participants
@Zyl9393
Copy link

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 this to the Unplanned milestone Nov 2, 2018

@gopherbot

This comment has been minimized.

Copy link

commented Nov 2, 2018

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

@gopherbot gopherbot closed this in f08352b Nov 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.