Crash reporting and C++ Coroutines?

Viewed 46

I use a crash reporting feature that allows the user to submit a crash report if the application crashed with an uncaught exception.

After adopting C++20 coroutines entered the application. If there is an unexpected exception thrown in a coroutine the exception is caught before it is rethrown. This causes crashreports to not show the stacktrace needed to figure out what happened, but only the stacktrace to the coroutine that rethrew the exception. This basically makes any crash reporting useless.

As far as I could find there is no way to prevent the catching of any exceptions by the coroutine because it is a required part of the design.

Is there a way to improve this I cant see? I am curious because I found nobody else complaining yet. :->

Edit: To clarify the app is running on Windows, I mean the stacktrace of a minidump that is created at the point of the unhandled exception using: SetUnhandledExceptionFilter + MiniDumpWriteDump

1 Answers

C++ does not have standard stack tracing yet, so there is no nice builtin way to do this.
However, there are ways, which rely on keeping information in the promise objects.
Clang has documentation for some common debugging methods for coroutines.

Related