mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-08 02:53:25 -08:00
[CrashReporting] Breakpad everywhere, session detection, symbol CI (inc 3)
Breakpad on all platforms (no crashpad packaging); remove the Windows MiniDumpWithFullMemory filter and the installer WER LocalDumps full-dump registration. QLockFile per-process session tracking replaces the Windows-only .dmp scan, placed after parser.process and the instance hand-off so help/version exits and handed-off secondaries never leak a lock. CI: Release-only DSN bake from SENTRY_DSN secret, tag-only sentry-cli symbol upload (org cockatrice, project native). Tests: 533/533 ctest green, format clean, code gate PASS.
This commit is contained in:
parent
69b421f1c2
commit
c40763e61d
8 changed files with 362 additions and 102 deletions
|
|
@ -46,12 +46,14 @@ if(WITH_CRASH_REPORTING AND WITH_CLIENT)
|
|||
if(ENABLE_SANITIZERS)
|
||||
# The crash handler cannot run under ASan/UBSan, so there is no backend to capture with.
|
||||
set(_sentry_backend "none")
|
||||
elseif(WIN32 OR APPLE)
|
||||
# Out-of-process handler; shipping the handler binary is a later increment, which unifies
|
||||
# every OS on breakpad (in-process, no extra binary to ship).
|
||||
set(_sentry_backend "crashpad")
|
||||
else()
|
||||
# In-process, no extra binary to ship.
|
||||
# Breakpad on every OS (increment 3 probe, 2026-10-14): the crashpad sources
|
||||
# do vendor friction-free (FetchContent inits all submodules recursively by
|
||||
# default, verified populated in a local build tree), but the crashpad backend
|
||||
# would need its out-of-process crashpad_handler binary installed next to the
|
||||
# exe, into the macOS bundle, and through NSIS, plus handler-path wiring and
|
||||
# notarization care. Breakpad is in-process, needs no extra binary and no
|
||||
# packaging on any OS sentry-native builds, so simplicity wins.
|
||||
set(_sentry_backend "breakpad")
|
||||
endif()
|
||||
# FORCE so toggling ENABLE_SANITIZERS on a reused build dir cannot leave a stale backend behind.
|
||||
|
|
@ -61,6 +63,18 @@ if(WITH_CRASH_REPORTING AND WITH_CLIENT)
|
|||
)
|
||||
unset(_sentry_backend)
|
||||
|
||||
if(NOT MSVC)
|
||||
# Symbol upload needs debug info in Release binaries: the top-level flags build GCC
|
||||
# Release as -s -O2 (stripped, no DWARF) and Clang/Apple Release as plain -O2 (no DWARF),
|
||||
# both of which upload nothing useful. Keep -g and drop the strip flag while the SDK is
|
||||
# on; the OFF default leaves local, distro and Debug builds untouched. MSVC already
|
||||
# links /DEBUG with PDBs in release (see top-level CMakeLists.txt), so it needs nothing.
|
||||
string(REGEX REPLACE "(^| )-s( |$)" "\\1\\2" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
if(NOT CMAKE_CXX_FLAGS_RELEASE MATCHES "(^| )-g( |$)")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -g")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# No Qt integration: it runs find_package(Qt6) inside the vendored build, which
|
||||
# cannot see our thin/aqt Qt layouts (macOS CI) under foreign toolchains, and its
|
||||
# breadcrumbs could carry unredacted log lines into native crash events that bypass
|
||||
|
|
|
|||
|
|
@ -1530,11 +1530,18 @@ ${If} $PortableMode = 0
|
|||
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
|
||||
IntFmt $0 "0x%08X" $0
|
||||
|
||||
; Enable Windows User-Mode Dumps
|
||||
; No Windows Error Reporting LocalDumps registration: crash capture belongs to
|
||||
; the in-app reporter (Sentry/breakpad, MiniDumpNormal-class data only). Opting
|
||||
; machines into OS-level full dumps (DumpType 2) would leave unredacted memory
|
||||
; dumps on user machines that nothing consumes.
|
||||
; https://learn.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps
|
||||
WriteRegExpandStr HKLM "Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\cockatrice.exe" "DumpFolder" "%LOCALAPPDATA%\CrashDumps\Cockatrice"
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\cockatrice.exe" "DumpCount" "5"
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\cockatrice.exe" "DumpType" "2"
|
||||
|
||||
; Older installers did register cockatrice.exe above (and the removed
|
||||
; MiniDumpWithFullMemory writer filled that folder), and that key survives this
|
||||
; install, so WER would keep writing full dumps. Remove it, and clear the
|
||||
; legacy dumps nothing consumes anymore.
|
||||
DeleteRegKey HKLM "Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\cockatrice.exe"
|
||||
RMDir /r "$LOCALAPPDATA\CrashDumps\Cockatrice"
|
||||
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "DisplayIcon" "$INSTDIR\cockatrice.exe"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "DisplayName" "Cockatrice"
|
||||
|
|
@ -1635,6 +1642,12 @@ Section "un.Application" UnSecApplication
|
|||
|
||||
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice"
|
||||
|
||||
; Leftover WER LocalDumps key from pre-Sentry installers (see the installer note
|
||||
; above): removing it here covers machines that uninstall without reinstalling.
|
||||
; The legacy full-memory dumps go with it; nothing consumes them anymore.
|
||||
DeleteRegKey HKLM "Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\cockatrice.exe"
|
||||
RMDir /r "$LOCALAPPDATA\CrashDumps\Cockatrice"
|
||||
|
||||
; Only remove the file/protocol associations if we registered them (i.e. the
|
||||
; install was not portable) and .cod is still owned by Cockatrice, so we don't
|
||||
; clobber a .cod association installed by another application.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue