IssueRaiser

os: Setenv leads to SIGSEGV with GODEBUG=netdns=cgo, and other uses of cgo

<!-- Please answer these questions before submitting your issue. Thanks! --> ### What version of Go are you using (`go version`)? <pre> $ go version go version go1.21.3 linux/amd64 </pre> ### Does this issue reproduce with the latest release? Yes. ### What operating system and processor architecture are you using (`go env`)? Linux: Reproduced with Ubuntu 20.04.6, Debian 12. <details><summary><code>go env</code> Output</summary><br><pre> $ go env GO111MODULE='' GOARCH='amd64' GOBIN='' GOCACHE='/home/ej/.cache/go-build' GOENV='/home/ej/.config/go/env' GOEXE='' GOEXPERIMENT='' GOFLAGS='' GOHOSTARCH='amd64' GOHOSTOS='linux' GOINSECURE='' GOMODCACHE='/home/ej/go/pkg/mod' GONOPROXY='' GONOSUMDB='' GOOS='linux' GOPATH='/home/ej/go' GOPRIVATE='' GOPROXY='' GOROOT='/home/ej/go' GOSUMDB='sum.golang.org' GOTMPDIR='' GOTOOLCHAIN='auto' GOTOOLDIR='/home/ej/go/pkg/tool/linux_amd64' GOVCS='' GOVERSION='go1.21.3' GCCGO='gccgo' GOAMD64='v1' AR='ar' CC='gcc' CXX='g++' CGO_ENABLED='1' GOMOD='/dev/null' GOWORK='' CGO_CFLAGS='-O2 -g' CGO_CPPFLAGS='' CGO_CXXFLAGS='-O2 -g' CGO_FFLAGS='-O2 -g' CGO_LDFLAGS='-O2 -g' PKG_CONFIG='pkg-config' GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1987860609=/tmp/go-build -gno-record-gcc-switches' </pre></details> ### What did you do? A program that uses the `netdns=cgo` resolver with glibc and calls `os.Setenv` in other goroutines can crash with `SIGSEGV`. The problem is that `getaddrinfo` in glib

Posted by evanj on Oct 16, 2023, 2:32 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.2,000 issues0 comments

reliability (Marketing)

os: Setenv leads to SIGSEGV with GODEBUG=netdns=cgo, and other uses of cgo

evanjOct 16, 2023, 2:32 PM

<!-- Please answer these questions before submitting your issue. Thanks! --> ### What version of Go are you using (`go version`)? <pre> $ go version go version go1.21.3 linux/amd64 </pre> ### Does this issue reproduce with the latest release? Yes. ### What operating system and processor architecture are you using (`go env`)? Linux: Reproduced with Ubuntu 20.04.6, Debian 12. <details><summary><code>go env</code> Output</summary><br><pre> $ go env GO111MODULE='' GOARCH='amd64' GOBIN='' GOCACHE='/home/ej/.cache/go-build' GOENV='/home/ej/.config/go/env' GOEXE='' GOEXPERIMENT='' GOFLAGS='' GOHOSTARCH='amd64' GOHOSTOS='linux' GOINSECURE='' GOMODCACHE='/home/ej/go/pkg/mod' GONOPROXY='' GONOSUMDB='' GOOS='linux' GOPATH='/home/ej/go' GOPRIVATE='' GOPROXY='' GOROOT='/home/ej/go' GOSUMDB='sum.golang.org' GOTMPDIR='' GOTOOLCHAIN='auto' GOTOOLDIR='/home/ej/go/pkg/tool/linux_amd64' GOVCS='' GOVERSION='go1.21.3' GCCGO='gccgo' GOAMD64='v1' AR='ar' CC='gcc' CXX='g++' CGO_ENABLED='1' GOMOD='/dev/null' GOWORK='' CGO_CFLAGS='-O2 -g' CGO_CPPFLAGS='' CGO_CXXFLAGS='-O2 -g' CGO_FFLAGS='-O2 -g' CGO_LDFLAGS='-O2 -g' PKG_CONFIG='pkg-config' GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1987860609=/tmp/go-build -gno-record-gcc-switches' </pre></details> ### What did you do? A program that uses the `netdns=cgo` resolver with glibc and calls `os.Setenv` in other goroutines can crash with `SIGSEGV`. The problem is that `getaddrinfo` in glib

Comments (0)

No comments yet. Start the discussion.

Comment on this issue