Repository navigation
bug-2088928: build java_stack_trace from java_exception for crash pings - #7302
Conversation
| # Get the stacktrace for the outermost exception, since that's what we use to generate | ||
| # signatures for Java crashes: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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: | |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
Because:
JavaStackTraceannotation, onlyJavaException.java_stack_tracefromjava_exceptionlets signature generation useJavaSignatureToolfor 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:
JavaStackTraceFromJavaExceptionRulethat uses a newjava_stack_trace_from_java_exceptionhelper to create aprocessed_crash.java_stack_tracefromprocessed_crash.java_exceptionfor crash pings.Left to do: