-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime/cgo: new pthread crash _cgo_try_pthread_create #68850
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
Comments
For text, please use plain text, not images. Plain text is much easier to read. Thanks. |
If I understand the glibc bug correctly, it only occurs after some thread has exited. That is unusual in Go programs, in which threads typically never exit after they have been created. Can you confirm that in your program some threads exit? Thanks. |
Change https://go.dev/cl/605257 mentions this issue: |
Hello, excuse me, I'd like to ask, this question seems to exist in the lower version also, do you have a backport plan? |
@And-ZJ Although the change made sense by itself, I haven't seen any confirmation that it actually fixes a problem for anybody. Do you have a test case where this change makes a difference? |
When will the release package be released to fix this problem? @ianlancetaylor |
@xuyinghao The change will be in the 1.24 release, which is scheduled for February, 2025. We can probably backport the change to minor releases of 1.22 or 1.23, but as noted above we haven't seen a test case where it actually makes a difference. |
Go version
go version go1.20.4 linux/amd64
Output of
go env
in your module/workspace:What did you do?
cgo call
glibc version
What did you see happen?
process crash
What did you expect to see?
This is a known issue of glibc. I hope go can fix it.
https://sourceware.org/bugzilla/show_bug.cgi?id=19951#c0
Workaround:
Because the execution of sub-threads cannot be stopped, the recommended method is to set the thread status to detached (interface function pthread_attr_setdetachstate) when creating sub-threads. Do not use the pthread_detach interface in the main thread.
You can call pthread_detach(pthread_self()) at the beginning of a subthread to set the detached state in the subthread.
The text was updated successfully, but these errors were encountered: