Posts

Post not yet marked as solved
0 Replies
2.9k Views
std::async() execute std::~thread() before calling std::shared_future<>::get() from calling thread. This causing the generation of std::terminate and crashing the application. Getting this issue on iOS version 10.*.Below is my code snippet:std::shared_future<> foo(int x){ std::shared_future<> f = std::async(std::launch::async, [this, x](){}); return f;}void caller(){ std::shared_future<> future = foo(10); std::future_status result = future.wait_for(std::chrono::milliseconds(30000ms)); if (result == std::future_status::ready) { result = future.get(); }}Dump stack:0 libsystem_kernel.dylib 0x000000018eeb2014 __pthread_kill + 81 libsystem_pthread.dylib 0x000000018ef7a450 pthread_kill + 1082 libsystem_c.dylib 0x000000018ee263e0 abort + 1363 libc++abi.dylib 0x000000018e8f12d4 abort_message + 1284 libc++abi.dylib 0x000000018e90ebc0 default_terminate_handler() + 445 ReactEmbeddedFramework 0x00000001014d7698 BITCrashUncaughtCXXTerminateHandler() (BITCrashCXXExceptionHandler.mm:188)6 libc++abi.dylib 0x000000018e90b66c std::__terminate(void (*)()) + 127 libc++abi.dylib 0x000000018e90b6e4 std::terminate() + 688 libc++.1.dylib 0x000000018e8e17e0 std::__1::thread::~thread() + 209 0x0000000101e3b540fooThis issue is occurring on iOS version 10.*.*. So Is it know issue with version 10+?
Posted Last updated
.