崩溃 Ping

此 Ping 在主 Firefox 进程崩溃或子进程崩溃后捕获,无论是否将崩溃报告提交到 crash-stats.mozilla.org。它包含有关崩溃的非识别元数据。

警告

遥测崩溃 Ping 将被弃用并最终删除。它将被 Glean 崩溃 Ping 替换。请参阅 错误 1784069。请确保镜像对遥测 Ping 所做的任何更改!

此 Ping 由 CrashManager 或崩溃报告程序客户端发送。 CrashManager 负责发送子进程崩溃的崩溃 Ping,这些 Ping 在检测到崩溃后立即发送,以及主进程崩溃的 Ping,这些 Ping 在 Firefox 成功重启后发送。崩溃报告程序客户端仅针对主进程崩溃发送崩溃 Ping,无论用户是否也报告了崩溃。如果在 Firefox 中禁用了遥测,则崩溃报告程序客户端不会发送崩溃 Ping。

与此 Ping 一起发送的环境块有所不同:如果 Firefox 运行时间足够长以在崩溃前记录环境块,则将记录崩溃时的环境,并且 hasCrashEnvironment 将为 true。如果 Firefox 在记录环境之前崩溃,则 hasCrashEnvironment 将为 false,并且记录的环境将是提交时的环境。

客户端 ID 和配置文件组 ID 与此 Ping 一起提交。

元数据字段保存崩溃注释的子集,所有字段值都存储为字符串,但某些字段可以解释为数字或布尔值。除非在说明中另有说明,否则数字为整数。布尔值为 true 时设置为“1”,false 时设置为“0”。如果它们不存在,则应将其解释为 false。

结构

{
  type: "crash",
  ... common ping data
  clientId: <UUID>,
  profileGroupId: <UUID>,
  environment: { ... },
  payload: {
    crashDate: "YYYY-MM-DD",
    crashTime: <ISO Date>, // per-hour resolution
    version: 1,
    sessionId: <UUID>, // Telemetry ID of crashing session. May be missing for crashes that happen early in startup
    crashId: <UUID>, // Optional, ID of the associated crash
    minidumpSha256Hash: <hash>, // SHA256 hash of the minidump file
    processType: <type>, // Type of process that crashed, see below for a list of types
    stackTraces: { ... }, // Optional, see below
    metadata: { // Annotations saved while Firefox was running. See CrashAnnotations.yaml for more information
      ProductID: "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}",
      ProductName: "Firefox",
      ReleaseChannel: <channel>,
      Version: <version number>,
      BuildID: "YYYYMMDDHHMMSS",
      AsyncShutdownTimeout: <json>, // Optional, present when a shutdown blocker failed to respond within a reasonable amount of time
      AvailablePageFile: <size>, // Windows-only, available paging file in bytes
      AvailablePhysicalMemory: <size>, // Windows-only, available physical memory in bytes
      AvailableSwapMemory: <size>, // macOS- and Linux-only, available swap space
      AvailableVirtualMemory: <size>, // Windows-only, available virtual memory in bytes
      BackgroundTaskName: "task_name", // Optional, if the app was invoked in background task mode via `--backgroundtask task_name`
      BlockedDllList: <list>, // Windows-only, see WindowsDllBlocklist.cpp for details
      BlocklistInitFailed: "1", // Windows-only, present only if the DLL blocklist initialization failed
      CrashTime: <time>, // Seconds since the Epoch
      DOMFissionEnabled: "1", // Optional, if set indicates that a Fission window had been opened
      EventLoopNestingLevel: <levels>, // Optional, present only if >0, indicates the nesting level of the event-loop
      ExperimentalFeatures: <features>, // Optional, a comma-separated string that specifies the enabled experimental features from about:preferences#experimental
      FontName: <name>, // Optional, the font family name that is being loaded when the crash occurred
      GPUProcessLaunchCount: <num>, // Number of times the GPU process was launched
      HeadlessMode: "1", // Optional, "1" if the app was invoked in headless mode via `--headless ...` or `--backgroundtask ...`
      ipc_channel_error: <error string>, // Optional, contains the string processing error reason for an ipc-based content crash
      IsGarbageCollecting: "1", // Optional, if set indicates that the crash occurred while the garbage collector was running
      LowCommitSpaceEvents: <num>, // Windows-only, present only if >0, number of low commit space events detected by the available memory tracker
      MainThreadRunnableName: <name>, // Optional, Nightly-only, name of the currently executing nsIRunnable on the main thread
      MozCrashReason: <reason>, // Optional, contains the string passed to MOZ_CRASH()
      OOMAllocationSize: <size>, // Size of the allocation that caused an OOM
      ProfilerChildShutdownPhase: <string>, // Profiler shutdown phase
      PurgeablePhysicalMemory: <size>, // macOS-only, amount of memory that can be deallocated by the OS in case of memory pressure
      QuotaManagerShutdownTimeout: <log-string>, // Optional, contains a list of shutdown steps and status of the quota manager clients
      RemoteType: <type>, // Optional, type of content process, see below for a list of types
      SecondsSinceLastCrash: <duration>, // Seconds elapsed since the last crash occurred
      ShutdownProgress: <phase>, // Optional, contains a string describing the shutdown phase in which the crash occurred
      SystemMemoryUsePercentage: <percentage>, // Windows-only, percent of memory in use
      StartupCrash: "1", // Optional, if set indicates that Firefox crashed during startup
      TextureUsage: <usage>, // Optional, usage of texture memory in bytes
      TotalPageFile: <size>, // Windows-only, paging file in use expressed in bytes
      TotalPhysicalMemory: <size>, // Windows-only, physical memory in use expressed in bytes
      TotalVirtualMemory: <size>, // Windows-only, virtual memory in use expressed in bytes
      UptimeTS: <duration>, // Seconds since Firefox was started, this can have a fractional component
      User32BeforeBlocklist: "1", // Windows-only, present only if user32.dll was loaded before the DLL blocklist has been initialized
      WindowsErrorReporting: "1", // Windows-only, present only if the crash was intercepted by the WER runtime exception module
      WindowsFileDialogErrorCode: <error code>, // Windows-only, optional, present only if file-dialog IPC failed
      WindowsPackageFamilyName: <string>, // Windows-only, a string containing the "Package Family Name" of Firefox, if installed through an MSIX package
    },
    hasCrashEnvironment: bool
  }
}

注意

对于崩溃报告程序生成的“崩溃” Ping,我们故意将 creationTime 字段截断为小时。请参阅 错误 1345108 以获取上下文。

进程类型

processType 字段包含崩溃的进程类型。目前,nsICrashService 中定义了多种进程类型,但仅针对以下进程类型发送崩溃 Ping

类型

描述

main

主进程,也称为父进程或浏览器进程

content

内容进程

gmplugin

Gecko 媒体插件

gpu

GPU 进程

vr

VR 进程

rdd

数据解码器进程

socket

网络套接字进程

forkserver

分叉服务器

utility

实用程序进程

远程进程类型

可选的 remoteType 字段包含崩溃的内容进程的类型。因此,只有当 processType 包含 content 值时,它才会出现。以下内容进程类型当前已定义

类型

描述

web

内容进程正在运行来自网页的代码

file

内容进程正在运行来自本地文件的代码

extension

内容进程正在运行来自扩展的代码

堆栈跟踪

崩溃 Ping 可能包含一个 stackTraces 字段,该字段已填充了崩溃进程中所有线程的堆栈跟踪。此字段的格式类似于 Socorro 用于表示崩溃的格式。主要区别在于未存储冗余字段,并且帧所属的模块通过模块数组中的索引而不是其文件名来引用。

请注意,此字段不包含来自应用程序的数据;仅存储裸堆栈跟踪和模块列表。

