Segfault in qt/clientmodel.cpp:92 on every shutdown #800

issue maflcko openend this issue on February 28, 2024
  1. maflcko commented at 8:20 am on February 28, 2024: contributor

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    On shutdown, I get a crash in return m_node.getNodeCount(connections);

    Expected behaviour

    No crash

    Steps to reproduce

    • Shutdown Bitcoin Core

    Relevant log output

    No response

    How did you obtain Bitcoin Core

    Compiled from source

    What version of Bitcoin Core are you using?

    master

    Operating system and version

    ubuntu

    Machine specifications

    No response

  2. maflcko commented at 8:31 am on February 28, 2024: contributor

    The thread b-msghand is still busy in ActivateBestChainStep, the thread b-shutoff is currently joining the message handler thread in CConnman::StopThreads net.cpp:3336.

    The thread bitcoin-qt is the one segfaulting.

  3. maflcko added this to the milestone 27.0 on Feb 28, 2024
  4. maflcko commented at 9:29 am on February 28, 2024: contributor

    Steps to reproduce:

     0diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
     1index ad80922c8b..d6ca01ebc4 100644
     2--- a/src/qt/bitcoingui.cpp
     3+++ b/src/qt/bitcoingui.cpp
     4@@ -989,6 +989,7 @@ void BitcoinGUI::gotoLoadPSBT(bool from_clipboard)
     5 
     6 void BitcoinGUI::updateNetworkState()
     7 {
     8+UninterruptibleSleep(100ms);
     9     int count = clientModel->getNumConnections();
    10     QString icon;
    11     switch(count)
    12diff --git a/src/validation.cpp b/src/validation.cpp
    13index 81a3c35864..c18608dcd7 100644
    14--- a/src/validation.cpp
    15+++ b/src/validation.cpp
    16@@ -3140,6 +3140,7 @@ bool Chainstate::ActivateBestChainStep(BlockValidationState& state, CBlockIndex*
    17 
    18         // Connect new blocks.
    19         for (CBlockIndex* pindexConnect : reverse_iterate(vpindexToConnect)) {
    20+        UninterruptibleSleep(3s);
    21             if (!ConnectTip(state, pindexConnect, pindexConnect == pindexMostWork ? pblock : std::shared_ptr<const CBlock>(), connectTrace, disconnectpool)) {
    22                 if (state.IsInvalid()) {
    23                     // The block violates a consensus rule.
    
    0gdb --args ./src/qt/bitcoin-qt -signet -datadir=/run/media/marco/scratch_fde/signet/ -printtoconsole  -server
    1...
    2run
    
    0while ./src/bitcoin-cli -signet -datadir=/run/media/marco/scratch_fde/signet/ setnetworkactive true && sleep 0.2 && ./src/bitcoin-cli -signet -datadir=/run/media/marco/scratch_fde/signet/ setnetworkactive false ; do true ; done
    
    • Exit the GUI via the [x] button
  5. furszy cross-referenced this on Feb 28, 2024 from issue Fix nullptr clientModel access during shutdown by furszy
  6. furszy commented at 1:12 pm on February 28, 2024: member
  7. hebasto commented at 1:13 pm on February 28, 2024: member

    #801 @maflcko Does it fix the issue for you?

  8. hebasto referenced this in commit 776d48dd56 on Mar 4, 2024
  9. hebasto commented at 10:17 am on March 4, 2024: member
    Closed by #801.
  10. hebasto closed this on Mar 4, 2024


maflcko furszy hebasto

Milestone
27.0


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-22 02:20 UTC

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