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

[BUG] llvm-libc++/thread could exhaust the process pthread_key_t #939

Closed
WheelsMaker opened this issue Mar 21, 2019 · 1 comment
Closed

Comments

@WheelsMaker
Copy link

When I use the dynamic link file with dlopen and dlclose, the process' pthread_key_t will be exhausted and the process will crash when call std::thread.
Because the destructor , in the file thread, is empty,__thread_specific_ptr<_Tp>::~__thread_specific_ptr.

In fact, the destructor is not necessary left to be empty, because there only one static __thread_specific_ptr<_Tp> object in the dynamic link file, which is defined in the function __thread_local_data(). When calling dlclose(),the static object will be released and the pthread_key_t should be released too.

@DanAlbert
Copy link
Member

#789

The best solution is to not call dlclose. It does more harm than good.

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

No branches or pull requests

2 participants