-
-
Notifications
You must be signed in to change notification settings - Fork 200
Closed
Description
Crashes in WinUI are not caught by Crashpad/Breakpad
When does the problem happen
- During build
- During run-time
- When capturing a hard crash
Environment
- OS: Windows 11
- Compiler: MSVC 2022
- CMake version and config: https://github.com/microsoft/vcpkg/tree/master/ports/sentry-native 0.4.12 with Crashpad/Breakpad
Steps To Reproduce
- Create a WinUI 3 C++ packaged app project based on the template provided by Windows App SDK
- Initialize sentry in App::OnLaunched and use a custom logger to view output
void custom_sentry_logger(sentry_level_t level, const char* message, va_list args, void* userdata)
{
// TODO: generate formatted string
OutputDebugStringA(message);
}
sentry_options_t* options = sentry_options_new();
sentry_options_set_dsn(options, "xxx");
auto installedLocation = Windows::ApplicationModel::Package::Current().InstalledLocation();
sentry_options_set_handler_path(options, to_string(installedLocation.Path() + L"\\crashpad_handler.exe").c_str());
auto localFolder = Windows::Storage::ApplicationData::Current().LocalFolder();
auto path = localFolder.Path();
sentry_options_set_database_path(options, to_string(localFolder.Path()).c_str());
sentry_options_set_logger(options, custom_sentry_logger, nullptr);
sentry_options_set_debug(options, 1);
sentry_init(options);
- Crash the app in MainWindow::myButton_Click
volatile char* invalid_memory = nullptr;
*invalid_memory = '\0'; // crash
- Build the app in Release/x64, ensure sentry DLLs and crashpad_handler.exe are copied
- Run the app without a debugger, and see the log from DebugView
- Click the "Click Me" button which calls the code that will crash
- App crashes and crashpad_handler did not catch it (based on what is shown in DebugView)
Log output
Metadata
Metadata
Assignees
Labels
No labels
Projects
Status
Done
