Skip to content

bug-2088928: build java_stack_trace from java_exception for crash pings - #7302

Merged
biancadanforth merged 5 commits into
mainfrom
cringe-473
Nov 17, 2026
Merged

biancadanforth merged 5 commits into
mainfrom
cringe-473

Conversation

@biancadanforth

@biancadanforth biancadanforth commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Because:

  • Crash pings don't include the JavaStackTrace annotation, only JavaException.
  • Building java_stack_trace from java_exception lets signature generation use JavaSignatureTool for crash pings, so they get the same signatures as the corresponding crash reports. Otherwise they would be different in many cases, as documented in CRINGE-445.

This PR:

  • Adds a new JavaStackTraceFromJavaExceptionRule that uses a new java_stack_trace_from_java_exception helper to create a processed_crash.java_stack_trace from processed_crash.java_exception for crash pings.
  • The changes were validated on 1000 recent Fenix Java crash reports in CRINGE-445, but I plan to do another validation check with a larger sample on Monday.

Left to do:

@biancadanforth
biancadanforth requested a review from a team as a code owner November 13, 2026 21:39
Comment thread socorro/lib/libjava.py
Comment on lines +188 to +189
# Get the stacktrace for the outermost exception, since that's what we use to generate
# signatures for Java crashes:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In implementing this, I realized that our signature generation algorithm for Java crashes uses the outermost exception information (the exception class and the top frame in that exception's stackframe) rather than the innermost exception (often considered the root cause).

In an effort to keep signature generation working as it currently does, I won't change that here. I imagine this is mentioned in one or more of the "improve java crash signatures" tickets Willkg filed ages ago. I'll find it and add it to the optional 7 Milestone, as we likely want to use the innermost exception for signature generation rather than the outermost exception. In the processed_crash.schema.yaml file for java_exception, Willkg added a note that he wasn't sure what the ordering of values was, so perhaps that's why it ended up this way.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The meta bug for improving Java crash report signatures is bug-1693693.

The bug about the order of the exception chain in JavaException is bug-1888997.

The bug about using the innermost or deepest exception for signature generation for Java crashes rather than the outermost is bug-1698623.

I've added the latter two bugs to Milestone 7.

assert (
java_exc.exception_message
== 'Error(\n\nGeneral Error: "No subscriptions created yet.")'
class Test_parse_java_stack_trace:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I refactored this test file a bit since the previous tests here were all for libjava.parse_java_stack_trace but weren't inside a test class. I moved them inside a test class with the relevant fixtures above the test class which seems to be the convention in the repo.

source_annotation: JavaException
java_stack_trace:
description: >
description: |

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I didn't update the docs in docs/crashpings.rst, because there's lots of information there that is stale. I added a note to CRINGE-391 which is a docs update ticket.

@smarnach smarnach left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good to me. I've added a few comments for your consideration, but none of them is important.

Overall, the approach is a bit of a hack, but given the circumstances it's probably one of our best options. I hope we can get rid of this code some time next year again.

Comment thread socorro/processor/rules/java.py Resolved
Comment thread socorro/lib/libjava.py Resolved
Comment thread socorro/mozilla_rulesets.py Resolved
@biancadanforth
biancadanforth added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 582f34c Nov 17, 2026
1 check passed
@biancadanforth
biancadanforth deleted the cringe-473 branch November 17, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants