Skip to content

ref(grouping): Add Unity IL2CPP grouping inputs - #124621

Merged
lobsterkatie merged 2 commits into
masterfrom
kmclb-add-unity-grouping-inputs
Sep 25, 2026
Merged

lobsterkatie merged 2 commits into
masterfrom
kmclb-add-unity-grouping-inputs

Conversation

@lobsterkatie

@lobsterkatie lobsterkatie commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

The Goal

Add grouping input fixtures and their snapshots for Unity IL2CPP stack traces. No rule changes — this PR is fixtures and generated snapshots only, so the snapshots here record today's behavior.

This change is split out from #122130 (which updates IL2CPP in-app rules) deliberately. Landing the inputs first means that PR's diff consists of the rule change plus the snapshot churn it causes, and the churn is the review artifact: every frame whose in_app or grouping changes shows up as a line, annotated with the rule responsible.

What's covered

Five inputs, each packing several cases into one stack so the snapshot reads as a table rather than one assertion per file:

Input Covers
unity_il2cpp_macos.json GameAssembly.dylib, UnityPlayer.dylib, PlugIns/Sentry.*, PlugIns/libsentry.*
unity_il2cpp_ios.json UnityFramework, nested UnityRuntime.framework, SentryObjC.framework, the generated MainApp/main.mm launch stub
unity_il2cpp_android.json libil2cpp.so, libunity.so, libgame.so, libsentry.so, libsentry-android.so
unity_il2cpp_edge_cases.json negative cases, Windows backslash paths, GameAssembly.so, libiPhone-lib.dylib, sentry.dll, a registry package under Runtime/
unity_coroutine_dispatch.json UnityEngine.CoreModule / InvokeMoveNext coroutine dispatch (family:other)

The three platform inputs carry the same logical stack — EnemySpawner.Update → CombatSystem.ApplyDamage → TMP_Text.SetText → Animation.Play → null-ref raise — differing only in binary names and bundle paths. That's what makes them comparable: the same crash, reported from three platforms.

Within each platform stack: a frame the IL2CPP line mapping resolved to Assets/, one resolved to an embedded Packages/ directory, one resolved into Library/PackageCache/ (a registry package shipping its own Assets directory), one resolved into Unity's engine C# under unity/Modules/**/Scripting/Assets/, two unmapped frames still pointing at generated il2cppOutput/cpp/*.cpp, the engine binary, and the Sentry SDK binaries.

What the snapshots currently record

Three separately broken states, which is the point of adding the fixtures before the fix:

Input app variant hash today
unity_il2cpp_ios 8bbdecb4ad2f92d58133a93ee009a07b — engine, BCL and runtime frames are all in-app
unity_il2cpp_android null — nothing is in-app at all
unity_il2cpp_macos null — nothing is in-app at all

Verified locally with the follow-up rules applied, all three collapse to a single app hash while their system hashes stay distinct. That's the cross-platform grouping claim, and once these inputs are on master it becomes a checked artifact rather than a screenshot.

Authoring notes

Worth knowing if you extend these:

  • The IL2CPP method hashes differ across the three platform inputs. _il2cpp_method_hash in sentry/stacktraces/functions.py strips the _m<40 hex> suffix before grouping, so identical hashes would have made the matching app hash ambiguous. Differing ones show the trimming is doing the work, and these inputs will diverge loudly if that regex ever changes.
  • Function names in unity_il2cpp_edge_cases.json are descriptive rather than realistic (unrelated_native_app_source_under_assets_dir). That input is a synthetic stack whose hash is only a regression detector, so the names carry the intent. The three platform inputs use realistic mangled IL2CPP names instead, since their hashes are meaningful.

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Sep 16, 2026
@lobsterkatie
lobsterkatie marked this pull request as ready for review September 16, 2026 19:25
@lobsterkatie
lobsterkatie requested a review from a team as a code owner September 16, 2026 19:25
@lobsterkatie
lobsterkatie merged commit da75758 into master Sep 25, 2026
66 checks passed
@lobsterkatie
lobsterkatie deleted the kmclb-add-unity-grouping-inputs branch September 25, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants