microsoft / microsoft/microsoft-ui-xaml

Missing documentation on OnFailureEncountered crash debugging

Open
#10,168 0 comments 0 reactions 0 assignees View on GitHub
area-ErrorHandling needs-triage
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

In the WinUI community call March 6, 2024 @Scottj1s presented "Crash debugging in 1.5".
https://www.youtube.com/live/uFgGhNGlPm4?t=1035

It showed how to debug nasty crashes within WinUI/WASDK where the exception raised contains no helpful error code and no call stack. Unfortunately, within the video the screen sharing didn't properly work, so we were partially unable to see which steps were taken.

In https://github.com/microsoft/microsoft-ui-xaml/discussions/9361#discussioncomment-9288079 I have asked whether the steps could be documented in a blog post/docs page. While it was promised, unfortunately it didn't happen yet.

Therefore I would like to request the steps to be documented, so ~~Google~~ Bing (and AI models 😊) can index this information more easily.

---

In the meantime, I will document the steps here as well:

1. Ensure Microsoft public symbols server is enabled in Visual Studio Options -> Debugging -> Symbols
2. Ensure Source Link & Source Server is enabled in Visual Studio Options -> Debugging -> General (not mentioned in the video!)
3. Enable native debugging in project debug properties
4. Debug the project
5. Go to the "Breakpoints" tab in the lower Visual Studio pane
6. Add "New Function Breakpoint"
7. Enter "Microsoft.ui.xaml.dll!OnFailureEncountered" and select C++
8. Click OK
9. Restart debugging, and now your debugger will break early in C++ code which allows you to inspect the call stack and find the line of code that threw the error

![Image](https://github.com/user-attachments/assets/48f4856f-1bdb-434b-806b-0b384473c148)

![Image](https://github.com/user-attachments/assets/5c7b3ebf-f985-4c37-ba97-043a37429d4b)

Contributor guide

Open the contributing guide

Research direction

Start with the issue's numbered Visual Studio procedure, the linked crash-debugging recording, and the Microsoft.ui.xaml.dll!OnFailureEncountered entry point. Identify the appropriate documentation location, then publish the debugging steps so readers can follow them to inspect the call stack and find the throwing line.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.