amule: --disable-fatal also skips the assertion dialog - #549
Merged
mrjimenez merged 1 commit intoMay 11, 2026
Merged
Conversation
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #355.
amule -d/--disable-fatalwas documented as "Do not handle fatal exception", but only gatedwxHandleFatalExceptions(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-dset, exactly as they noted in the issue.Fix
--disable-fatalto also short-circuitCamuleApp::OnAssertFailure. The assertion + backtrace still get logged viatheLogger.EmergencyLog()and printed to stderr; the only difference is we raiseSIGABRTdirectly instead of falling through towxApp::OnAssertFailure(which is the dialog source).__WXDEBUG__. Debian / Ubuntu's libwx packages ship withwxDEBUG_LEVEL=1, which keepswxASSERTlive 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.CamuleAppCommon::m_disableFatalsoOnAssertFailurecan consult it.Default behaviour (no flag) is unchanged: the dialog still appears for interactive users.
Scope
amulecmd,amuleweb, andamulegui(the external-connection apps) already abort-on-assertion viaCaMuleExternalConnector::OnAssertFailure, so they're untouched.amuledinheritsCamuleApp::OnAssertFailureand also benefits.Manpages
amule(1)andamuled(1)updated to describe the broader semantics:Verification
Single-file compile of
src/amule.cppandsrc/amuleAppCommon.cppclean on Ubuntu 26.04 ARM64 with the project's exact compile flags (extracted fromcompile_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-dand confirming the process now exits cleanly instead of blocking.Closes #355