-
Notifications
You must be signed in to change notification settings - Fork 258
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]std::thread crash while using dlopen/dlclose set APP_STL := c++_static #936
Comments
we'll be able to look at this much faster if you (a) provide an actual reproduceable test case and (b) include the specific crash from logcat. |
FWIW you could almost certainly solve your problem by not calling dlclose. dlclose is almost never a good idea and causes lots of problems. |
You might also be interested in reading through #360, but since you say your test fails on P I'm guessing that isn't the issue. |
It is impossible by not calling dlclose or use RTLD_NODELETE, the daemon is as a server run at android HAL, it dlopen so on demand, there are hundreds of so. Please raise the priority, Thanks. |
(a) sorry, I am inconvenient to send code because of some restrictions, see the demo flow, (b) in demo command, info is "cannot create thread specific key for __cxa_get_globals() |
run this demo on android device with current O or P version,
if set APP_STL := c++_static, crash occurred when outside loop i = 128,
if set APP_STL := gnustl_static, there is no crash.
but after NDK r18, there is only c++_static. I have to use NDK R17 with gnustl_static
test demo and so, the flow is:
`demo:
main()
{
for(i=0; i<1000; i++)
{
dlopen so
for(int j=0; j<1; j++)
{
call process_func() in so
}
dlclose so
}
}
so:
process_func()
{
call std::thread and join
}`
The text was updated successfully, but these errors were encountered: