AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 28 Bitcoin

init: Signal m_tip_block_cv on Ctrl-C

Public commit record

What the developer wrote

Authored by Ryan Ofsky

88/100 · Strong
init: Signal m_tip_block_cv on Ctrl-C

Signal m_tip_block_cv when Ctrl-C is pressed or SIGTERM is received, the same
way it is currently signalled when the `stop` RPC is called. This lets RPC
calls like `waitforblockheight` and IPC calls like `waitTipChanged` be
interrupted, instead of waiting for their original timeouts and delaying
shutdown.

Historical notes:

- The behavior where `stop` RPC signals `m_tip_block_cv`, but CTRL-C does not,
has been around since the condition variable was introduced in #30409
(7eccdaf16081d6f624c4dc21df75b0474e049d2b).
- The signaling was later moved without changing behavior in #30967
(5ca28ef28bcca1775ff49921fc2528d9439b71ab). This commit moves it again to
the Interrupt() function, which is probably the place it should have been
added initially, so it works for Ctrl-C shutdowns as well as `stop`
shutdowns.
- A Qt shutdown bug calling wait methods was fixed previously in #18452
(da73f1513a637a9f347b64de66564d6cdb2541f8), and this change updates that
fix to avoid the hang happening again in Qt.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a shutdown bug in Bitcoin Core. When a user pressed Ctrl-C or the process received SIGTERM, threads waiting for the blockchain tip to change (such as those handling 'waitforblockheight' RPC calls or Qt wallet wait methods) would not be woken up. This delayed shutdown until those calls hit their timeouts. The fix moves the wake-up signal so it fires during any shutdown path, not just the 'stop' RPC path. It is a reliability/usability fix, not a security vulnerability that can be exploited by an attacker.

Recommended action

No urgent security action required. This is a shutdown-resilience improvement. Operators and downstream packagers should include it in routine updates to avoid delayed shutdowns, especially for GUI users and automated RPC workflows that rely on clean interruption.

Security signals we found

01

Shutdown hang / denial-of-service against local operator

02

Condition variable not signaled on SIGTERM/Ctrl-C shutdown path

03

Qt shutdown hang regression fix referenced (#18452)

04

Functional test updated to assert interruption instead of timeout

Risk score

Why this scored 28/100

Our methodology →
Potential impact 6/30
Exploitability 0/25
Stealth signal 3/15
Affected reach 5/15
Confidence 9/10
Evidence quality 5/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.