https://bugs.winehq.org/show_bug.cgi?id=53664
Bug ID: 53664 Summary: Exceptions in std::async not handled properly Product: Wine Version: 7.17 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: tteu.ingog@gmail.com Distribution: ---
Created attachment 73070 --> https://bugs.winehq.org/attachment.cgi?id=73070 The source code for a minimal example
Found this bug while investigating crashes of NTKDaemon.exe on launch, which is required in Native Access 2.4.0.
When a C++ exception is thrown inside a callable passed in std::async with std::launch::async policy, the unhandled exception is rethrown in the main thread when getting the value of the std::future returned by std::async.
When executing a program compiled in Visual Studio 2022, However, it didn't work as expected. The program will either execute as if the thread exited normally at the point of `throw`, or somehow crash without forwarding the exception to the caller thread of std::async(especially when winegdb is attached).
I'm not sure if it's related, but it seems like std::current_exception is also not working as expected.