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: crash in glibc in new thread #58422
Comments
Can you show us a complete standalone test case that demonstrates the problem? Thanks. |
Uploaded test project here: https://github.com/yangboyd/golangcrashtest Envrionment: [/]#cat /etc/redhat-release |
Is there a way to recreate this problem without using a modified version of the Go libraries? |
It's the go net library, does it affect the thread initialization related function? |
I'm more concerned about the fact that you are using the Tailscale Go distribution rather than the standard one. And while I don't know why the Go net package would affect initializing threads, I also don't know why the problem would only be observed if you change the net package. Is it impossible to recreate the problem with ordinary Go code that does not modify the net package? Because if you have to modify the net package to see this problem, then it's not a bug that can affect ordinary Go users and I'm only mildly interested in what is causing it. |
It seems the ctype is initialized only in the dynamic library .so file firstly loaed by dlopen in the first thread. In the later threads, the dlopen is not called again, so the ctype is not reinitialized. Then in later threads, it crashed. |
That sounds like a glibc bug, not a Go bug. What version of glibc are you using? |
[]# gcc -v []# rpm -qa |grep glibc |
What version of Go are you using (
go version
)?go version go1.19.5 linux/amd64
Does this issue reproduce with the latest release?
maybe
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
go called c library via cgo
c library code calls function isspace
isspace used memory which is initialized in __ctype_init , that is lost after clone.
similar to #29689
But this bug occurs after thread clone.
What did you expect to see?
No crash.
What did you see instead?
Crash.
It seems the ctype initialized in golang/cgo is different than the ctype in c library, the later is not initialized.
Or the c library initialized ctype in previous thread is gabbage collected .
The text was updated successfully, but these errors were encountered: