# This lists all the available crash annotations.
#
# Mandatory fields for each entry are:
# - description: A string describing the annotation
# - type: the annotation type, currently `string`, `boolean`, `u32`, `u64`,
#   `usize`, or `object`. `string` values that contain the empty string will
#   not be stored in the crash report, no matter if the annotation was
#   registered, only non-empty value will result in an entry. `boolean` values
#   are stringified to `1` for true and `0` for false. `object` types are a
#   JSON object (not serialized), and may only be used for client-scoped
#   annotations. They are only used internally by the crash reporting
#   machinery; these values can't be accessed by the C++/JS APIs.
#
# Additionally an entry can have the following optional fields:
# - altname: A string that will be used when writing out the annotation to the
#   .extra file instead of the annotation name
# - scope: A string that indicates the scope of the annotation. Valid values
# include:
#   - "client": annotations which are never sent remotely (the default if unspecified),
#   - "report": annotations which are sent in reports,
#   - "ping": annotations which are sent in pings and reports, and
#   - "ping-only": annotations which are sent only in pings.
# - skip_if: A string that will cause the annotation not to be included in the
#   crash report if the contents match it.
# - bugs: An array of bug numbers on bugzilla that relate to the annotation.
# - glean: How the annotation is surfaced as a Glean metric. This may only be
#   present if scope is "ping" or "ping-only".
#
#   This should be a map with the following (optional) properties:
#   - metric: Either the full name of the Glean metric (e.g. crash.foobar) or
#     the top-level Glean metric category to use (in which case the metric name
#     will be derived as the snake_case version of the annotation name).
#     Defaults to `crash` (as a category).
#   - type: The Glean metric type. Defaults based on the annotation type:
#     - `string` -> `string`
#     - `boolean` -> `boolean`
#     Other types have no default and will require an entry.
#     Valid type descriptions:
#     - `boolean`
#     - `datetime`
#       - requires an adjacent `time_unit` field
#     - `timespan`
#       - requires an adjacent `time_unit` field
#     - `string`
#     - `string_list`
#       - requires an adjacent `delimiter` field
#     - `quantity`
#       - requires an adjacent `unit` field
#     - `object`
#       - requires an adjacent `structure` field (matching the glean schema)
#   - custom_convert: If set to `true` or a string, a custom conversion function
#     will be called to convert to the metric value. When set to `true`, the
#     function will be based on the metric name. When set to a string, the
#     function will be based on the provided string.
#
#     It is only necessary to set this to override the default conversion
#     functions or to share a conversion function -- other conversions will
#     always use a custom conversion function. Default conversion functions
#     exist for:
#     - `boolean` -> `boolean`
#     - `string` -> `string`
#     - `u32`/`u64`/`usize` -> `quantity`
#     - `string` -> `string_list`

AbortMessage:
  description: >
    Message passed to NS_DebugBreak().
  type: string
  scope: report

Accessibility:
  description: >
    Set to "Active" by the accessibility service when it is active.
  type: string
  scope: report

AccessibilityClient:
  description: >
    Accessibility client ID.
  type: string
  scope: report

AccessibilityInProcClient:
  description: >
    Hexadecimal mask of in-process accessibility consumers, see
    accessible/windows/msaa/Compatibility.h for the mappings.
  type: string
  scope: report

AdapterDeviceID:
  description: >
    Graphics adapter name.
  type: string
  scope: report

AdapterDriverVendor:
  description: >
    Graphics adapter driver vendor.
  type: string
  scope: report

AdapterDriverVersion:
  description: >
    Graphics adapter driver version.
  type: string
  scope: report

AdapterSubsysID:
  description: >
    Graphics adapter subsystem ID.
  type: string
  scope: report

AdapterVendorID:
  description: >
    Graphics adapter vendor name.
  type: string
  scope: report

additional_minidumps:
  description: >
    Comma separated list of additional minidumps for this crash, each element
    in the list represent the suffix used in the dump filename. E.g. the
    "browser" entry for crash fa909194-737b-4b93-b8da-da110ac785e0 implies the
    existence of the fa909194-737b-4b93-b8da-da110ac785e0-browser.dmp file.
  type: string
  scope: report

Addons:
  description: >
    List of currently enabled add-ons.
  type: string
  scope: report
  altname: Add-ons

Android_Board:
  description: >
    The name of the underlying board used by the Android device. e.g. "k68v1_64"
  type: string
  scope: report

Android_Brand:
  description: >
    The consumer-visible brand associated with this Android device. e.g. "vivo"
  type: string
  scope: report

Android_CPU_ABI:
  description: >
    The Android primary CPU ABI being used. e.g. "arm64-v8a"
  type: string
  scope: report

Android_CPU_ABI2:
  description: >
    The Android secondary CPU ABI being used. e.g. "armeabi-v7a"
  type: string
  scope: report

Android_Device:
  description: >
    Android device name. e.g. "1907"
  type: string
  scope: report