{
  status: <string>, // Status of the analysis, "OK" or an error message
  crash_info: { // Basic crash information
    type: <string>, // Type of crash, SIGSEGV, assertion, etc...
    address: <addr>, // Crash address crash, hex format, see the notes below
    crashing_thread: <index> // Index in the thread array below
  },
  main_module: <index>, // Index of Firefox' executable in the module list
  modules: [{
    base_addr: <addr>, // Base address of the module, hex format
    end_addr: <addr>, // End address of the module, hex format
    code_id: <string>, // Unique ID of this module, see the notes below
    debug_file: <string>, // Name of the file holding the debug information
    debug_id: <string>, // ID or hash of the debug information file
    filename: <string>, // File name
    version: <string>, // Library/executable version
  },
  ... // List of modules ordered by base memory address
  ],
  threads: [{ // Stack traces for every thread
    frames: [{
      module_index: <index>, // Index of the module this frame belongs to
      ip: <ip>, // Program counter, hex format
      trust: <string> // Trust of this frame, see the notes below
    },
    ... // List of frames, the first frame is the topmost
    ]
  }]
}

备注

内存地址和指令指针始终以十六进制格式存储为字符串(例如,“0x4000”)。对于 64 位地址,它们最多可以包含 16 个字符。

崩溃类型既依赖于操作系统又依赖于 CPU,可以是描述性字符串(例如 SIGSEGV、EXCEPTION_ACCESS_VIOLATION)或原始数值。崩溃地址的含义取决于崩溃类型。在段错误中,崩溃地址将是导致错误的内存访问地址;在由非法指令异常触发的崩溃中,地址将是包含无效指令的指令指针。请参阅 breakpad 的相关代码以获取更多信息。

由于在遍历堆栈时并非总是能够确定上一帧的地址,因此每个帧都有一个信任值,表示它是如何找到的,以及我们对其是否为真实帧的确定程度。信任级别为(从信任度最低到信任度最高)

信任

描述

上下文

作为上下文中指令指针给出

prewalked

由某些外部堆栈步行器明确提供

cfi

源自调用帧信息

frame_pointer

源自帧指针

cfi_scan

在使用调用帧信息扫描堆栈时找到

scan

扫描了堆栈,找到了这个

none

未知,这很可能不是有效帧

code_id 字段保存一个唯一的 ID,用于区分同一模块的不同版本和构建。请参阅 breakpad 的描述以获取更多信息。此字段仅在 Windows 上填充。

版本历史

  • Firefox 58:添加了 ipc_channel_error(错误 1410143)。

  • Firefox 62:添加了 LowCommitSpaceEvents(错误 1464773)。

  • Firefox 63:添加了 RecordReplayError(错误 1481009)。

  • Firefox 64:添加了 MemoryErrorCorrection(错误 1498609)。

  • Firefox 68:添加了 IndexedDBShutdownTimeout 和 LocalStorageShutdownTimeout(错误 1539750)。

  • Firefox 74:添加了 AvailableSwapMemory 和 PurgeablePhysicalMemory(错误 1587721)。

  • Firefox 74:添加了 MainThreadRunnableName(错误 1608158)。

  • Firefox 76:添加了 DOMFissionEnabled(错误 1602918)。

  • Firefox 79:添加了 ExperimentalFeatures(错误 1644544)。

  • Firefox 85:添加了 QuotaManagerShutdownTimeout,删除了 IndexedDBShutdownTimeout 和 LocalStorageShutdownTimeout(错误 1672369)。

  • Firefox 89:添加了 GPUProcessLaunchCount(错误 1710448)和 ProfilerChildShutdownPhase(错误 1704680)。

  • Firefox 90:删除了 MemoryErrorCorrection(错误 1710152)并添加了 WindowsErrorReporting(错误 1703761)。

  • Firefox 95:添加了 HeadlessMode 和 BackgroundTaskName(错误 1697875)。

  • Firefox 96:添加了 WindowsPackageFamilyName(错误 1738375)。

  • Firefox 103:删除了 ContainsMemoryReport(错误 1776279)。

  • Firefox 107:添加了 UtilityActorsName(错误 1788596)。

  • Firefox 119:添加了 WindowsFileDialogErrorCode(错误 1837079