Skip to main content

Crash Detection

When Crash Detection feature is enabled, Sternum SDK automatically gathers essential information in the event of a application crash and transmits this data to the Sternum Platform upon the application's next startup. Collected data can be utilized by developers to facilitate more efficient debugging and troubleshooting.

Crash Detection feature becomes automatically active after calling sternum_sdk_initialize.

Supported SDKs

SDKCrash Detection support
Linux SDKYes
Android SDKYes
iOS SDKNo
Embedded SDKNo

Detected Signals

The Crash Detection feature responds to following signals indicating critical errors or abnormal conditions in the system:

  • SIGSEGV: Indicates invalid memory reference.
  • SIGBUS: Indicated bus error (bad memory access).
  • SIGILL: Indicates an illegal instruction.
  • SIGABRT: Indicates abort signal.
  • SIGFPE: Indicates a floating-point exception..
  • SIGSYS: Indicates a bad system call.
  • SIGTERM: Indicates a termination request.

When any of these signals are detected, the Crash Detection feature automatically gathers relevant information about the crash, aiding in the diagnosis and resolution of the underlying issue.

Collected Data

The Crash Detection feature collects the following data:

Data FieldDescription
Signal numberThe number representing the signal that caused the crash
PID of signal senderPID of the process that sent the signal, if signal is externally generated
Fault addressThe memory address where where a fault occurred
Command lineThe command line used to execute the crashed process
Root directoryThe root directory of the crashed process
Current working directoryThe current working directory of the crashed process
Process identificationTTID (Thread ID), PID (process ID), PPID (parent process ID), UID (user ID), EUID (effective user ID), GID (group ID), EGID (effective group ID)
Parent process command lineThe command line used to execute the parent process of the crashed process
UptimeThe duration for which the system had been running prior to the crash
Environmental variablesThe variables that were active in the system environment at the time of the crash
Memory mapsA map of the memory allocation of the crashed process, detailing memory segments and regions

Crash Data Management

The collected crash data will be stored on disk as a separate file in the same directory as configured SDK cache file. The crash file name is <SDK_cache_filename>.crash. When the system starts up the cached crash data is loaded from the disk and transmitted to the Sternum Platform for analysis. Once successfully transmitted, the crash file is removed from the disk to maintain data integrity and conserve storage space.

Requirements

A standard crash dump typically occupies around 10KB to 20KB, depending on the system. Consequently, related requirements include:

  • RAM: Sufficient memory space is needed to store crash data.

  • SDK Cache Capacity: The configured Sternum SDK cache capacity must accommodate crash data storage.

  • Disk Space: Adequate disk space is required to persistently store crash data.

  • Transmission: The feature transmits the collected crash data to the Sternum Platform. Given the potentially large size of the collected data, the device and transmission mechanism must handle sizable payloads effectively.

Register Dump

Registers dump functionality is available for the following architectures:

ArchitectureRequirement
x86_64glibc
arm32glibc

Enabling and disabling feature

Refer to your SDK's API reference to learn how to configure features in your SDK version.

Example Crash Report

CRASH REPORT
------------
Timestamp: 1715771163

Signal: 11

Fault address: 0x0000000000000000000

Registers:
RAX : 0x0000000000000000000 RBX : 0x0000000000000000000 RCX : 0x000000000000000003f RDX : 0x0000000000000000000
RSI : 0x000000055dcc10d0010 RDI : 0x0000000000000000007 RSP : 0x00000007ffcfa23f750 RBP : 0x00000007ffcfa23f7b0
R8 : 0x000000055dcc10d0b30 R9 : 0x0000000000000000000 R10 : 0x00000007ffcfa23f6b0 R11 : 0x00012f71c4c7d025148
R12 : 0x00000007ffcfa23f8c8 R13 : 0x000000055dcc0915229 R14 : 0x000000055dcc0917d68 R15 : 0x00000007f14819eb040

Command Line (path: /proc/self/cmdline):
./app_1.0.0

Root directory (path: /proc/self/root):
/

Current working directory (path: /proc/self/cwd):
/home/john/application

Process identification:
ttid: 67361
pid: 67361
ppid: 525
uid: 1000
euid: 1000
gid: 1000
egid: 1000

Parent Process Command Line (path: /proc/525/cmdline):
-bash

