Skip to content

amule: --disable-fatal also skips the assertion dialog - #549

Merged
mrjimenez merged 1 commit into
amule-project:masterfrom
got3nks:fix/disable-fatal-skips-assert-dialog
May 11, 2026
Merged

amule: --disable-fatal also skips the assertion dialog#549
mrjimenez merged 1 commit into
amule-project:masterfrom
got3nks:fix/disable-fatal-skips-assert-dialog

Conversation

@got3nks

@got3nks got3nks commented May 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #355. amule -d / --disable-fatal was documented as "Do not handle fatal exception", but only gated wxHandleFatalExceptions(true) — the call that registers a CPU-fatal handler. wxWidgets assertion failures take an entirely different path (wxApp::OnAssertFailure) which pops up a modal "Assertion failed" dialog and blocks process exit until someone clicks it. The reporter's use case — auto-restart under systemd / a watchdog script — was therefore still defeated even with -d set, exactly as they noted in the issue.

Fix

  • Extend --disable-fatal to also short-circuit CamuleApp::OnAssertFailure. The assertion + backtrace still get logged via theLogger.EmergencyLog() and printed to stderr; the only difference is we raise SIGABRT directly instead of falling through to wxApp::OnAssertFailure (which is the dialog source).
  • Compile the override unconditionally instead of only under __WXDEBUG__. Debian / Ubuntu's libwx packages ship with wxDEBUG_LEVEL=1, which keeps wxASSERT live in release builds and otherwise routed straight to wxApp's default dialog — exactly the case the original reporter hit on Debian Bullseye and AntonioTrindade reproduced on Debian testing.
  • Store the parsed flag as CamuleAppCommon::m_disableFatal so OnAssertFailure can consult it.

Default behaviour (no flag) is unchanged: the dialog still appears for interactive users.

Scope

amulecmd, amuleweb, and amulegui (the external-connection apps) already abort-on-assertion via CaMuleExternalConnector::OnAssertFailure, so they're untouched. amuled inherits CamuleApp::OnAssertFailure and also benefits.

Manpages

amule(1) and amuled(1) updated to describe the broader semantics:

Don't catch fatal exceptions and don't block exit on assertions. Useful for headless / supervised setups (systemd, watchdog scripts) where the otherwise-modal assertion dialog prevents auto-restart.

Verification

Single-file compile of src/amule.cpp and src/amuleAppCommon.cpp clean on Ubuntu 26.04 ARM64 with the project's exact compile flags (extracted from compile_commands.json). I'd test the dialog skip end-to-end but it requires triggering an actual assertion under a desktop session — the more rigorous side of verification will come from anyone running the GUI build with -d and confirming the process now exits cleanly instead of blocking.

Closes #355

The -d / --disable-fatal switch was already documented as 'Do not
handle fatal exception', and gated wxHandleFatalExceptions(true).
But fatal-exception coverage doesn't include wxWidgets assertion
failures, so users running aMule under systemd or a watchdog script
(use case in amule-project#355) still got the modal 'Assertion failed' dialog
that blocks process exit until someone clicks it -- defeating
auto-restart entirely.

Extend --disable-fatal to also short-circuit
CamuleApp::OnAssertFailure: log the assertion + backtrace as before,
then raise SIGABRT directly instead of falling through to
wxApp::OnAssertFailure (which is the dialog source).

Side effect: the override now compiles unconditionally, not just in
__WXDEBUG__. Debian / Ubuntu's libwx packages ship with
wxDEBUG_LEVEL=1, which keeps wxASSERT live in release builds and
otherwise routed straight to wxApp's default dialog -- exactly the
case the original reporter hit on Debian Bullseye.

Default behaviour (no flag) is unchanged: the dialog still appears
for interactive users.

Manpages updated to describe the broader semantics. The amulecmd /
amuleweb / amulegui externals already abort-on-assertion via
CaMuleExternalConnector::OnAssertFailure, so they're untouched.

Closes amule-project#355
@mrjimenez
mrjimenez merged commit 61e07c9 into amule-project:master May 11, 2026
12 checks passed
@got3nks
got3nks deleted the fix/disable-fatal-skips-assert-dialog branch May 11, 2026 08:01
got3nks added a commit to got3nks/amule that referenced this pull request Jul 22, 2026
…mule-project#549)

Follow-up to amule-project#548 (Scintilla log panes). The tail-scroll landed short when log
lines wrap, because Scintilla lays out wrapped lines incrementally over several
idles, so a one-shot ScrollToEnd() ran against a display-line count that did
not yet include the still-unwrapped tail. Switching in mid-load made it worse:
each poll's batch also scrolled directly and the idle re-scroll loop misread
its own batch scroll as a manual scroll and gave up (~90%).

Make OnInternalIdle() the sole scroller: ScrollToBottom() only flags a pending
scroll, and the idle loop re-applies ScrollToEnd() until the first-visible line
stops moving (wrap settled at the true bottom), bailing only on a genuine
manual scroll. Appends never move the first-visible line, so it follows the
whole replay. In the base CMuleLogCtrl, so all three panes share it. Also
corrects a few amule-project#548 comments the rework left inaccurate. Reported in amule-project#547.
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.

Please allow close aMule when exception crash

2 participants