Get Firefox crash signature from raw crash trace
Перейти к файлу
dependabot[bot] b18aaa1cf6 Bump actions/setup-python from 5.1.1 to 5.2.0
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.1.1 to 5.2.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5.1.1...v5.2.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-05 10:01:53 -04:00
.github Bump actions/setup-python from 5.1.1 to 5.2.0 2024-09-05 10:01:53 -04:00
fx_crash_sig For bad request, print the response data 2024-08-14 09:59:26 -04:00
tests Clean up code and handle crash ping variations better 2022-12-06 11:42:40 -05:00
.gitignore Add an initial .gitignore 2022-11-22 20:56:17 -05:00
CODE_OF_CONDUCT.md Add code of conduct (#57) 2022-11-23 12:33:51 -05:00
HISTORY.md Update HISTORY.md 2024-04-23 21:51:49 -04:00
LICENSE changes for pypi 2018-07-11 22:13:00 -04:00
MANIFEST.in Add check-manifest tool and MANIFEST.in 2024-04-23 21:51:49 -04:00
Makefile Fix format 2024-01-02 13:30:40 -05:00
README.md obs-90: Update org to mozilla-services 2023-12-20 11:44:46 -05:00
pyproject.toml Add check-manifest tool and MANIFEST.in 2024-04-23 21:51:49 -04:00
sample.json Fix symbolication issues (#32) 2021-03-19 14:08:54 -04:00

README.md

fx-crash-sig

Symbolicates crash pings and generates signatures.

Take crash ping stack traces and:

  1. Use Mozilla Symbolication Service symbolication to symbolicate crash ping stack traces
  2. Use socorro-siggen library to generate a crash signature

Project details:

Install (from PyPI)

pip install fx-crash-sig

Usage

Example script:

import json

from fx_crash_sig.crash_processor import CrashProcessor

with open("crashping.json") as fp:
    crash_ping = json.load(fp)

crash_processor = CrashProcessor()

signature_result = crash_processor.get_signature(crash_ping)
print(signature_result.signature)

Command line (using sample.json):

cat sample.json | fx-crash-sig

Run this for more command line help:

fx-crash-sig --help

Minimal crash ping structure

The legacy crash ping (the pingsender one--not the glean one) is documented here:

https://firefox-source-docs.mozilla.org/toolkit/components/telemetry/data/crash-ping.html

These are the parts of the legacy crash ping we use:

- normalized_os                (optional)
- payload:
  - metadata:
    - async_shutdown_timeout   (optional)
    - ipc_channel_error        (optional)
    - oom_allocation_size      (optional)
    - moz_crash_reason         (optional)
  - stack_traces:
    - crash_info:
      - crashing_thread
      - type
    - modules[]
      - debug_file
      - debug_id
      - filename
      - base_addr
    - threads[]
      - frames[]
         - ip
         - module_index
         - trust

API

fx_crash_sig.crash_processor

  • CrashProcessor: symbolicates and generates signatures for legacy crash pings
    • __init__
      • arg: max_frames: int (40)
      • arg: api_url: str (https://symbolication.services.mozilla.com/symbolicate/v5)
      • arg: verbose: bool
    • get_signature: Takes a crash ping structure, symbolicates it using Mozilla Symbolication Service, generates a signature, and returns the signature result.
      • signature
        • arg: crash_ping: dict
        • returns: siggen.generator.Result
    • symbolicate: Symbolicates the stack traces in a crash ping structure payload.
      • signature
        • arg: crash_ping: dict
        • returns: symbolicated stack traces
    • get_signature_from_symbolicated: Takes the output of symbolicate, generates a signature, and returns the signature result.
      • signature
        • arg: symbolicated: dict
        • returns: siggen.generator.Result

fx_crash_sig.symbolicate

  • Symbolicator: symbolicates stack traces
    • __init__
      • arg: max_frames: int (40)
      • arg: api_url: str (https://symbolication.services.mozilla.com/symbolicate/v5)
      • arg: verbose: bool
    • symbolicate: Symbolicates a single stack trace.
      • arg: stack_trace: dict
      • returns: symbolicated stack trace
    • symbolicate_multi: Symbolicates a list of stack traces.
      • arg: stack_traces: list of dicts
      • returns: list of symbolicated traces