You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue arises after upgrading libstdc++ from version 10.3 to 10.5.
In version 10.5, a new check was introduced:
if (!__gthread_active_p())
{
throw system_error(make_error_code(errc::operation_not_permitted),
"Enable multithreading to use std::thread");
}
If libstdc++ is loaded before libpthread, this check fails and triggers the error.
3. glmark2 uses libstdc++ but does not directly link against pthread, which leads to the issue.
4. In glibc 2.34, new functionality eliminates the need to explicitly link against -lpthread, which avoids this problem. However, Ubuntu 20.04 uses glibc 2.31, where this issue still exists.
Steps to reproduce the behavior
Running program not link pthread But so need pthread on Ubuntu 20.04 results in the following error:
terminate called after throwing an instance of 'std::system_error'
what(): Enable multithreading to use std::thread: Operation not permitted
Aborted
Expected behavior
The program does not need pthread, but the dynamic library needs pthread and it can still work. Alternatively, update the glibc version in Ubuntu 20.04 to 2.34 or later.
The text was updated successfully, but these errors were encountered:
WikiLiu
changed the title
pthread error caused by libstdc++ 10.5 on Ubuntu 20.04 (glibc <2.34) <wide error ! when app don`t reply pthread but shared lib reply pthread)
pthread error caused by libstdc++ 10.5 on Ubuntu 20.04 (glibc <2.34) <wide error ! when app don`t reply pthread but shared lib reply pthread>
Dec 24, 2024
Summary
If libstdc++ is loaded before libpthread, this check fails and triggers the error.
3. glmark2 uses libstdc++ but does not directly link against pthread, which leads to the issue.
4. In glibc 2.34, new functionality eliminates the need to explicitly link against -lpthread, which avoids this problem. However, Ubuntu 20.04 uses glibc 2.31, where this issue still exists.
Steps to reproduce the behavior
Running program not link pthread But so need pthread on Ubuntu 20.04 results in the following error:
Expected behavior
The program does not need pthread, but the dynamic library needs pthread and it can still work.
Alternatively, update the glibc version in Ubuntu 20.04 to 2.34 or later.
Browser/device details
x86-64-pc
Reported from
https://ubuntu.com/blog/tag/20-04-lts
The text was updated successfully, but these errors were encountered: