Repository navigation
qt start: a native crash leaves every thread's Python stack in the errors folder - #2116
Merged
Merged
Conversation
…rors folder The phone's SIGSEGV at 03:48 (_QThreadWorker, a null pointer read inside libpython) left nothing Python could read: a fault in C kills the process before any handler. toad.fatal_trace.FatalTrace opens this run's fatal_<time>.txt under the errors folder first thing in both Qt entries, routes faulthandler (all threads) into it, and removes it at a clean exit when nothing was written. shipped_run checks, on the shipped interpreter, that both entries open it, that a clean run leaves no file, and that a faulted run writes every thread's stack there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…thout a result
The phone's ConnectorObserverClosed at 03:46 ('the local side stopped reading (BlockingIOError)') means the relay's local write accepted no byte for its 30 s SO_SNDTIMEO: the UI's reader took nothing for 30 s, while the frame probe shows the UI loop never stalled past 311 ms. Starvation of qasync's executor doesn't reproduce on the desktop at phone throttle (peak 3 of 10 workers busy over a history drive), so the cause is not settled. ObservationRetry now owns when the last result reached the UI (arrived), and the outage the reader is told about carries that age as a note in its saved traceback, so the next one says whether the reader went quiet for the whole deadline. The bus switch keeps recovered(), which isn't an arrival.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
trissim
force-pushed
the
fork-android-worker-segv
branch
from
November 18, 2026 09:46
5aa1735 to
b0d4ba9
Compare
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.
The phone crashed at 03:48 with
SIGSEGVin qasync's_QThreadWorker(a null pointer read inside libpython) and left nothing Python could read: a fault in C kills the process before any handler runs, sopaths.save_errornever sees it.What changed
toad.fatal_trace.FatalTrace(new, shared): opens this run'sfatal_<time>.txtunder the errors folder, routesfaulthandler(all threads) into it and keeps it open for the life of the process. At a clean exit it disables tracing and removes the file when nothing was written, so afatal_*file exists only for a run that crashed.toad.qt.android.main,toad.qt.main.main) callFatalTrace.enabled()first, before Qt starts.tools/android/shipped_run.pychecks, on the shipped interpreter and bundle:mainopen the trace;fatal_*file;faulthandler._sigsegv()) exits with -11 and leaves a trace holding "Segmentation fault" and "Current thread".Also: an observation outage says how long the UI had gone without a result
The phone's
ConnectorObserverClosedat 03:46 ("the local side stopped reading (BlockingIOError)") is the relay'sSO_SNDTIMEO, which resets on every accepted byte. So the UI's reader took nothing for 30 s, while the frame probe shows the UI loop never stalled past 311 ms. I measured qasync's executor at phone throttle over a history drive with the in-thread renderer: at most 3 of its 10 workers were busy, never all 10, and the worst queue wait was 291 ms. So executor starvation doesn't reproduce and I'm not claiming it.ObservationRetrynow owns when the last result reached the UI (arrived). The outage the reader is told about carries that age as a note in its saved traceback, so the next one says whether the reader went quiet for the whole deadline. The bus switch keepsrecovered(), which isn't an arrival.Evidence
threading.pyframes and the main thread's, plus the C stack.tools/android/check.shwithPYTHONFAULTHANDLER=1: exit 0. It ran every view kind and bound key on a scratch bus (with qt themes: Qt offers only the schemes it can draw; one failing setting no longer stops a start #2115's ansi-dark start), and the new fault-trace check passed;qt_drivearrivalandhistory: exit 0, no error files.What it found already
I symbolized the 03:48 crash with the NDK's
llvm-addr2lineagainst the build's ownlibpython3.14.so. The chain is_PyObject_IS_GC←mark_stacks←gc_collect_increment←_Py_HandlePending: CPython 3.14.2's incremental GC, in a worker thread that was building a tuple from a generator. The fix (Android's Python at the runtime's 3.14.8, where 3.14.5 reverted the incremental GC) is a separate PR; this one only makes the next native crash readable.🤖 Generated with Claude Code
https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3