Skip to content

Conversation

@loewenheim
Copy link
Contributor

This adds an enum FrameOrder with variants
callee_first and caller_first to distinguish two common ways stack frames are stored, processed, and displayed (innermost frame at the top and at the bottom, respectively). This enum is now passed to all stacktrace-processing methods Symbolicator methods. Since Symbolicator does not (yet) read the parameter, there are no functional changes.

The intention of this is to clarify in which order frames are sent to Symbolicator, which currently differs between platforms because we never properly documented or enforced this. Once Symbolicator becomes able to process the new parameter, there may also be opportunities for simplification.

As a somewhat related change, this also adjusts some JS tests so they sort the "scraping_attempts" returned by Symbolicator before checking them. This is sound because there is no intended order of scraping attempts anyway, and makes sure tests pass once Symbolicator is allowed to process frames in a different order.

Fixes INGEST-640.

This adds an enum `FrameOrder` with variants
`callee_first` and `caller_first` to distinguish two common ways stack
frames are stored, processed, and displayed (innermost frame at the top
and at the bottom, respectively). This enum is now passed to all
stacktrace-processing methods Symbolicator methods. Since Symbolicator
does not (yet) read the parameter, there are no functional changes.

The intention of this is to clarify in which order frames are sent to
Symbolicator, which currently differs between platforms because we never
properly documented or enforced this. Once Symbolicator becomes able to
process the new parameter, there may also be opportunities for
simplification.

As a somewhat related change, this also adjusts some JS tests so they
sort the "scraping_attempts" returned by Symbolicator before checking
them. This is sound because there is no intended order of scraping
attempts anyway, and makes sure tests pass once Symbolicator is allowed
to process frames in a different order.
@loewenheim loewenheim requested review from a team as code owners November 19, 2025 14:12
@linear
Copy link

linear bot commented Nov 19, 2025

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 19, 2025
@loewenheim
Copy link
Contributor Author

@viglia I updated the order for profiling. Please feel free to suggest any expansions to the comments that may clarify the logic.

],
# Methods in a profile aren't inherently ordered, but the order of returned
# inlinees should be caller first.
frame_order=FrameOrder.caller_first,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Inconsistent frame order between symbolication contexts

The frame order passed to Symbolicator differs inconsistently between profile symbolication and Android deobfuscation. Profile symbolication uses FrameOrder.callee_first (line 434) with comment stating "returned inlinees should be ordered callee first", while Android deobfuscation uses FrameOrder.caller_first (line 962) with comment stating "the order of returned inlinees should be caller first". Both code paths call symbolicator.process_jvm() with different frame_order values, and the PR discussion indicates these methods shouldn't have different orders since they're sending complete method sets rather than individual stacks. The comments contradict each other, suggesting misalignment in intent.

Fix in Cursor Fix in Web

@loewenheim loewenheim merged commit e89220b into master Nov 24, 2025
66 checks passed
@loewenheim loewenheim deleted the sebastian/frame-order branch November 24, 2025 08:34
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.

4 participants