Skip to content

feat(crash): report the faulting address of a native crash - #90

Open
Fiona2016 wants to merge 1 commit into
mainfrom
feat/native-crash-signal-threads
Open

Fiona2016 wants to merge 1 commit into
mainfrom
feat/native-crash-signal-threads

Conversation

@Fiona2016

Copy link
Copy Markdown
Collaborator

What

A native crash raised by the kernel for a fault now reports its faulting address as the crash.fault_address attribute (for example 0x0 for a null pointer dereference).

  • Source: exception.signal.address of the system's APP_CRASH event, which the SDK already received but dropped. It arrives in two spellings (000000000000000000 and 0x...); both are normalized to 0x + hex without leading zeros.
  • Only for a signal-specific si_code (1 to 0x7f). For a signal a process sent (SI_USER, SI_TKILL, ... — abort() among them) the system fills the field with the sender's pid and uid, so no address is reported.
  • The message is unchanged (SIGSEGV(SEGV_MAPERR)): the address differs between occurrences of one fault, so it stays out of the message and issue grouping is unaffected.

Other threads' stacks (error.threads) and memory at the fault were already reported from params.threads / params.memory; this change does not touch them.

Verification

  • Unit tests: node scripts/unit-node/run.mjs — 624 passed (2 new tests, with negative controls for sent signals, SI_KERNEL, missing code / address / signal).
  • scripts/ci-check.sh — all checks passed (HARs, demo HAP, hvigor plugin task, unit-test compile).
  • Real device (API 26), local HARs in a test app, events sent to a local mock intake:
    • null-pointer SIGSEGV: error.type SIGSEGV, message SIGSEGV(SEGV_MAPERR), crash.fault_address 0x0, 39 threads.
    • abort(): error.type SIGABRT, message SIGABRT(SI_TKILL), no crash.fault_address, 38 threads.

A native crash raised by the kernel for a fault (SIGSEGV, SIGBUS, SIGILL,
SIGFPE, SIGTRAP with a signal-specific si_code) now carries its faulting
address from exception.signal.address, normalized to "0x..." without
leading zeros, as the crash.fault_address attribute. The message keeps
naming only the signal and its code, so every occurrence of one fault
still shares one message and one issue.

A signal sent by a process (SI_USER, SI_TKILL, ..., including abort())
reports no fault address: for those the system fills the address field
with the sender's pid and uid.

This branch has not been deployed

No deployments
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.

1 participant