Skip to content

feat(crashhandler): added crash handler for exceptions handling on runtime#551

Open
JeanPhilippeKernel wants to merge 1 commit into
developfrom
user/kernel/crash-handler
Open

feat(crashhandler): added crash handler for exceptions handling on runtime#551
JeanPhilippeKernel wants to merge 1 commit into
developfrom
user/kernel/crash-handler

Conversation

@JeanPhilippeKernel

@JeanPhilippeKernel JeanPhilippeKernel commented Jul 6, 2026

Copy link
Copy Markdown
Owner

This PR addresses the crash-handler design doc : crash-handler design doc
For this implementation, we skipped the upload section since it will require setting up a logging platform

@JeanPhilippeKernel JeanPhilippeKernel requested a review from jnyfah July 6, 2026 03:43
@JeanPhilippeKernel JeanPhilippeKernel self-assigned this Jul 6, 2026
@JeanPhilippeKernel JeanPhilippeKernel added area-linux Work on Linux system area-window Work on Window system area-macOS Work on macOS system labels Jul 6, 2026
@JeanPhilippeKernel JeanPhilippeKernel added this to the Born baby (0.3.0) milestone Jul 6, 2026
@JeanPhilippeKernel JeanPhilippeKernel force-pushed the user/kernel/crash-handler branch from 8c1b074 to 0d01f9a Compare July 6, 2026 03:46
@JeanPhilippeKernel JeanPhilippeKernel changed the title feat: crash handler implementation for windows feat(crashhandler): added crash handler for exceptions handling on runtime Jul 6, 2026
@JeanPhilippeKernel JeanPhilippeKernel moved this to In Progress in ZEngine Board Jul 6, 2026
@JeanPhilippeKernel JeanPhilippeKernel force-pushed the user/kernel/crash-handler branch 7 times, most recently from 35e4303 to 68f1093 Compare July 8, 2026 08:30
@JeanPhilippeKernel JeanPhilippeKernel marked this pull request as ready for review July 9, 2026 09:49
@JeanPhilippeKernel JeanPhilippeKernel force-pushed the user/kernel/crash-handler branch 4 times, most recently from b1c7eec to d0c571c Compare July 11, 2026 10:20
… log, and crash dialog

- Install/Uninstall signal handlers (Linux/macOS) and SEH filter (Windows)
- Capture backtrace on crashing thread in signal handler; overwrite frame 0
  with faulting PC from ucontext_t so the log points at the crash site
- OnCrash() captures call-site stack before waking the worker thread
- Crash log header includes App, Date, OS, Arch, CPU, and signal/exception
- Crash dialog: GTK3 (dlopen, no compile-time dep) on Linux with zenity/kdialog
  fallback; native Cocoa window on macOS (two paths: signal vs OnCrash);
  native Win32 window on Windows
- Windows: minidump written via MiniDumpWriteDump; 32KB stack trace buffer;
  DuplicateHandle with pseudo-handle fallback
- PreCrashCallback with 2-second timeout; pthread_join on completion,
  pthread_detach on timeout
- ZENGINE_VALIDATE_ASSERT wired to OnAssertionFailure in Release/RelWithDebInfo
- CrashDialogDemo and CrashHandler_test scoped to Release/RelWithDebInfo builds
- Alt-stack uses fixed 32KB constant (SIGSTKSZ non-constexpr on glibc 2.34+)
@JeanPhilippeKernel JeanPhilippeKernel force-pushed the user/kernel/crash-handler branch from d0c571c to f3851d1 Compare July 11, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-linux Work on Linux system area-macOS Work on macOS system area-window Work on Window system

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

1 participant