Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPU crashes not captured by Sentry plugin #673

Open
riot-pmaconi opened this issue Oct 31, 2024 · 6 comments
Open

GPU crashes not captured by Sentry plugin #673

riot-pmaconi opened this issue Oct 31, 2024 · 6 comments

Comments

@riot-pmaconi
Copy link

Environment

How do you use Sentry?
Sentry SaaS

Which version of the SDK?

0.18.0

How did you install the package? (Git-URL, Assetstore)

Git

Which version of Unreal?

5.4.4

Is this happening in Unreal (editor) or on a player like Android, iOS, Windows?

Windows client

Steps to Reproduce

  1. See a GPU crash that hits ReportGPUCrash (WindowsPlatformCrashContext.cpp:1852) - my case was launching a ton of clients simultaneously, but it could be specific to my project.

Expected Result

The Sentry plugin processes the crash and forwards it to Sentry

Actual Result

The Unreal Crash Reporter processes the crash

Any logs or screenshots

@tustanivsky
Copy link
Collaborator

@riot-pmaconi Thank you for bringing this up - we'll check it on our end and get back to you.

Also, this could be related to #381.

@tustanivsky
Copy link
Collaborator

This can be reproduced with a debug command: gpudebugcrash [hang|pagefault|platformbreak [compute]]

@tustanivsky
Copy link
Collaborator

@riot-pmaconi After investigating this further it appears that the problem may be related to inconsistencies in how the engine handles GPU and non-GPU crashes.

Starting with UE 5.2 it’s possible to disable the default Windows SEH-based crash handling mechanism (https://github.com/EpicGames/UnrealEngine/pull/7976, https://github.com/EpicGames/UnrealEngine/pull/9931) and rely solely on Sentry's crashpad integration. By default, we’re calling FPlatformMisc::SetCrashHandlingType(ECrashHandlingType::Disabled) during the plugin initialization as it's expected that Unreal will select a proper crash handler (Crash Reporter or third-party like ours) based on a provided type value.

However there’s no corresponding check in ReportGPUCrash so the Crash Reporter always has a priority and takes things over. With the following change here I’ve managed to capture GPU crash with the native integration:

__except (FPlatformMisc::GetCrashHandlingType() == ECrashHandlingType::Default ? ReportCrash(GetExceptionInformation()) : EXCEPTION_CONTINUE_SEARCH)
{
	FPlatformMisc::RequestExit(false, TEXT("WindowsPlatformCrashContext.ReportGPUCrash"));
}

Can you try this out on your end and confirm whether it fixes the issue?

@riot-pmaconi
Copy link
Author

Thanks for tracking that down. I'll take a look and get back to you.

Are you planning on submitting a PR to Epic to integrate that change directly?

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Dec 3, 2024
@bitsandfoxes
Copy link
Contributor

If it proves to work out, it might be worth fixing that upstream.

@tustanivsky
Copy link
Collaborator

The GPU crash capturing issue should be addressed with this PR - https://github.com/EpicGames/UnrealEngine/pull/12648

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Status: No status
Development

No branches or pull requests

3 participants