Skip to content

Catch crashes and offer to report them - #1077

Open
nagisml wants to merge 2 commits into
OpenSAK-Org:betafrom
nagisml:feature/crash-reporter
Open

nagisml wants to merge 2 commits into
OpenSAK-Org:betafrom
nagisml:feature/crash-reporter

Conversation

@nagisml

@nagisml nagisml commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

@AgreeDK this is a proposal. Carefully judge provided options

Uncaught exceptions went to stderr, which a windowed build doesn't have, so they were lost, and a hard crash left no trace the user would find.

  • sys.excepthook / threading.excepthook log the traceback and show a "OpenSAK ran into a problem" dialog (Continue / Quit). Worker-thread exceptions are handed to the GUI thread through a queued signal. The same error shows the dialog only once per session.
  • faulthandler writes native crashes (segfaults in Qt/WebEngine) to crash_native.log.
  • A QLockFile session.lock is removed only on a clean exit. At the next start a lock left by a dead process means the last session crashed, and the user is offered a report with the native dump and the tail of opensak.log.previous. A second running instance is not taken for a crash.
  • The dialog shows the exact report text and can open a prefilled GitHub issue or a mail to ....@opensak.com, copy the report, or open the log folder so the log can be attached. Nothing is sent automatically; home paths, the user name, tokens and e-mail addresses are removed first.
  • New strings in all languages; tests in test_crash_report.py.

Uncaught exceptions went to stderr, which a windowed build doesn't have,
so they were lost, and a hard crash left no trace the user would find.

- sys.excepthook / threading.excepthook log the traceback and show a
  "OpenSAK ran into a problem" dialog (Continue / Quit). Worker-thread
  exceptions are handed to the GUI thread through a queued signal. The
  same error shows the dialog only once per session.
- faulthandler writes native crashes (segfaults in Qt/WebEngine) to
  crash_native.log.
- A QLockFile session.lock is removed only on a clean exit. At the next
  start a lock left by a dead process means the last session crashed,
  and the user is offered a report with the native dump and the tail of
  opensak.log.previous. A second running instance is not taken for a
  crash.
- The dialog shows the exact report text and can open a prefilled
  GitHub issue or a mail to hello@opensak.com, copy the report, or open
  the log folder so the log can be attached. Nothing is sent
  automatically; home paths, the user name, tokens and e-mail addresses
  are removed first.
- New strings in all languages; tests in test_crash_report.py.

This branch has not been deployed

No deployments
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.

1 participant