Android_Display:
  description: >
    End-user visible display name of the build id for the Android build.
    e.g. "SP1A.210812.003 release-keys"
  type: string
  scope: report

Android_Fingerprint:
  description: >
    A string that uniquely identifies the Android build. e.g.
    "vivo/1907/1907:12/SP1A.210812.003/compiler03091510:user/release-keys"
  type: string
  scope: report

Android_Hardware:
  description: >
    The name of the Android hardware from "/proc". e.g. "mt6768"
  type: string
  scope: report

Android_Manufacturer:
  description: >
    Android device manufacturer. e.g. "vivo"
  type: string
  scope: report

Android_Model:
  description: >
    End-user visible Android device model name. e.g. "vivo 1907"
  type: string
  scope: report

Android_PackageName:
  description: >
    The package name of an Android application that uniquely identifies the
    application on the device, Google Play Store, and third-party Android
    stores. e.g. "com.example.referencebrowser"
  type: string
  scope: report

Android_ProcessName:
  description: >
    The name of the process which sent the crash report in the Android
    application.
  type: string
  scope: report

Android_Version:
  description: >
    The developer preview revision of a prerelease SDK plus The current
    development codename, or the string "REL" if this is a release build.
    e.g. "31 (REL)"
  type: string
  scope: report

AndroidComponentVersion:
  description: >
    The version of android-components in use.
  type: string
  scope: report

AppInitDLLs:
  description: >
    List of DLLs loaded when launching any application on Windows, this
    reflects the contents of the AppInit_DLLs registry key.
  type: string
  scope: report

ApplicationBuildID:
  description: >
    The Android application's build ID.
  type: string
  scope: ping

ApplicationServicesVersion:
  description: The version of Application Services libraries.
  type: string
  scope: report

AsyncShutdownTimeout:
  description: >
    This annotation is present if a shutdown blocker was not released in time
    and the browser was crashed instead of waiting for shutdown to finish. The
    condition that caused the hang is contained in the annotation.
  type: string
  scope: ping
  glean:
    type: object
    structure:
      type: object
      properties:
        phase:
          type: string
        conditions:
          type: string
        broken_add_blockers:
          type: array
          items:
            type: string

AvailablePageFile:
  description: >
    Available commit-space in bytes.
    - Under Windows, computed from the PERFORMANCE_INFORMATION structure by substracting
      the CommitTotal field from the CommitLimit field.
    - Under Linux, computed from /proc/meminfo's CommitLimit - Committed_AS. Note that
      the kernel is not guaranteed to enforce that CommittedLimit >= Committed_AS. If
      Committed_AS > CommittedLimit, this value is set to 0.
    - Not available on other platforms.
  type: usize
  scope: ping
  glean:
    metric: memory.available_commit
    type: quantity
    unit: bytes

AvailablePhysicalMemory:
  description: >
    Amount of free physical memory in bytes.
    - Under Windows, populated with the contents of the MEMORYSTATUSEX's structure
    ullAvailPhys field.
    - Under macOS, populated with vm_statistics64_data_t::free_count.
    - Under Linux, populated with /proc/meminfo's MemFree.
    - Not available on other platforms.
  type: usize
  scope: ping
  glean:
    metric: memory.available_physical
    type: quantity
    unit: bytes

AvailableSwapMemory:
  description: >
    Amount of free swap space in bytes.
    - Under macOS, populated with the contents of
      sysctl "vm.swapusage" :: xsu_avail.
    - Under Linux, populated with /proc/meminfo's SwapFree.
    - Not available on other platforms.
  type: usize
  scope: ping
  glean:
    metric: memory.available_swap
    type: quantity
    unit: bytes

AvailableVirtualMemory:
  description: >
    Amount of free virtual memory in bytes
    - Under Windows, populated with the contents of the MEMORYSTATUSEX's structure ullAvailVirtual field.
    - Under Linux, populated with /proc/meminfo's MemAvailable.
    - Not available on other platforms.
    - For macOS, see AvailableSwapMemory, AvailablePhysicalMemory and PurgeablePhysicalMemory.
  type: usize
  scope: ping
  glean:
    metric: memory.available_virtual
    type: quantity
    unit: bytes

BackgroundTaskMode:
  description: >
    True if the app was invoked in background task mode via `--backgroundtask ...`, false otherwise.
  type: boolean
  scope: report

BackgroundTaskName:
  description: >
    If the app was invoked in background task mode via `--backgroundtask <task name>`, the string "task name".
  type: string
  scope: ping

BlockedDllList:
  description: >
    Semicolon-separated list of blocked DLLS, Windows-only
  type: string
  scope: ping
  glean:
    metric: dll_blocklist.list
    type: string_list
    delimiter: ";"

BlocklistInitFailed:
  description: >
    Set to 1 if the DLL blocklist could not be initialized.
  type: boolean
  scope: ping
  skip_if: "0"
  glean:
    metric: dll_blocklist.init_failed

Breadcrumbs:
  description: >
    Trail of events that occurred before a report. this will consist of multiple breadcrumbs with
    timestamp, message, category, level, type and data in JSON format.
  type: string
  scope: report

BuildID:
  description: >
    Application build ID, the format is YYYYMMDDHHMMSS.
  type: string
  scope: ping
  glean:
    metric: crash.app_build

CrashEventID:
  description: A UUID for the crash event.
  type: string
  scope: ping
  bugs:
    - 1993525
    - 2037943
  glean:
    metric: crash.event_id

CrashType:
  description: The type of crash that occurred (Android-only).
  type: string
  scope: ping

ContentSandboxCapabilities:
  description: >
    List of capabilities of the content process sandbox.
  type: u32
  scope: report

ContentSandboxEnabled:
  description: >
    Set to 1 when content process sandboxing is enabled.
  type: boolean
  scope: report

ContentSandboxCapable:
  description: >
    Set to 1 if the client is capable of content sandboxing.
  type: boolean
  scope: report

ContentSandboxLevel:
  description: >
    Content sandbox level.
  type: u32
  scope: report

ContentSandboxWin32kState:
  description: >
    Content sandbox Win32k state
  type: string
  scope: report

GpuSandboxLevel:
  description: >
    GPU sandbox level.
  type: u32
  scope: report

CPUMicrocodeVersion:
  description: >
    Version of the CPU microcode.
  type: string
  scope: report

Comments:
  description: >
    The user comments for a crash, recorded by the crash reporter client.
  type: string
  scope: report

CrashTime:
  description: >
    Crash time in seconds since the Epoch.
  type: string
  scope: ping
  glean:
    metric: crash.time
    type: datetime
    time_unit: second

CycleCollector:
  description: >
    Reason why the cycle collector crashed.
  type: string
  scope: report

DesktopEnvironment:
  description: >
    Desktop environment used on Linux, e.g. GNOME, KDE, XFCE, etc.
  type: string
  scope: report

DeviceResetReason:
  description: >
    Reason why a DirectX device has been reset, Windows only.
  type: u32
  scope: report

DistributionID:
  description: The distribution ID of the application.
  type: string
  scope: report

DOMFissionEnabled:
  description: >
    Set to 1 when DOM fission is enabled, and subframes are potentially loaded
    in a separate process.
  type: boolean
  scope: ping

DOMIPCEnabled:
  description: >
    Set to 1 when a tab is running in a content process
  type: boolean
  scope: report

DumperError:
  description: >
    Error message of the minidump writer, in case there was an error during dumping.
  type: string
  scope: report

EMCheckCompatibility:
  description: >
    Set to true if add-on compatibility checking is enabled. Technically this
    annotation should be a boolean, but historically it's been set by JavaScript
    code as a string, so keep it as such for the time being.
  type: string
  scope: report

EventLoopNestingLevel:
  description: >
    Present only if higher than 0, indicates that we're running in a nested
    event loop and indicates the nesting level.
  type: u32
  scope: ping
  skip_if: "0"
  glean:
    type: quantity
    unit: levels

FontName:
  description: >
    Set before attempting to load a font to help diagnose crashes during loading.
  type: string
  scope: ping

GeckoViewVersion:
  description: The version of geckoview in use.
  type: string
  scope: report

GleanVersion:
  description: The version of Glean in use.
  type: string
  scope: report

GMPLibraryPath:
  description: >
    Holds the path to the GMP plugin library.
  type: string
  scope: report

GMPPlugin:
  description: >
    Set to 1 if the GMP plugin is enabled.
  type: boolean
  scope: report

GPUProcessLaunchCount:
  description: >
    Number of times the GPU process was launched.
  type: u32
  scope: ping
  glean:
    metric: crash.gpu_process_launch
    type: quantity
    unit: events

GPUProcessStatus:
  description: >
    Status of the GPU process, can be set to "Running" or "Destroyed"
  type: string
  scope: report

