Skip to content

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

Closed
@Zyl9393

Description

@Zyl9393

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.OS-Windows

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions