diff --git a/CHANGELOG.md b/CHANGELOG.md index 488c3f9a5..659c08705 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,9 @@ ## Unreleased **Fixes**: + - Honor checks before launching crash reporter ([#1906](https://github.com/getsentry/sentry-native/pull/1906)) +- Reduce the size of native-generated minidumps on Windows ([#1929](https://github.com/getsentry/sentry-native/pull/1929)) ## 0.16.0 diff --git a/src/backends/native/minidump/sentry_minidump_windows.c b/src/backends/native/minidump/sentry_minidump_windows.c index 3852de28b..6ab23965f 100644 --- a/src/backends/native/minidump/sentry_minidump_windows.c +++ b/src/backends/native/minidump/sentry_minidump_windows.c @@ -56,8 +56,16 @@ sentry__write_minidump( break; case SENTRY_MINIDUMP_MODE_SMART: - dump_type - = MiniDumpWithIndirectlyReferencedMemory | MiniDumpWithDataSegs; + // Only indirectly-referenced memory: dbghelp walks the stack and + // registers and captures a small window around each pointer that + // lands in mapped memory. We deliberately omit MiniDumpWithDataSegs + // here: it writes the entire writable data segment of *every* + // loaded module (all DLL .data/.bss), which is uncapped and + // dominates dump size — for large module graphs it produces dumps + // 10-30x larger than intended. Global/static data is rarely needed + // for crash triage; callers that want it can opt in via + // sentry_options_set_minidump_flags() or MODE_FULL. + dump_type = MiniDumpWithIndirectlyReferencedMemory; break; case SENTRY_MINIDUMP_MODE_FULL: diff --git a/tests/test_integration_native.py b/tests/test_integration_native.py index 92b29c185..6375b13ca 100644 --- a/tests/test_integration_native.py +++ b/tests/test_integration_native.py @@ -793,8 +793,8 @@ def test_native_smart_mode_captures_indirect_heap_memory(cmake, httpserver): appends a chunk around each writable-heap hit to MemoryListStream. * Windows: the native backend passes - ``MiniDumpWithIndirectlyReferencedMemory | MiniDumpWithDataSegs`` - to ``MiniDumpWriteDump`` so the OS does the equivalent scan. + ``MiniDumpWithIndirectlyReferencedMemory`` to + ``MiniDumpWriteDump`` so the OS does the equivalent scan. The minimal-mode fallback on macOS (when ``task_for_pid`` is blocked by the sandbox) silently breaks the SMART-mode contract by