Closed Bug 1675560 Opened 2 years ago Closed 1 year ago

support JavaException annotation for Java crashes


(Socorro :: Webapp, enhancement, P2)



(Not tracked)



(Reporter: willkg, Assigned: willkg)


(Blocks 1 open bug)



(1 file)

android-components is adding a JavaException annotation which is a structured form of the Java stack trace and exception information.

It's in the same form as what Sentry sends which is nice.

This bug covers:

  1. processing the JavaException field like we do with JavaStackTrace where we have a raw form and a sanitized form that doesn't have the exception message which can contain PII (bug #1496599)
  2. making the sanitized form viewable in the report view to everyone

Bug #1541120 covers improving signature generation using this information. We'll need to implement the processor bits before working on that, so I'm adding a blocker.

Blocks: 1541120

The JavaException annotation is a JSON-encoded string that decodes to a dict. Here's an example:

    "exception": {
        "values": [
                "stacktrace": {
                    "frames": [
                    "value":"Failed to allocate a 34516 byte allocation with 13138 free bytes and 12KB until OOM"

The "exception message" is the ["stacktrace"]["value"] thing. In this case, it's "Failed to allocate a 34516 byte allocation with 13138 free bytes and 12KB until OOM". That can contain protected data.

So if someone has protected data access, they can see the whole thing and if they don't, they see everything except that part.

We do something similar with "json_dump", but it's hard to reason about whether someone accessing data is getting protected data they shouldn't be getting if it's deep in the structure. I think I want to do what we do with java_stack_trace where we have a "raw" form that has the whole structure and a "redacted form" that has everything that's fine, except the part that isn't.

Then we have:

  • raw_crash.JavaException -- protected data
  • processed_crash.java_exception_raw -- protected data
  • processed_crash.java_exception -- public data

I'm not thrilled about the naming scheme, but switching it takes 6 months and it's probably better to accrue a bunch of bad naming decisions and then fix them all at once.

The Sentry docs for the exception part of the payload are here:

Here's an example of a crash report with a single exception:

We should make sure we support cascading exceptions. I bet we have an example in our data. I'll look for one later.

Assignee: nobody → willkg

Some interesting bits about the data:

  1. The frame may not have a "filename". For example, this frame has no filename:
     {'function': 'emitAllImpl$FlowKt__ChannelsKt',
      'in_app': True,
      'lineno': 13,
      'module': 'kotlinx.coroutines.flow.FlowKt'}
  2. The stacktrace may not have a "value". I've only seen that with NullPointerExceptions so far, but I bet there are other exceptions that don't have values.

Need to keep that in mind when displaying things.

This was deployed in bug #1690378. Marking as FIXED.

There are some follow-up changes we could make, but we'll do those in future bugs as we figure out the details.

Closed: 1 year ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.