Repository navigation
fix(grouping): Handle UE 5.8 ensure and ensureMsgf frames in Unreal Engine stack trace rules - #126685
Conversation
ensure and ensureMsgf frames in Unreal Engine stack trace rules
Can we add rules for those engine frames to mark them as such, and have them therefore marked as out of app? Not sure if any of the existing categories would be accurate or if we'd need a new category and a corresponding category -> non-in-app rule, but either way, seems like we'd want to preserve current in-app behavior here, no? |
|
The problem is that we can't really distinguish between engine frames and actual game code in Unreal. Packaged builds link the engine into the same binary as the game so package-based rules won't help here. Function names aren't a reliable signal either since engine code has no dedicated namespace and its classes follow the same naming conventions as game code so they will likely overlap. Therefore |
Ah, got it. That makes sense, thanks. |
This PR extends the default stack trace rules for Unreal Engine to cover ensure events that currently aren't matched by any of the existing rules, so the engine's internal ensure handling and SDK capture frames are not excluded from grouping and culprit selection.
Similar changes were introduced earlier in scope of:
New rules are only added to the current
all-platforms@2026-01-20config, older configs are left unchanged.Key changes
Unreal Engine has two ensure code paths which changed independently across engine versions. Below is the engine function each ensure variant goes through, verified with events for all four variants on every engine version available in Unreal SDK's CI (Linux 5.2-5.8, Windows 5.5-5.8, macOS 5.8):
ensure/ensureAlwaysensureMsgf/ensureAlwaysMsgfDispatchCheckVerify(existing rule)DispatchCheckVerify(existing rule)UE::Assert::Private::ExecCheckImplInternal(existing rule)UE::Assert::Private::EnsureFailed(new rule)UE::Assert::Private::CheckEnsureFailed(new rule)UE::Assert::Private::EnsureFailed(new rule)Ensures in UE 5.8 (
ensure,ensureAlways)Starting from UE 5.8 the
ensuremacro no longer goes throughUE::Assert::Private::ExecCheckImplInternal(the function is removed from the engine) and callsUE::Assert::Private::CheckEnsureFailedinstead, so the existing rule for UE 5.4 and newer doesn't match these events anymore.Suggested rule:
Example events (UE 5.8, macOS):
ensureensureAlwaysEnsures with messages in UE 5.4 and newer (
ensureMsgf,ensureAlwaysMsgf)Unlike
ensure, theensureMsgfmacro has been callingUE::Assert::Private::EnsureFailedsince UE 5.4, so these events were never matched by the existing rules.Suggested rule:
Example events (UE 5.8, macOS):
ensureMsgfensureAlwaysMsgfNote that
ensureMsgfcallsUE::Assert::Private::EnsureFailedfrom a compiler-generated lambda named after the enclosing function (e.g.MyFunction::lambda::operator()), which becomes the culprit. The enclosing function frame itself is often not present in the stacktrace, so this lambda is intentionally kept in-app.Impact
Grouping of the following events will change, and existing issues are expected to be regrouped:
ensure/ensureAlwaysevents from UE 5.8ensureMsgf/ensureAlwaysMsgfevents from UE 5.4 and newerThis applies to all native platforms:
package:**.app/Contents/**,package:/Users/**and app bundle container rules, so the culprit for these events points to the SDK's stack unwinding function (e.g.sentry__unwind_stack_libunwind_mac) instead of the code that triggered the ensure. With the new rules, the engine's ensure handling and SDK capture frames are marked as non-app.v+app), the same way as forensureevents from UE 5.4-5.7 today.Custom rules still take precedence over the defaults. However, projects that rely on frames being non-app by default and only mark their own code as in-app will now also see engine frames (e.g.
FEngineLoop::Init,GuardedMain) marked as in-app for these events.