Uptime (path: /proc/uptime):
5428.83 42836.66

Environ (path: /proc/self/environ):
SHELL=/bin/bash <...>

Memory Maps (path: /proc/self/maps):
55f52f90a000-55f52f90b000 r--p 00000000 08:20 569354 /home/john/application/app_1.0.0
55f52f90b000-55f52f90c000 r-xp 00001000 08:20 569354 /home/john/application/app_1.0.0
55f52f90c000-55f52f90d000 r--p 00002000 08:20 569354 /home/john/application/app_1.0.0
55f52f90d000-55f52f90e000 r--p 00002000 08:20 569354 /home/john/application/app_1.0.0
55f52f90e000-55f52f90f000 rw-p 00003000 08:20 569354 /home/john/application/app_1.0.0
55f53102c000-55f53104d000 rw-p 00000000 00:00 0 [heap]
7fea28000000-7fea28084000 rw-p 00000000 00:00 0
7fea28084000-7fea2c000000 ---p 00000000 00:00 0
7fea2d18e000-7fea2d18f000 ---p 00000000 00:00 0
7fea2d18f000-7fea2d991000 rw-p 00000000 00:00 0
7fea2d991000-7fea2da4b000 r--p 00000000 08:20 515706 /home/john/modules/openssl/libcrypto.so.3
7fea2da4b000-7fea2dda9000 r-xp 000ba000 08:20 515706 /home/john/modules/openssl/libcrypto.so.3
7fea2dda9000-7fea2de8e000 r--p 00418000 08:20 515706 /home/john/modules/openssl/libcrypto.so.3
7fea2de8e000-7fea2deed000 r--p 004fc000 08:20 515706 /home/john/modules/openssl/libcrypto.so.3
7fea2deed000-7fea2def1000 rw-p 0055b000 08:20 515706 /home/john/modules/openssl/libcrypto.so.3
7fea2def1000-7fea2def4000 rw-p 00000000 00:00 0
7fea2def4000-7fea2df16000 r--p 00000000 08:20 515892 /home/john/modules/openssl/libssl.so.3
7fea2df16000-7fea2dfae000 r-xp 00022000 08:20 515892 /home/john/modules/openssl/libssl.so.3
7fea2dfae000-7fea2dfdc000 r--p 000ba000 08:20 515892 /home/john/modules/openssl/libssl.so.3
7fea2dfdc000-7fea2dfe6000 r--p 000e7000 08:20 515892 /home/john/modules/openssl/libssl.so.3
7fea2dfe6000-7fea2dfeb000 rw-p 000f1000 08:20 515892 /home/john/modules/openssl/libssl.so.3
7fea2dfeb000-7fea2e013000 r--p 00000000 08:20 264192 /usr/lib/x86_64-linux-gnu/libc.so.6
7fea2e013000-7fea2e1a8000 r-xp 00028000 08:20 264192 /usr/lib/x86_64-linux-gnu/libc.so.6
7fea2e1a8000-7fea2e200000 r--p 001bd000 08:20 264192 /usr/lib/x86_64-linux-gnu/libc.so.6
7fea2e200000-7fea2e201000 ---p 00215000 08:20 264192 /usr/lib/x86_64-linux-gnu/libc.so.6
7fea2e201000-7fea2e205000 r--p 00215000 08:20 264192 /usr/lib/x86_64-linux-gnu/libc.so.6
7fea2e205000-7fea2e207000 rw-p 00219000 08:20 264192 /usr/lib/x86_64-linux-gnu/libc.so.6
7fea2e207000-7fea2e214000 rw-p 00000000 00:00 0
7fea2e236000-7fea2e238000 r--p 00000000 08:20 264189 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7fea2e238000-7fea2e262000 r-xp 00002000 08:20 264189 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7fea2e262000-7fea2e26d000 r--p 0002c000 08:20 264189 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7fea2e26e000-7fea2e270000 r--p 00037000 08:20 264189 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7fea2e270000-7fea2e272000 rw-p 00039000 08:20 264189 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7fffbe80c000-7fffbe82e000 rw-p 00000000 00:00 0 [stack]
7fffbe891000-7fffbe895000 r--p 00000000 00:00 0 [vvar]
7fffbe895000-7fffbe897000 r-xp 00000000 00:00 0 [vdso]