A Core initialization failure exits the app with status 0 #1100

Open
opened 2026-11-10 14:07:58 +00:00 by jarolrod · 0 comments
jarolrod commented 2026-11-10 14:07:58 +00:00 (Migrated from github.com)

When Core initialization fails, the GUI displays the error and completes shutdown, but the application exits with status 0, reporting success to the calling process.

This is a remaining lifecycle case related to closed #959 and the broader tracking issue #917.

To reproduce:

  1. Use an already-onboarded, disposable regtest profile with these settings in bitcoin.conf:

    regtest=1
    [regtest]
    server=1
    onion=127.0.0.1:9050
    onlynet=onion
    
  2. Put the following in the profile's regtest/settings.json:

    {"onion": false, "onion-prev": "127.0.0.1:9050"}
    
  3. Launch bitcoin-core-app directly from a terminal using this profile. Core initialization fails, and the GUI reports that Tor connections are restricted while the Tor proxy is explicitly forbidden by -onion=0.

  4. Acknowledge the error with OK and inspect the application's exit status. It is 0.

The log contains the initialization error followed by Shutdown done, without Done loading. Running bitcoind with the same invalid configuration exits 1. Healthy GUI and daemon controls both initialize successfully and exit 0.

Core's appInitMain() records EXIT_FAILURE when initialization fails. QML's shutdown-completion callback nevertheless calls QCoreApplication::exit(0), and QmlGuiMain() returns that event-loop result. The incorrect status comes from the QML application lifecycle code.

After cleanup, the application should preserve Core's failure status so callers can distinguish failed initialization from a successful run. The error dialog and cleanup work in this reproduction.

Reproduced on merged QML eed1f426fcb6 / Core 44901d8f64cb, macOS / Qt 6.9, using the full offscreen app and isolated regtest profiles with networking disabled. The GUI error was acknowledged through the application's test bridge. This report is limited to the demonstrated initialization failure.

When Core initialization fails, the GUI displays the error and completes shutdown, but the application exits with status **0**, reporting success to the calling process. This is a remaining lifecycle case related to closed [#959](https://github.com/bitcoin-core/gui-qml/issues/959) and the broader tracking issue [#917](https://github.com/bitcoin-core/gui-qml/issues/917). To reproduce: 1. Use an already-onboarded, disposable regtest profile with these settings in `bitcoin.conf`: ```ini regtest=1 [regtest] server=1 onion=127.0.0.1:9050 onlynet=onion ``` 2. Put the following in the profile's `regtest/settings.json`: ```json {"onion": false, "onion-prev": "127.0.0.1:9050"} ``` 3. Launch `bitcoin-core-app` directly from a terminal using this profile. Core initialization fails, and the GUI reports that Tor connections are restricted while the Tor proxy is explicitly forbidden by `-onion=0`. 4. Acknowledge the error with **OK** and inspect the application's exit status. It is **0**. The log contains the initialization error followed by `Shutdown done`, without `Done loading`. Running `bitcoind` with the same invalid configuration exits **1**. Healthy GUI and daemon controls both initialize successfully and exit **0**. Core's `appInitMain()` records `EXIT_FAILURE` when initialization fails. QML's shutdown-completion callback nevertheless calls `QCoreApplication::exit(0)`, and `QmlGuiMain()` returns that event-loop result. The incorrect status comes from the QML application lifecycle code. After cleanup, the application should preserve Core's failure status so callers can distinguish failed initialization from a successful run. The error dialog and cleanup work in this reproduction. Reproduced on merged QML `eed1f426fcb6` / Core `44901d8f64cb`, macOS / Qt 6.9, using the full offscreen app and isolated regtest profiles with networking disabled. The GUI error was acknowledged through the application's test bridge. This report is limited to the demonstrated initialization failure.
Sign in to join this conversation.
No description provided.