mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 08:12:38 +00:00
Shutdown ordering bug (SIGABRT) #788
Labels
No labels
Android
Bug
Build system
Design suggestion
Doc
Needs design review
Needs rebase
Stage
UX
Up for grabs
Upstream
Wallet
duplicate
enhancement
good first issue
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml#788
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Looking at this crash report, the picture is pretty clear once you follow the crashing thread and cross-reference it against what the other threads were doing at the same instant.
What's actually happening
Thread 0 (main thread) is in the middle of shutting down the app. The crash stack is:
abort()here isn't a segfault — it'sstd::terminate()being invoked, which in C++ almost always means an exception escaped somewhere it wasn't allowed to (e.g., thrown out of a destructor, thrown during stack unwinding while another exception is already in flight, or thrown across anoexceptboundary). So something insideNodeContext's teardown threw, and the runtime had no way to handle it.Notes from claude...
Why it's throwing: a shutdown race
The real smoking gun is what the other threads were doing at the exact moment
NodeContextstarted destructing:b-msghandwas mid-flight insideChainstateManager::ProcessNewBlock→ConnectBlock→UpdateCoins→CCoinsViewCache::SpendCoin— i.e., actively mutating chainstate.b-scriptch.00–b-scriptch.08(9 script-check worker threads) were actively runningsecp256k1_ecdsa_verify— live signature verification work, not idle.b-net,b-scheduler,b-torcontrol,b-mapport,b-http.*were all still alive and running their loops.None of these threads show an interrupt/shutdown/join sequence in their stacks — they look like they were simply still running normal steady-state work. Meanwhile the main thread had already started tearing down
NodeContext, which those threads depend on (chainstate, coins cache, check queue, etc.).That's a classic shutdown-ordering bug: the destructor path is destroying shared node state before all worker threads have been signaled to stop and joined. A worker thread touching a partially-destroyed object (or an internal assertion catching the inconsistency and throwing/aborting) is exactly the kind of thing that surfaces as "exception during unwind →
std::terminate."Context that supports this
org.bitcoincore.gui-qml.preview— this is Bitcoin Core's newer QML-based GUI, which is understood to still be an early/preview build (as opposed to the long-stable Qt Widgets GUI). Early-access shutdown-path bugs like this are plausible in that codebase.procLaunch09:13:47 vs. crash 09:16:18) — consistent with the app still being in initial block/header sync when you quit it, which is exactly when script-check and message-handler threads are busiest.Practical takeaways
ConnectBlock/secp256k1_ecdsa_verifyactivity on other threads at time of crash — that detail is the useful diagnostic signal for whoever fixes it.bitcoin-qml-crash-report.txt