A Core message that waits for an answer is not brought into view when the window is hidden or minimized, and the node waits behind it #1138

Open
opened 2026-11-13 18:40:26 +00:00 by jarolrod · 0 comments
jarolrod commented 2026-11-13 18:40:26 +00:00 (Migrated from github.com)

When Core has a message that waits for an answer, the app opens it inside the main window and does not show the window. With the window hidden to the tray or minimized, the message is out of sight and the node waits behind it until the user happens to open the window.

To reproduce at run time:

  1. Start the app on a regtest node.
  2. Hide or minimize the main window. I called the window's own hide() and showMinimized().
  3. Make a block write fail. I made blocks/blk00000.dat read-only and mined one block over RPC.

Core reports "A fatal internal error occurred, see debug.log for details: Failed to write block." By Qt's state the message is open within 0.3 s and the window stays hidden or minimized. While it waited, getblockcount got no answer in 8 s and the log had no "Shutdown in progress". bitcoind alone exited with status 1 in 0.14 s.

Case Window while the message waited Samples
Fatal error, window hidden Hidden 52 of 52, 3 launches
Fatal error, window minimized Minimized 40 of 40, 2 launches
Start-up question "Do you want to rebuild the databases now?", window hidden Hidden 40 of 40, 3 launches
Same question, window minimized Minimized 98 of 98, 4 launches
Fatal error, window on screen (control) Windowed, message shown 16 of 16, 2 launches
Window hidden, no write failure (control) Hidden, no message 10 of 10

Showing the window again revealed the message and its button worked (3 launches). A quit in that state exited 0 with "Shutdown done" (9 launches).

The message is a Popup in the window's overlay, and opening it does not show the window:

github.com/bitcoin-core/gui-qml@2bd5a61e83/qml/components/NodeRuntimeDialog.qml (L34-L40)

Only the app's own fatal-exception handler shows and raises it:

github.com/bitcoin-core/gui-qml@2bd5a61e83/qml/pages/MainWindow.qml (L302-L309)

Bitcoin-Qt, by its source, runs the message as a window of its own, and once the node is running it first brings its main window forward: showNormalIfMinimized() un-minimizes or shows it, then activates and raises it (bitcoingui.cpp#L1321-L1331). During start-up that call returns early, but the message is still its own window. I did not run Bitcoin-Qt.

Suggested: show and raise the window when a message that blocks Core opens, as that handler does. #1126 is the same gap for the shutdown page.

Reproduced on qt6 at 2bd5a61e8304, macOS arm64 / Qt 6.9.0, isolated regtest, offscreen and in a native window (4 of the 12 launches); the same at eed1f426fcb6 in 4 offscreen launches. Limits:

  • Hide, minimize and show were calls through the test bridge and the quit was the quit event, not the tray menu, the Dock or Cmd+Q. I read the window's state through the bridge and did not look at the screen.
  • The read-only block file and the RPC-mined block stand in for a disk that fails when a block arrives. The question came from a pruned directory started without pruning, with start-up held by a named pipe until the window was minimized.
When Core has a message that waits for an answer, the app opens it inside the main window and does not show the window. With the window hidden to the tray or minimized, the message is out of sight and the node waits behind it until the user happens to open the window. To reproduce at run time: 1. Start the app on a regtest node. 2. Hide or minimize the main window. I called the window's own `hide()` and `showMinimized()`. 3. Make a block write fail. I made `blocks/blk00000.dat` read-only and mined one block over RPC. Core reports "A fatal internal error occurred, see debug.log for details: Failed to write block." By Qt's state the message is open within 0.3 s and the window stays hidden or minimized. While it waited, `getblockcount` got no answer in 8 s and the log had no "Shutdown in progress". `bitcoind` alone exited with status 1 in 0.14 s. | Case | Window while the message waited | Samples | |---|---|---| | Fatal error, window hidden | Hidden | 52 of 52, 3 launches | | Fatal error, window minimized | Minimized | 40 of 40, 2 launches | | Start-up question "Do you want to rebuild the databases now?", window hidden | Hidden | 40 of 40, 3 launches | | Same question, window minimized | Minimized | 98 of 98, 4 launches | | Fatal error, window on screen (control) | Windowed, message shown | 16 of 16, 2 launches | | Window hidden, no write failure (control) | Hidden, no message | 10 of 10 | Showing the window again revealed the message and its button worked (3 launches). A quit in that state exited 0 with "Shutdown done" (9 launches). The message is a `Popup` in the window's overlay, and opening it does not show the window: https://github.com/bitcoin-core/gui-qml/blob/2bd5a61e8304d5143e32f1ce977a2de2aceb6413/qml/components/NodeRuntimeDialog.qml#L34-L40 Only the app's own fatal-exception handler shows and raises it: https://github.com/bitcoin-core/gui-qml/blob/2bd5a61e8304d5143e32f1ce977a2de2aceb6413/qml/pages/MainWindow.qml#L302-L309 Bitcoin-Qt, by its source, runs the message as a window of its own, and once the node is running it first brings its main window forward: `showNormalIfMinimized()` un-minimizes or shows it, then activates and raises it ([bitcoingui.cpp#L1321-L1331](https://github.com/bitcoin/bitcoin/blob/44901d8f64cb617714707bd025ecd83f108353c2/src/qt/bitcoingui.cpp#L1321-L1331)). During start-up that call returns early, but the message is still its own window. I did not run Bitcoin-Qt. Suggested: show and raise the window when a message that blocks Core opens, as that handler does. #1126 is the same gap for the shutdown page. Reproduced on `qt6` at `2bd5a61e8304`, macOS arm64 / Qt 6.9.0, isolated regtest, offscreen and in a native window (4 of the 12 launches); the same at `eed1f426fcb6` in 4 offscreen launches. Limits: - Hide, minimize and show were calls through the test bridge and the quit was the quit event, not the tray menu, the Dock or Cmd+Q. I read the window's state through the bridge and did not look at the screen. - The read-only block file and the RPC-mined block stand in for a disk that fails when a block arrives. The question came from a pruned directory started without pruning, with start-up held by a named pipe until the window was minimized.
Sign in to join this conversation.
No description provided.