bitcoin-qt failed assertion on startup #31289

issue dooglus openend this issue on November 14, 2024
  1. dooglus commented at 3:05 pm on November 14, 2024: contributor

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    I ran bitcoin-qt the same way I always do, but it failed to start up. The terminal shows this:

     0[New Thread 0x7fff337fe6c0 (LWP 4274)]
     1[New Thread 0x7fff32ffd6c0 (LWP 4275)]
     2[New Thread 0x7fff327fc6c0 (LWP 4276)]
     3[New Thread 0x7fff31ffb6c0 (LWP 4277)]
     4[New Thread 0x7fff317fa6c0 (LWP 4278)]
     5[New Thread 0x7fff30ff96c0 (LWP 4279)]
     6[New Thread 0x7fff23fff6c0 (LWP 4280)]
     7[New Thread 0x7fff237fe6c0 (LWP 4281)]
     8bitcoin-qt-v28.0: rpc/server.cpp:318: void StopRPC(): Assertion `!g_rpc_running' failed.
     9
    10Thread 1 "bitcoin-qt-v28." received signal SIGABRT, Aborted.
    11__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    1244      ./nptl/pthread_kill.c: No such file or directory.
    13(gdb) 
    

    Expected behaviour

    Not this.

    Steps to reproduce

    I can’t reproduce it. This is the first time it happened and I didn’t change anything.

    I was typing when the splash screen popped up and grabbed keyboard focus. Is there something I could have typed at the splash screen or the “loading wallets” popup that could have caused this? I have since tried typing ‘q’ at the splash screen many times, but that appears to always cause a clean shutdown, not an assertion failure. Maybe I hit ‘q’ at just the wrong time, triggering a race condition in the shutdown code?

    I ran it like this:

    0gdb -ex 'run -datadir=/path path/bitcoin/src/qt/bitcoin-qt-v28.0
    

    Relevant log output

    The end of the debug.log file shows this:

    02024-11-14T14:23:38Z Using /16 prefix for IP bucketing
    12024-11-14T14:23:38Z init message: Loading P2P addresses…
    22024-11-14T14:23:38Z Loaded 58315 addresses from peers.dat  93ms
    32024-11-14T14:23:38Z init message: Loading banlist…
    42024-11-14T14:23:38Z SetNetworkActive: true
    52024-11-14T14:23:38Z Script verification uses 15 additional threads
    62024-11-14T14:23:38Z Cache configuration:
    72024-11-14T14:23:38Z * Using 2.0 MiB for block index database
    82024-11-14T14:23:38Z * Using 8.0 MiB for chain state database
    92024-11-14T14:23:38Z Shutdown requested. Exiting.
    

    The config.log says:

    0It was created by Bitcoin Core configure 28.0.0, which was
    1generated by GNU Autoconf 2.71.  Invocation command line was
    2
    3  $ ./configure CXXFLAGS=-fno-omit-frame-pointer --with-incompatible-bdb --with-miniupnpc=no --disable-debug --disable-shared --with-pic --enable-benchmark=no --enable-module-recovery --disable-module-ecdh --no-create --no-recursion
    

    How did you obtain Bitcoin Core

    Compiled from source

    What version of Bitcoin Core are you using?

    Bitcoin Core version v28.0.0

    Operating system and version

    Debian GNU/Linux 12

    Machine specifications

    Linux/Intel and ssd, satellite

  2. maflcko added the label GUI on Nov 14, 2024
  3. maflcko added the label Bug on Nov 14, 2024
  4. maflcko commented at 4:07 pm on November 14, 2024: member

    Thanks for the report. This is a GUI issue. The GUI is running in a separate thread during init, so the two threads can race. It is possible to reproduce by pressing q at the right time. See this diff to reproduce:

     0diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp
     1index 34f19df256..e8e58e7631 100644
     2--- a/src/rpc/server.cpp
     3+++ b/src/rpc/server.cpp
     4@@ -280,6 +280,8 @@ bool CRPCTable::removeCommand(const std::string& name, const CRPCCommand* pcmd)
     5 void StartRPC()
     6 {
     7     LogDebug(BCLog::RPC, "Starting RPC\n");
     8+    std::cout << "Press q now ..." << std::endl;
     9+    UninterruptibleSleep(1s);
    10     g_rpc_running = true;
    11 }
    12 
    13@@ -292,6 +294,7 @@ void InterruptRPC()
    14         // Interrupt e.g. running longpolls
    15         g_rpc_running = false;
    16     });
    17+    UninterruptibleSleep(1s);
    18 }
    19 
    20 void StopRPC()
    
    0$ ./bld-cmake/src/qt/bitcoin-qt -regtest -datadir=/tmp -server=1 
    1
    2
    3
    4Press q now ...
    5bitcoin-qt: rpc/server.cpp:304: void StopRPC(): Assertion `!g_rpc_running' failed.
    6Aborted (core dumped)
    
  5. maflcko commented at 4:46 pm on November 18, 2024: member
    A fix would be to revert da73f1513a6, but that adds another bug? Also, I presume it doesn’t happen in multiprocess?
  6. fanquake commented at 12:06 pm on November 19, 2024: member
    I guess move to the GUI repo? Unclear if this will be fixed or not. @hebasto.
  7. fanquake commented at 10:23 am on November 20, 2024: member
  8. fanquake closed this on Nov 20, 2024


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-21 06:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me