GraphicsCompileShader:
  description: >
    Name of the shader we are in the process of compiling, if applicable. See
    file names in gfx/wr/webrender/res/* for the possible values.
  type: string
  scope: report

GraphicsCriticalError:
  description: >
    Information of a critical error that occurred within the graphics code.
  type: string
  scope: report

GraphicsDrawShader:
  description: >
    Name of the shader that is currently bound for a draw call, if applicable.
    See file names in gfx/wr/webrender/res/* for the possible values.
  type: string
  scope: report

GraphicsFontFile:
  description: >
    Error and path of the font file that has failed to load. The user's profile
    dir is removed from the front of the path if necessary.
  type: string
  scope: report

GraphicsNumActiveRenderers:
  description: >
    Number of webrender renderer instances that are not in a paused state.
  type: usize
  scope: report

GraphicsNumRenderers:
  description: >
    Total number of webrender renderer instances.
  type: usize
  scope: report

GraphicsStartupTest:
  description: >
    Set to 1 by the graphics driver crash guard when it's activated.
  type: boolean
  scope: report

HeadlessMode:
  description: >
    True if the app was invoked in headless mode via `--headless ...` or `--backgroundtask ...`, false otherwise.
  type: boolean
  scope: ping
  glean:
    metric: environment

PHCKind:
  description: >
    The allocation kind, if the crash involved a bad access of a special PHC
    allocation.
  type: string
  scope: report

PHCBaseAddress:
  description: >
    The allocation's base address, if the crash involved a bad access of a
    special PHC allocation. Encoded as a decimal address.
  type: string
  scope: report

PHCUsableSize:
  description: >
    The allocation's usable size, if the crash involved a bad access of a
    special PHC allocation.
  # A 32-bit integer is enough because the maximum usable size of a special PHC
  # allocation is far less than 2 GiB.
  type: u32
  scope: report

PHCAllocStack:
  description: >
    The allocation's allocation stack trace, if the crash involved a bad access
    of a special PHC allocation. Encoded as a comma-separated list of decimal
    addresses.
  type: string
  scope: report

PHCFreeStack:
  description: >
    The allocation's free stack trace, if the crash involved a bad access
    of a special PHC allocation. Encoded as a comma-separated list of decimal
    addresses.
  type: string
  scope: report

HasDeviceTouchScreen:
  description: >
    Set to 1 if the device had a touch-screen, this only applies to Firefox
    desktop as on mobile devices we assume a touch-screen is always present.
  type: boolean
  scope: report

InstallTime:
  description: >
    The time when Firefox was installed expressed as seconds since the Epoch
  type: u64
  scope: report

ipc_channel_error:
  description: >
    Set before a content process crashes because of an IPC channel error. Holds
    a description of the error.
  type: string
  scope: ping

IpcCreatePipeCloExecErrno:
  description: >
    errno value retrieved after failing to set the O_CLOEXEC flag on a pipe
    used for IPC.
  type: u32
  scope: report

IpcCreatePipeFcntlErrno:
  description: >
    errno value retrieved after a call to fcntl() on a pipe used for IPC failed.
  type: u32
  scope: report

IpcCreatePipeSocketPairErrno:
  description: >
    errno value retrieved after a socketpair() call failed while creating an IPC
    transport object.
  type: u32
  scope: report

IPCFatalErrorMsg:
  description: >
    Describes a fatal error that occurred during IPC operation.
  type: string
  scope: report

IPCFatalErrorProtocol:
  description: >
    Name of the protocol used by IPC when a fatal error occurred.
  type: string
  scope: report

IPCMessageLargeBufferShmemFailureSize:
  description: >
    Size of failed shmem allocations which led to data being sent inline in the
    IPC message that caused a crash because it was too large.
  type: u32
  scope: report

IPCMessageName:
  description: >
    Name of the IPC message that caused a crash because it was too large.
  type: string
  scope: report

IPCMessageSize:
  description: >
    Size of the IPC message that caused a crash because it was too large.
  type: u32
  scope: report

IPCReadErrorReason:
  description: >
    Reason why reading an object via IPC failed.
  type: string
  scope: report

IPCShutdownState:
  description: >
    IPC shutdown state, can be set to either "RecvShutdown" or
    "SendFinishShutdown" by a content process while it's shutting down.
  type: string
  scope: report

IPCSystemError:
  description: >
    Description of the last system error that occurred during IPC operation.
  type: u32
  scope: report

Hang:
  description: >
    Set if the crash was the result of a hang, with a value which describes the
    type of hang (e.g. "ui" or "shutdown").
  type: string
  scope: ping

IsGarbageCollecting:
  description: >
    If true then the JavaScript garbage collector was running when the crash
    occurred.
  type: boolean
  scope: ping
  skip_if: "0"

IsWayland:
  description: >
    If true then the Wayland windowing system was in use.
  type: boolean
  scope: report

IsWebRenderResourcePathOverridden:
  description: >
    If true then the WebRender resources (i.e. shaders) are loaded from a user specified path.
  type: boolean
  scope: report

JavaException:
  description: >
    JSON structured Java stack trace, only present on Firefox for Android if we encounter an
    uncaught Java exception.
  type: string
  scope: ping
  glean:
    type: object
    # version history (typescript for brevity)
    # # 0
    # {
    #   messages: string[],
    #   stack: { file: string, line: number, class_name: string, method_name: string, is_native: boolean }[]
    # }
    #
    # # 1
    # {
    #   throwables: {
    #     message: string,
    #     type_name: string,
    #     stack: { file: string, line: number, class_name: string, method_name: string, is_native: boolean }[]
    #   }[]
    # }
    version: 1
    structure:
      type: object
      properties:
        # The Throwable and any cause Throwables.
        # They are always in cause order (e.g., [`e`, `e.cause`, `e.cause.cause`, ...]).
        throwables:
          type: array
          items:
            type: object
            properties:
              # The message of the Throwable.
              message:
                type: string
              # The java fully qualified type name of the Throwable.
              type_name:
                type: string
              # The stack trace, from nearest to farthest execution point, of the Throwable.
              # This may be omitted on `cause` Throwables.
              stack:
                type: array
                items:
                  type: object
                  properties:
                    # The source file containing this stack trace element.
                    file:
                      type: string
                    # The line number of the source file containing this stack trace element.
                    line:
                      type: number
                    # The name of the class containing this stack trace element.
                    class_name:
                      type: string
                    # The name of the method containing this stack trace element.
                    method_name:
                      type: string
                    # Whether the method is native.
                    is_native:
                      type: boolean

JavaStackTrace:
  description: >
    Java stack trace, only present on Firefox for Android if we encounter an
    uncaught Java exception.
  type: string
  scope: report

JSActorMessage:
  description: >
    If an actor is currently treating a message, this is the name of the message.
    Otherwise, empty.
  type: string
  scope: report

JSActorName:
  description: >
    If an actor is currently treating a message, this is the name of the actor.
    Otherwise, empty.
  type: string
  scope: report

JSLargeAllocationFailure:
  description: >
    A large allocation couldn't be satisfied, check the JSOutOfMemory
    description for the possible values of this annotation.
  type: string
  scope: ping
  glean:
    metric: memory

JSModuleLoadError:
  description: >
    The error raised when attempting to import a critical JS module from C++
  type: string
  scope: report

JSOutOfMemory:
  description: >
    A small allocation couldn't be satisfied, the annotation may contain the
    "Reporting", "Reported" or "Recovered" value. The first one means that
    we crashed while responding to the OOM condition (possibly while running a
    memory-pressure observers), the second that we crashed after having tried to
    free some memory, and the last that the GC had managed to free enough memory
    to satisfy the allocation.
  type: string
  scope: ping
  glean:
    metric: memory


LastInteractionDuration:
  description: >
    How long the user had been inactive in seconds if the user was inactive
    at crash.  The value is not set if the user state was active.
  type: u64
  scope: ping
  glean:
    type: timespan
    time_unit: second
    custom_convert: duration_seconds

LastStartupWasCrash:
  description: >
    True if the last startup was detected to have been a crash.
  type: boolean
  scope: report

MacMemoryPressure:
  description: >
    The current memory pressure state as provided by the macOS memory pressure
    dispatch source. The annotation value is one of "Normal" for no memory
    pressure, "Unset" indicating a memory pressure event has not been received,
    "Warning" or "Critical" mapping to the system memory pressure levels,
    or "Unexpected" for an unexpected level. This is a Mac-specific annotation.
  type: string
  scope: report

MacMemoryPressureNormalTime:
  description: >
    The time when the memory pressure state last transitioned to 'Normal'
    expressed as seconds since the Epoch.
  type: string
  scope: report

MacMemoryPressureWarningTime:
  description: >
    The time when the memory pressure state last transitioned to 'Warning'
    expressed as seconds since the Epoch.
  type: string
  scope: report

MacMemoryPressureCriticalTime:
  description: >
    The time when the memory pressure state last transitioned to 'Critical'
    expressed as seconds since the Epoch.
  type: string
  scope: report

MacMemoryPressureSysctl:
  description: >
    The value of the memory pressure sysctl
    'kern.memorystatus_vm_pressure_level'. Indicates which memory
    pressure level the system is in at the time of the crash. The expected
    values are one of 4 (Critical), 2 (Warning), or 1 (Normal).
  type: u32
  scope: report

MacAvailableMemorySysctl:
  description: >
    The value of the available memory sysctl 'kern.memorystatus_level'.
    Expected to be a percentage integer value.
  type: u32
  scope: report

Marionette:
  description: >
    Set to 1 when Marionette (WebDriver Classic) is enabled.
  type: boolean
  scope: report

MemtestOutput:
  description: >
    The output of memory tests done by the crash reporter client after a crash
    in a JSON format
  type: string
  scope: report

LinuxUnderMemoryPressure:
  description: >
    Set to true if the memory pressure watcher was under memory pressure when
    the crash occurred.
  type: boolean
  scope: report

LinuxMemoryPSI:
  description: >
    Memory PSI (Pressure Stall Information) values from /proc/pressure/memory
    as comma-separated list: some_avg10,some_avg60,some_avg300,some_total,full_avg10,full_avg60,full_avg300,full_total
  type: string
  scope: ping

LauncherProcessState:
  description: >
    Launcher process enabled state. The integer value of this annotation must
    match with one of the values in the
    mozilla::LauncherRegistryInfo::EnableState enum
  type: u32
  scope: report

LowPhysicalMemoryEvents:
  description: >
    Number of times the available memory tracker has detected that free
    physical memory is running low. This is a Windows-specific annotation.
  type: u32
  scope: ping
  skip_if: "0"
  glean:
    metric: memory.low_physical
    type: quantity
    unit: events

MainThreadRunnableName:
  description: >
    Name of the currently executing nsIRunnable on the main thread.
  type: string
  scope: ping

MinidumpSha256Hash:
  description: >
    The sha256 hash of the minidump file, if available.
  type: string
  scope: ping

ModuleSignatureInfo:
  description: >
    A string holding a JSON object describing which entity signed the modules
    present in the system. The format of this object is:
    { "Vendor1": [ "Module1", "Module2", ...], "Vendor2": [ "Module3", ... ] }
  type: string
  scope: report

MozCrashReason:
  description: >
    Plaintext description of why Firefox crashed, this is usually set by
    assertions and the like.
  type: string
  scope: ping

NimbusEnrollments:
  description: >
    A comma-separated string that specifies the active Nimbus experiments and
    rollouts, as well as their branches.
  type: string
  scope: ping
  glean:
    metric: environment
    type: string_list
    delimiter: ","

Notes:
  description: >
    Miscellaneous notes that can be appended to a crash.
  type: string
  scope: report

OOMAllocationSize:
  description: >
    Size of the allocation that caused an out-of-memory condition.
  type: usize
  scope: ping
  skip_if: "0"
  glean:
    metric: memory
    type: quantity
    unit: bytes

PluginFilename:
  description: >
    Plugin filename, only the process holding the plugin has this annotation.
  type: string
  scope: report

PluginName:
  description: >
    Display name of a plugin, only the process holding the plugin has this
    annotation.
  type: string
  scope: report

PluginVersion:
  description: >
    Version of a plugin, only the process holding the plugin has this
    annotation.
  type: string
  scope: report

ProcessType:
  description: >
    Type of the process that crashed, the possible values are defined in
    GeckoProcessTypes.h.
  type: string
  scope: ping

ProductName:
  description: >
    Application name (e.g. Firefox).
  type: string
  scope: ping

ProductID:
  description: >
    Application UUID (e.g. ec8030f7-c20a-464f-9b0e-13a3a9e97384).
  type: string
  scope: ping

ProfileDirectory:
  description: >
    The directory of the active profile, if any.
  type: string

ProfilerChildShutdownPhase:
  description: >
    When a child process shuts down, this describes if the profiler is running,
    and the point the profiler shutdown sequence has reached.
  type: string
  scope: ping

PurgeablePhysicalMemory:
  description: >
    macOS only. Amount of physical memory currently allocated but which may
    be deallocated by the system in case of memory pressure. Populated from
    vm_statistics64_data_t::purgeable_count * vm_page_size.
  type: usize
  scope: ping
  glean:
    metric: memory.purgeable_physical
    type: quantity
    unit: bytes

QuotaManagerShutdownTimeout:
  description: >
    This annotation is present if the quota manager shutdown (resp. the shutdown
    of the quota manager clients) was not finished in time and the browser was
    crashed instead of waiting for the shutdown to finish. The status of objects
    which were blocking completion of the shutdown when reaching the timeout
    is contained in the annotation.

    In the case of IndexedDB, objects are divided into three groups:
    FactoryOperations, LiveDatabases and DatabaseMaintenances.

    In the case of LocalStorage, objects are divided into three groups:
    PrepareDatastoreOperations, Datastores and LiveDatabases.

    In the case of Cache API, objects are in one group only:
    Managers.

    Each group is reported separately and contains the number of objects in the
    group and the status of individual objects in the group (duplicate entries
    are removed):
    "GroupName: N (objectStatus1, objectStatus2, ...)" where N is the number of
    objects in the group.

    The status of individual objects is constructed by taking selected object
    properties. Properties which contain origin strings are anonymized.

    In addition, intermediate steps are recorded for change events after shutdown
    started. These include the time difference and the type of object.
  type: string
  scope: ping
  glean:
    type: object
    structure:
      type: array
      items:
        type: string

QuotaManagerStorageIsNetworkResource:
  description: >
    On Windows, this indicates if QM's base dir lives on a network resource.
    It is the direct result of the Win32 API function PathIsNetworkPath.
  type: boolean
  scope: report

RDDProcessStatus:
  description: >
    Status of the RDD process, can be set to "Running" or "Destroyed"
  type: string
  scope: report

ReleaseChannel:
  description: >
    Application release channel (e.g. default, beta, ...)
  type: string
  scope: ping
  glean:
    metric: crash.app_channel

RemoteAgent:
  description: >
    Set to 1 when the Remote Agent (WebDriver BiDi) is enabled.
  type: boolean
  scope: report

RemoteType:
  description: >
    Type of the content process, can be set to "web", "file" or "extension".
  type: string
  scope: ping

RosettaStatus:
  description: >
    True if Rosetta translation is being used.
  type: boolean
  scope: report

SafeMode:
  description: >
    Set to 1 if the browser was started in safe mode.
  type: boolean
  scope: report

SecondsSinceLastCrash:
  description: >
    Time in seconds since the last crash occurred.
  type: u64
  scope: ping
  glean:
    metric: crash.time_since_last_crash
    type: timespan
    time_unit: second
    custom_convert: duration_seconds

ServerURL:
  description: >
    URL used to post the crash report.
  type: string

ShutdownProgress:
  description: >
    Shutdown step at which the browser crashed, can be set to "quit-application",
    "profile-change-teardown", "profile-before-change", "xpcom-will-shutdown" or
    "xpcom-shutdown".
  type: string
  scope: ping

ShutdownReason:
  description: >
    One out of "Unknown", "AppClose", "AppRestart", "OSForceClose",
    "OSSessionEnd" or "OSShutdown".
  type: string
  scope: ping

SignalOrigin:
  description: >
    Process name of the source of the signal that caused the crash, if applicable.
    - On Linux, populated with the name of the process that sent a fatal signal
    to the crashing process, if it can be determined.
  type: string
  scope: report

StackTraces:
  description: >
    Stack traces extracted from the crash minidump, if available. A serialized
    JSON object (with a structure matching the associated Glean object description).
  type: string
  scope: ping
  glean:
    type: object
    # All addresses are hex strings rather than numbers.
    structure:
      type: object
      properties:
        # An error from the stack trace analysis, omitted if no errors occurred.
        error:
          type: string
        # The type of crash (SIGSEGV, assertion, etc)
        crash_type:
          type: string
        crash_address:
          type: string
        # Index of the crash thread
        crash_thread:
          type: number
        # Index of the main executable module.
        main_module:
          type: number
        # Modules ordered by base memory address.
        modules:
          type: array
          items:
            type: object
            properties:
              base_address:
                type: string
              end_address:
                type: string
              # Unique ID of the module
              code_id:
                type: string
              debug_file:
                type: string
              debug_id:
                type: string
              filename:
                type: string
              version:
                type: string
        # Stack traces for each thread.
        threads:
          type: array
          items:
            type: object
            properties:
              # Frames in the thread stack trace
              frames:
                type: array
                items:
                  type: object
                  properties:
                    # Index of the module that contains the frame
                    module_index:
                      type: number
                    # The instruction pointer of the frame
                    ip:
                      type: string
                    # Trust of the frame, one of "context", "prewalked", "cfi",
                    # "frame_pointer", "cfi_scan", "scan", or "none"
                    trust:
                      type: string

StartupCacheValid:
  description: >
    True if the startup cache was deemed valid and usable. Will be false if the
    last session used a different browser version or had a startup cache.
  type: boolean
  scope: report

StartupCrash:
  description: >
    If set to 1 then this crash occurred during startup.
  type: boolean
  scope: ping
  glean:
    metric: crash.startup

StartupTime:
  description: >
    The time when Firefox was launched expressed in seconds since the Epoch.
  type: u64
  scope: report

StorageConnectionNotClosed:
  description: >
    This annotation is added when a mozStorage connection has not been properly
    closed during shutdown. The annotation holds the filename of the database
    associated with the connection.
  type: string
  scope: report

SubmittedFrom:
  description: >
    This annotation can hold one of the following five values depending on how
    this crash was submitted by the user:
    * Auto: the user had opted-in to auto-submission
    * Infobar: the user clicked on the infobar to submit the crash
    * AboutCrashes: the user sent the crash from the about:crashes page
    * CrashedTab: the user sent the crash from a crashed tab page
    * Client: the user sent the crash using the crash reporter client
  type: string
  scope: report

SystemMemoryUsePercentage:
  description: >
    Windows-only, percentage of physical memory in use. This annotation is
    populated with the contents of the MEMORYSTATUSEX's structure dwMemoryLoad
    field.
  type: u32
  scope: ping
  glean:
    metric: memory.system_use_percentage
    type: quantity
    unit: percent

TelemetryClientId:
  description: >
    Telemetry client ID.
  type: string

TelemetryProfileGroupId:
  description: >
    Telemetry profile group ID.
  type: string

TelemetryEnvironment:
  description: >
    The telemetry environment in JSON format.
  type: string
  scope: report

TelemetryServerURL:
  description: >
    Telemetry server URL. Used to send main process crash pings directly from
    the crashreporter client.
  type: string

TelemetrySessionId:
  description: >
    Telemetry session ID.
  type: string

TestKey:
  description: >
    Annotation used in tests.
  type: string
  scope: report

TestUnicode:
  description: >
    Annotation used in tests.
  type: string
  scope: report

TestBoolean:
  description: >
    Annotation used in tests.
  type: boolean
  scope: report

TestInteger:
  description: >
    Annotation used in tests.
  type: u32
  scope: report

ThreadLastCreateError:
  description: >
    Diagnostic info recorded when PR_CreateThread fails. Contains the thread
    name, NSPR error code, and OS error code. Never cleared, so it reflects
    the last failure if there were multiple.
  type: string
  scope: report

TextureUsage:
  description: >
    Amount of memory in bytes consumed by textures.
  type: usize
  scope: ping
  skip_if: "0"
  glean:
    metric: memory.texture
    type: quantity
    unit: bytes

Throttleable:
  description: >
    Whether Socorro can selectively discard this crash report or not. If set
    to "0" the crash report will always be processed by Socorro. Do not set
    this annotation within Gecko code, it's only supposed to be used by the
    crash reporting machinery.
  type: boolean
  scope: report

TotalPageFile:
  description: >
    Maximum amount of memory that can be committed without extending the swap/page file.
    - Under Windows, populated with the contents of the PERFORMANCE_INFORMATION's
      structure CommitLimit field.
    - Under Linux, populated with /proc/meminfo MemTotal + SwapTotal. The swap file
      typically cannot be extended, so that's a hard limit.
    - Not available on other systems.
  type: usize
  scope: ping
  glean:
    metric: memory
    type: quantity
    unit: bytes

TotalPhysicalMemory:
  description: >
    Amount of physical memory in bytes.
    - Under Windows, populated with the contents of the MEMORYSTATUSEX's structure
    ullTotalPhys field.
    - Under macOS, populated with sysctl "hw.memsize".
    - Under Linux, populated with /proc/meminfo's "MemTotal".
    - Not available on other systems.
  type: usize
  scope: ping
  glean:
    metric: memory.total_physical
    type: quantity
    unit: bytes

TotalVirtualMemory:
  description: >
    Size of the virtual address space.
    - Under Windows, populated with the contents of the MEMORYSTATUSEX's structure
      ullTotalVirtual field.
    - Not available on other platforms.
  type: usize
  scope: ping
  glean:
    metric: memory.total_virtual
    type: quantity
    unit: bytes

UnknownNetAddrSocketFamily:
  description: >
    An unknown network address family was requested to Necko. The value is the
    requested family number.
  type: u32
  scope: report

UniFFILeakedCallbackId:
  description: >
    ID of the leaked callbacks when we force crash in `UniFFI.sys.mjs`
  type: u32
  scope: report

UptimeTS:
  description: >
    Uptime in seconds. This annotation uses a string instead of an integer
    because it has a fractional component.
  type: string # This is a floating-point number but we treat it as a string
  scope: ping
  glean:
    metric: environment.uptime
    type: timespan
    time_unit: millisecond

URL:
  description: >
    URL being loaded.
  type: string
  scope: report

URLSegments:
  description: >
    The offsets of the nsStandardURL segments that fail a sanity check
  type: string
  scope: report

User32BeforeBlocklist:
  description: >
    Set to 1 if user32.dll was loaded before we could install the DLL blocklist.
  type: boolean
  scope: ping
  skip_if: "0"
  glean:
    metric: dll_blocklist.user32_loaded_before

useragent_locale:
  description: >
    User-agent locale.
  type: string
  scope: report

UserFontRulesExhausted:
  description: >
    Set to "inside" if rules exhausted while adding fonts inside the user's dir,
    set to "outside" if adding for fonts outside the user's dir.
  type: string
  scope: report

UtilityProcessStatus:
  description: >
    Status of the Utility process, can be set to "Running" or "Destroyed"
  type: string
  scope: report

UtilityActorsName:
  description: >
    Comma-separated list of IPC actors name running on this Utility process instance
  type: string
  scope: ping
  glean:
    type: string_list
    delimiter: ","

Vendor:
  description: >
    Application vendor (e.g. Mozilla).
  type: string
  scope: report

Version:
  description: >
    Product version.
  type: string
  scope: ping
  glean:
    metric: crash.app_display_version

VRProcessStatus:
  description: >
    Status of the VR process, can be set to "Running" or "Destroyed"
  type: string
  scope: report

WasmLibrarySandboxMallocFailed:
  description: >
    Set to 1 if a rlbox wasm library sandbox ran out of memory, causing a
    malloc inside the sandbox to fail.
  type: boolean
  scope: report

WindowsFileDialogErrorCode:
  description: >
    The HRESULT returned from a Win32 system call leading to termination of the
    file-dialog utility process. MozCrashReason is expected to provide context
    for the value.
  type: u32 # This is an HRESULT which is defined as signed, but we don't want to print it as a signed integer
  scope: ping
  glean:
    metric: crash.windows.file_dialog_error_code
    type: string

WindowsPackageFamilyName:
  description: >
    If running in a Windows package context, the package family name, per
    https://docs.microsoft.com/en-us/windows/win32/api/appmodel/nf-appmodel-getcurrentpackagefamilyname.

    The package family name is only included when it is likely to have been produced by Mozilla: it
    starts "Mozilla." or "MozillaCorporation.".
  type: string
  scope: ping
  glean:
    metric: windows.package_family_name

WindowsErrorReporting:
  description: >
    Set to 1 if this crash was intercepted via the Windows Error Reporting
    runtime exception module.
  type: boolean
  scope: ping
  glean:
    metric: crash.windows.error_reporting

Winsock_LSP:
  description: >
    Information on winsock LSPs injected in our networking stack.
  type: string
  scope: report

XPCOMSpinEventLoopStack:
  description: >
    If we crash while some code is spinning manually the event loop on the
    main thread, we will see the stack of nested annotations here.
    If the crashing process was killed (e.g. due to an IPC error), this
    annotation may refer to the parent process that killed it, look out for
    the prefix ("default" means parent) and see bug 1741131 for details.
  type: string
  scope: report
