Skip to content

Native crash capture - #184

Merged
turtledreams merged 15 commits into
stagingfrom
native-crash-capture
Dec 1, 2026
Merged

turtledreams merged 15 commits into
stagingfrom
native-crash-capture

Conversation

@turtledreams

@turtledreams turtledreams commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Adds native crash reporting to the C++ SDK in two steps: sending crash dumps that a crash tool wrote, and an optional built-in crash handler.

What it does

  • setCrashDumpDirectory(path): at start(), every *.dmp file in the directory is sent as an unhandled crash ("_native_cpp": true, the Base64 dump in _error, never cut by the internal limits) and the file is deleted.
    • Without the crashes consent, the file is deleted without being sent.
    • While the SDK behavior setting "Allow Crash Tracking" (crt) is off, the files stay for a later start.
    • The dump is deleted before its crash is queued. A dump that the SDK can't delete, such as a read-only file, stays and is not sent, with an error log, because each start would send it again.
    • The crash report carries the time of the crash from the dump's header, not the time of the next start.
    • Before a Linux dump is sent, its command line and environment streams are overwritten with zero bytes, because they can carry secrets such as tokens.
    • A dump over 10 MB is deleted with an error log: such a file is usually a full memory dump, not a minidump.
    • Only the default instance handles native crashes, because they belong to the whole process.
    • Links in the directory are never read. The API docs ask for a directory that only the app writes (for Windows Error Reporting, a DumpFolder of the app's own LocalDumps key, because the default folder holds the dumps of every program).
    • The directory takes the dumps of the SDK's handler or of another tool such as LocalDumps, but not of both: the SDK's handler passes each crash on, so the other tool would write a second dump of the same crash. The API docs say so.
    • With requests kept in memory only, start() logs a warning: a crash whose request is not sent before the app ends is lost.
    • Each dump is claimed before it is read (an open without sharing on Windows, flock elsewhere), so processes of the app that share the directory send it once; a dump that another process holds stays for that process.
  • enableCrashReporting() with the CMake option COUNTLY_USE_BREAKPAD (off by default; Windows and Linux, refused at configure time on other systems): the SDK's Breakpad handler writes dumps from start() until stop(), while the crashes consent is given and crt is on. The SDK behavior setting "Allow Automatic Crash Reporting" (acr) turns it on and off.
    • After the dump is written, the handler that was installed before runs, so the exit status and core dumps do not change.
    • The handler is installed once and stays for the life of the process; stop(), a removed consent, acr and crt only turn it off through its filter. Destroying it would put back the handlers of its first install over handlers that other code installed later, and on Linux would free the signal stack of the installing thread when another thread turned it off. Its dump directory stays the one of the first start.
    • The API docs ask apps to keep the SDK's library loaded: after FreeLibrary() or dlclose(), the installed handlers would point into the unloaded library.
    • On Windows only Breakpad's exception filter is installed. The SDK handles abort() (also pure virtual calls) and, with MSVC, invalid CRT parameters when the app has no handler of its own, because Breakpad's own CRT handlers end the process with exit code 0. These handlers work in code that uses the same C runtime DLL as the SDK, not with the static runtime (/MT), which the API docs say. On 64-bit Windows, their dump starts at the frame that called abort() or the C runtime function, past the SDK's handler and the C runtime frames, so the server names the crash by the app's frame. With MinGW, the process ends with exit code 3 right after the dump, instead of the C runtime's exit, which can hang in library detach code.
    • On Windows, fail-fast crashes (heap corruption that Windows finds, a failed /GS stack check, __fastfail()) give no dump: Windows ends the process before a handler in the process runs. The API docs and the CHANGELOG say so.
    • On Linux, the handler replaces the values on the thread stacks that are no pointers, such as environment strings.
    • MinGW builds capture crashes, but dump_syms can't make symbols that match their dumps, because MinGW binaries carry no debug ID.
    • Without setCrashDumpDirectory(), the handler captures nothing, so start() logs a warning.
  • Large requests on slow connections: a request gets one more second for every 16 KB of its body, on top of libcurl's 30-second request timeout or WinHTTP's 10-second send and receive timeouts, so a 10 MB dump on a slow connection arrives and the requests behind it are sent. After stop(), a request in progress ends once it took 30 seconds: libcurl through its progress callback, WinHTTP by closing the request handle from stop(). Request bodies go into debug logs only when a log listener is set.
  • The crash-time breadcrumbs and app version are kept in a 64 KB memory block that every dump contains, and the next start reads them back into _logs and the five device metrics. Each new breadcrumb finds the newest breadcrumbs that fit in one pass.
  • The Breakpad client is vendored in vendor/breakpad by scripts/update_breakpad.py (pinned commits in its README) and added to the SBOM. It compiles as a C++17 object library inside the countly library; the SDK itself still builds with C++14.

Success criteria

Criterion How it was checked
A dump in the directory is sent at start, unchanged, then deleted tests/native_crash.cpp
Consent, crt, the size limit, empty dumps, other files and named instances behave as above tests/native_crash.cpp
The handler follows enableCrashReporting, the consent, acr, crt and stop() tests/native_crash.cpp (Breakpad builds)
A crash handler that other code installs after start() stays when the SDK's handler is turned off; turning it off on another thread keeps the signal stack of the thread that started the SDK; after stop() a crash writes no dump and the earlier handler runs tests/native_crash.cpp with tests/native_crash_helper.cpp (Breakpad builds)
With 1,000 breadcrumbs of 1,000 characters, addBreadcrumb stays fast and the memory block keeps the newest that fit tests/native_crash.cpp (Breakpad builds)
A link named like a dump is neither sent nor deleted; only the device metrics are taken from a dump's memory block; a memory-only queue logs the warning tests/native_crash.cpp
A crash in a child process (segmentation fault, abort(), uncaught exception, pure virtual call; invalid CRT parameter with MSVC) gives one dump, the earlier handler still runs, the exit status is unchanged, and the next start sends it with the breadcrumbs and app version tests/native_crash.cpp with tests/native_crash_helper.cpp (Breakpad builds)
An app whose own handler tolerates an invalid CRT parameter keeps running, and no dump is written same (MSVC)
Processes that share the dump directory send a dump once; a dump that another process holds is neither sent nor deleted tests/native_crash.cpp; two app processes started together on one shared folder: one crash request in 4 of 4 runs on Linux and 3 of 3 on Windows (before: two)
A request of about 200 KB arrives over a connection too slow for the plain timeouts; stop() ends a large request in progress once it took the request timeout tests/request.cpp with its local server reading at 32 and 8 KB/s, for libcurl and WinHTTP; a 10 MB dump at 100 KB/s arrived after 154 s on Linux and 162 s on Windows (before: given up after about 15 to 33 s at every attempt)
A Linux dump's command line and environment are sent as zero bytes and every other byte stays; the crash of a process with a secret environment variable reaches the server without it tests/native_crash.cpp: a dump with these streams, and a crash in a child process with a secret variable (it also fails without the stack sanitizer)
A native crash is sent with the time from the dump's header; a dump without a time, or with one later than now, gets the current time tests/native_crash.cpp
A dump that the SDK can't delete (a read-only file on Windows, a directory without write permission elsewhere) is not sent and stays; once it can be deleted, the next start sends it once tests/native_crash.cpp
enableCrashReporting() without setCrashDumpDirectory() gives a warning at start(); with a directory, no warning tests/native_crash.cpp
On 64-bit Windows, the dump of an abort(), a pure virtual call or an invalid CRT parameter starts in the app's own module tests/native_crash.cpp reads the crash context and the module list of the dump, with MSVC and MinGW
With MinGW, abort(), an uncaught exception and a pure virtual call end with exit code 3 right after the dump a MinGW build of a crash program: exit code 3 at once for all three (before: the process hung)
The server groups and symbolicates the dumps Windows (MSVC, MinGW), Linux and macOS (arm64, a dump of Breakpad's macOS client sent with setCrashDumpDirectory) crashes sent to a local Countly server: ingested as fatal native crashes with the crash time and the breadcrumbs, then symbolicated to function and line with dump_syms symbols uploaded from the dashboard; MinGW crashes stay unsymbolicated

Tests run

  • MSVC 19.51 Release, Breakpad on: full suite 230/230
  • MinGW (GCC 10.3), Breakpad on: the test cases of tests/native_crash.cpp, 35/35 (a MinGW test build links winhttp and ws2_32 and sets _WIN32_WINNT=0x0600)
  • GCC 9.4, Breakpad on: full suite 230/230
  • macOS: CI (macos-15); COUNTLY_USE_BREAKPAD=ON is refused at configure time
  • End to end: Windows, Linux and macOS crashes on a local Countly server, see the success criteria
  • A 10 MB dump at 100 KB/s, and two processes that start together on one shared dump folder: Linux (libcurl) and Windows (WinHTTP), results in the success criteria

CI change

.github/workflows/tests.yml gets a Linux flavor breakpad and a job breakpad-windows (windows-2025, MSVC Release). Before, no job built with COUNTLY_USE_BREAKPAD, so the crash tests in a child process would not run in CI. Cost: two more jobs per run.

The local HTTP server of tests/request.cpp now also runs on Windows, so the built-in HTTP client tests run with WinHTTP in the Windows jobs too (about 30 seconds more per Windows job).

Static analysis

api/countly-sdk-cpp.api records the new public methods and fields (additions only). Findings on calls the code needs are suppressed on their line with the reason: MultiByteToWideChar (UTF-8 paths for the wide Windows APIs), realpath (allocating form, no fixed buffer), readdir (a directory stream local to the call), open in the test helper's signal handler (async-signal-safe), open and read of a claimed dump (O_NOFOLLOW, read through the locked descriptor), stat structures and calls for cppcheck's y2038 addon (only the file type, links, size and identity are read), MISRA 12.3 on argument and template commas (no comma operator), and subprocess in scripts/update_breakpad.py (fixed git commands, no shell).

Compatibility

No breaking change: new methods and a build option that is off by default. RequestBuilder::buildRequest and RequestModule::addRequestToQueue get an overload that takes the time of the request. Default builds compile none of the vendored code. Requests with a body of 16 KB or more get more time before they fail; with WinHTTP, stop() can now wait up to 30 seconds for such a request in progress, the same limit as with libcurl.

Related: Countly/countly-platform#3770 (symbol upload platforms for Windows, Linux and macOS native crashes)

Adds the in-process crash handler client of Google Breakpad for Linux and Windows, with the linux-syscall-support header, under vendor/breakpad. scripts/update_breakpad.py fetches both at given commits, copies only the client sources and the headers they include, and writes sources.cmake and the README. Nothing compiles these files yet.
setCrashDumpDirectory() sends every minidump in a directory at start() as an unhandled native crash and deletes the file. enableCrashReporting() with the COUNTLY_USE_BREAKPAD build option installs a Breakpad handler on Windows and Linux that writes the minidump, with the breadcrumbs and app version of the crash moment, and then hands the crash to the handler installed before it.
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

CI report

Check Result Summary
CodeQL ✅ passed
Package Managers ✅ passed
Public API changelog ✅ passed
Public API changes ✅ passed Public API: 0 removed or changed, 12 added
Run Tests ✅ passed Coverage: Line coverage 86.1%
Static analysis ✅ passed No new findings
Public API changes: Public API, 0 removed or changed, 12 added

Added: 12. Check that each one is meant to be public.

cly::ConfigurationModule::getAutomaticCrashReporting method int () const public
cly::Countly::CrashReportingSettingsChanged method void () public
cly::Countly::enableCrashReporting method void () public
cly::Countly::setCrashDumpDirectory method void (const std::string &) public
cly::CountlyConfiguration::automaticCrashReporting field bool public
cly::CountlyConfiguration::crashDumpDirectory field std::string public
cly::CountlyDelegates::CrashReportingSettingsChanged method void () virtual public
cly::CrashData::nativeCrash field bool public
cly::LoggerModule::isListening method bool () const public
cly::RequestBuilder::buildRequest method std::string (const std::map<std::string, std::string> &, std::chrono::system_clock::time_point) public
cly::RequestModule::addRequestToQueue method void (const std::map<std::string, std::string> &, std::chrono::system_clock::time_point) public
cly::RequestModule::limitSendTime method void () public
Run Tests: Coverage, Line coverage 86.1%

Unit test coverage

Metric Covered Count
lines 86.1% 4353/5056
functions 92.6% 523/565
branches 50.8% 5594/11017
Static analysis, No new findings

clang-tidy: 75 findings

Rule Level Count Description
performance-unnecessary-value-param warning 55 https://clang.llvm.org/extra/clang-tidy/checks/performance/unnecessary-value-param.html
performance-no-int-to-ptr warning 6 https://clang.llvm.org/extra/clang-tidy/checks/performance/no-int-to-ptr.html
bugprone-narrowing-conversions warning 4 https://clang.llvm.org/extra/clang-tidy/checks/bugprone/narrowing-conversions.html
bugprone-implicit-widening-of-multiplication-result warning 3 https://clang.llvm.org/extra/clang-tidy/checks/bugprone/implicit-widening-of-multiplication-result.html
performance-enum-size warning 3 https://clang.llvm.org/extra/clang-tidy/checks/performance/enum-size.html
performance-for-range-copy warning 3 https://clang.llvm.org/extra/clang-tidy/checks/performance/for-range-copy.html
performance-avoid-endl warning 1 https://clang.llvm.org/extra/clang-tidy/checks/performance/avoid-endl.html

First 50 findings

Location Rule Message
include/countly.hpp:573 performance-for-range-copy loop variable is copied but only used as const reference; consider making it a const reference
include/countly.hpp:583 performance-for-range-copy loop variable is copied but only used as const reference; consider making it a const reference
include/countly.hpp:593 performance-for-range-copy loop variable is copied but only used as const reference; consider making it a const reference
include/countly.hpp:978 performance-enum-size enum 'ConsentChangeSource' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base t
include/countly/constants.hpp:121 bugprone-narrowing-conversions narrowing conversion from 'size_type' (aka 'unsigned long') to signed type 'int' is implementation-defined
include/countly/countly_configuration.hpp:13 performance-enum-size enum 'DeviceIdType' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to
include/countly/countly_configuration.hpp:201 performance-unnecessary-value-param the const qualified parameter 'appKey' is copied for each invocation; consider making it a reference
include/countly/countly_configuration.hpp:203 performance-unnecessary-value-param parameter 'serverUrl' is passed by value and only copied once; consider moving it to avoid unnecessary copies
include/countly/logger_module.hpp:8 performance-enum-size enum 'LogLevel' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to redu
include/countly/storage_module_base.hpp:42 performance-unnecessary-value-param parameter 'config' is passed by value and only copied once; consider moving it to avoid unnecessary copies
include/countly/storage_module_base.hpp:43 performance-unnecessary-value-param parameter 'logger' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/configuration_module.cpp:127 performance-unnecessary-value-param parameter 'config' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/configuration_module.cpp:127 performance-unnecessary-value-param parameter 'logger' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/configuration_module.cpp:127 performance-unnecessary-value-param parameter 'requestBuilder' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/configuration_module.cpp:127 performance-unnecessary-value-param parameter 'storageModule' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/configuration_module.cpp:127 performance-unnecessary-value-param parameter 'requestModule' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/configuration_module.cpp:127 performance-unnecessary-value-param parameter 'mutex' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/configuration_module.cpp:520 performance-unnecessary-value-param the parameter 'session_params' is copied for each invocation but only used as a const reference; consider making it a const reference
src/configuration_module.cpp:575 performance-unnecessary-value-param parameter 'config' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/configuration_module.cpp:575 performance-unnecessary-value-param parameter 'logger' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/configuration_module.cpp:575 performance-unnecessary-value-param parameter 'requestBuilder' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/configuration_module.cpp:575 performance-unnecessary-value-param parameter 'storageModule' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/configuration_module.cpp:575 performance-unnecessary-value-param parameter 'requestModule' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/configuration_module.cpp:575 performance-unnecessary-value-param parameter 'mutex' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/configuration_module.cpp:581 performance-unnecessary-value-param the parameter 'session_params' is copied for each invocation but only used as a const reference; consider making it a const reference
src/configuration_module.cpp:611 performance-unnecessary-value-param parameter 'session_params' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/countly.cpp:269 performance-unnecessary-value-param the parameter 'fetch' is copied for each invocation but only used as a const reference; consider making it a const reference
src/countly.cpp:747 performance-unnecessary-value-param parameter 'fun' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/countly.cpp:757 performance-unnecessary-value-param parameter 'fun' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/countly.cpp:1299 performance-unnecessary-value-param parameter 'callback' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/countly.cpp:2900 bugprone-implicit-widening-of-multiplication-result result of multiplication in type 'int' is used as a pointer offset after an implicit widening conversion to type 'ptrdiff_t'
src/countly.cpp:2986 performance-no-int-to-ptr integer to pointer cast pessimizes optimization opportunities
src/crash_module.cpp:33 performance-unnecessary-value-param parameter 'config' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/crash_module.cpp:33 performance-unnecessary-value-param parameter 'logger' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/crash_module.cpp:33 performance-unnecessary-value-param parameter 'requestModule' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/crash_module.cpp:33 performance-unnecessary-value-param parameter 'mutex' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/crash_module.cpp:177 performance-unnecessary-value-param parameter 'config' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/crash_module.cpp:177 performance-unnecessary-value-param parameter 'logger' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/crash_module.cpp:177 performance-unnecessary-value-param parameter 'requestModule' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/crash_module.cpp:177 performance-unnecessary-value-param parameter 'mutex' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/health_check_module.cpp:73 performance-unnecessary-value-param parameter 'logger' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/health_check_module.cpp:87 performance-unnecessary-value-param the parameter 'storage' is copied for each invocation but only used as a const reference; consider making it a const reference
src/logger_module.cpp:41 performance-unnecessary-value-param parameter 'logger' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/logger_module.cpp:94 performance-avoid-endl do not use 'std::endl' with streams; use '\n' instead
src/logger_module.cpp:104 performance-unnecessary-value-param the parameter 'healthCheck' is copied for each invocation but only used as a const reference; consider making it a const reference
src/request_builder.cpp:38 performance-unnecessary-value-param parameter 'config' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/request_builder.cpp:38 performance-unnecessary-value-param parameter 'logger' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/request_module.cpp:122 performance-unnecessary-value-param parameter 'config' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/request_module.cpp:122 performance-unnecessary-value-param parameter 'logger' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/request_module.cpp:122 performance-unnecessary-value-param parameter 'requestBuilder' is passed by value and only copied once; consider moving it to avoid unnecessary copies

New compared with the base branch: 0

No finding that the base branch does not have.

For 29fa040, updated 2026-12-01 06:19 UTC. Each check's run page has its full log.

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Public API changes

Added: 12. Check that each one is meant to be public.

cly::ConfigurationModule::getAutomaticCrashReporting method int () const public
cly::Countly::CrashReportingSettingsChanged method void () public
cly::Countly::enableCrashReporting method void () public
cly::Countly::setCrashDumpDirectory method void (const std::string &) public
cly::CountlyConfiguration::automaticCrashReporting field bool public
cly::CountlyConfiguration::crashDumpDirectory field std::string public
cly::CountlyDelegates::CrashReportingSettingsChanged method void () virtual public
cly::CrashData::nativeCrash field bool public
cly::LoggerModule::isListening method bool () const public
cly::RequestBuilder::buildRequest method std::string (const std::map<std::string, std::string> &, std::chrono::system_clock::time_point) public
cly::RequestModule::addRequestToQueue method void (const std::map<std::string, std::string> &, std::chrono::system_clock::time_point) public
cly::RequestModule::limitSendTime method void () public

Comment thread tests/native_crash_helper.cpp Fixed
Records the new methods and fields in api/countly-sdk-cpp.api. Replaces memcpy, stat, fopen, execl and octal modes in the native crash code and tests, calls the C++ runtime's pure virtual call handler directly in the crash helper, and suppresses the remaining findings on required calls (MultiByteToWideChar, realpath, open in a signal handler, readdir, subprocess) with their reason.
Moves the directory entry type check into the listing loop, so that no build configuration evaluates a condition that is always true.
The Breakpad handler is now created once and turned off with its filter
instead of being destroyed. Destroying it put back the handlers of its
first install over the handlers that other code installed later, and on
Linux it freed the signal stack of the installing thread when another
thread turned the handler off. Its dump directory stays the one of the
first start.

Also:
- The dump directory scan skips links: reparse points on Windows, and
  entries without a reported type are checked with lstat on POSIX.
- The context block takes the newest breadcrumbs that fit in one pass,
  instead of one JSON conversion for each breadcrumb left out.
- Only the five device metrics are taken from a dump's context block.
- start() warns while a crash dump directory is set and requests are
  kept in memory only.
cppcheck's y2038 addon flags every struct stat and lstat. The checks read only the file type, so the calls are suppressed on their lines with that reason.
- CrashData::nativeCrash tells the crash filter that the stack trace is a
  Base64-encoded minidump, which the server reads only unchanged.
- The vendored Breakpad is compiled under names of its own and with hidden
  visibility, so an app can link its own Breakpad next to the SDK.
- A 10 MB dump needs 42 to 58 MB of extra memory at start() instead of
  137 MB: the dump moves through the report, the request text is built in
  one string of exact size, and the debug logs that hold a whole request
  are built only while a log listener is set.
- The API docs say which threads get a signal stack for a dump of a stack
  overflow on Linux.
The addon reads the comma between the two template arguments as a comma operator (rule 12.3). Avoiding the declaration would bring back a copy of the dump, so the line is suppressed with that reason.
- A request gets one more second for every 16 KB of its body: libcurl on
  top of its 30-second request timeout, WinHTTP on top of its 10-second
  send and receive timeouts. After stop(), a request in progress ends
  once it took 30 seconds; stop() closes a WinHTTP request itself.
- Each dump is claimed before it is read (an open without sharing on
  Windows, flock elsewhere), so processes that share the directory send
  it once. A dump that can't be opened still logs an error.
- The enableCrashReporting() docs ask apps to keep the library loaded.
- sendHTTP copies a request into its debug logs only for a log listener.
- The local HTTP server of the tests also runs on Windows, so the
  built-in HTTP client tests run with WinHTTP too.
- DumpClaim::Result uses std::uint8_t as its base type.
- DumpClaim::read() is readAll(), which Flawfinder does not take for read().
- claimedPath is POSIX-only, the only place remove() reads it.
- The test helper's template commas carry MISRA 12.3 suppressions.
cppcheck reads src/native_crash.hpp alone, where claimedPath has no use;
claim() and remove() in native_crash.cpp set and read it.
- Before a dump is sent, the command line and environment streams of a Linux
  minidump are overwritten with zero bytes, and the SDK's Linux handler replaces
  the values on the thread stacks that are no pointers.
- The crash request carries the time of the crash from the dump's header:
  RequestBuilder::buildRequest and RequestModule::addRequestToQueue get an
  overload that takes the time of the request.
- On 64-bit Windows, the dump of an abort(), a pure virtual call or an invalid
  C runtime parameter starts at the frame that caused it, past the SDK's
  handler and the C runtime frames.
- With MinGW, the process ends with exit code 3 right after the dump of an
  abort(), instead of the C runtime's exit that can hang in library detach code.
- The API docs and the CHANGELOG name the C runtime limit on Windows, the SDK
  behavior settings, the reason for the 10 MB limit and the missing debug IDs
  of MinGW builds.
- The crash time variable no longer has the name of the C time() function,
  which cppcheck's y2038 addon read as a call.
- The request builder's existing time_t conversion and the test declarations
  with template argument commas get inline suppressions with their reason.
…ump directory

- The SDK deletes a native crash dump before it queues the crash. A dump that
  it can't delete, such as a read-only file, stays and is not sent, with an
  error log, because each start would send it again.
- start() logs a warning when enableCrashReporting() was called without
  setCrashDumpDirectory(): without a directory, no native crash is captured.
- The API docs and the CHANGELOG say that Windows fail-fast crashes (heap
  corruption that Windows finds, a failed /GS stack check, __fastfail()) give
  no dump, and that a crash dump directory takes the dumps of the SDK's handler
  or of another tool such as LocalDumps, but not of both.
@turtledreams
turtledreams merged commit b2918ce into staging Dec 1, 2026
54 checks passed
@turtledreams
turtledreams deleted the native-crash-capture branch December 1, 2026 10:20
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.

3 participants