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

deadlock during deallocation of threads and fork #1872

Open
CedricCouton opened this issue Jun 8, 2023 · 0 comments
Open

deadlock during deallocation of threads and fork #1872

CedricCouton opened this issue Jun 8, 2023 · 0 comments

Comments

@CedricCouton
Copy link

Hi,

Since a long time we have seldomly a deadlock during the deallocation of threads and fork after perfoming a job. But it seems that since we add more threads in our job the case is more present.
What is our deadlock? Thanks to gdb we have the backtraces :

This one for all threads :

image

If we focus on the main thread we can see that it stuck during the free of a dynamic library of the fork :

image

And in the backtrace of a thread we can see that is locked during its deallocation of memory stack :

image

All threads wait the mutex that is kept by this function of the glibc/nptl : https://sourceware.org/git/?p=glibc.git;a=blob;f=nptl/allocatestack.c;h=110ba18f5dbdb3054ee0b9545a76757a3ae74568;hb=9ea3686266dca3f004ba874745a4087a89682617#l1214
And this function is stuck during the tentative to lock the mutex here https://sourceware.org/git/?p=glibc.git;a=blob;f=nptl/allocatestack.c;h=110ba18f5dbdb3054ee0b9545a76757a3ae74568;hb=9ea3686266dca3f004ba874745a4087a89682617#l1239

Last clue, when I do a x/3 on the memory pointer of the stuck mutex I have "2 0 0" as if the mutex is still considered as locked but no trace of pid

Either this gscope_flagp is already free and so the futex_wait_simple stuck or other stuff.

Is it something already seen?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant