bitcoin-qt keeps freezing every ~10 seconds #5037

issue rebroad opened this issue on October 3, 2014
  1. rebroad commented at 12:24 AM on October 3, 2014: contributor

    There seems to have been introduced recently some sort of sleep of 10 seconds into a loop somewhere because now the debug.log keeps sleeping for 10 seconds regularly. This is causing problems with timeouts that I'm trying to test, with 2 being triggered together, when they should be 5 seconds apart.

  2. laanwj commented at 6:31 AM on October 3, 2014: member

    I don't see this particular behaviour, but it may be specific to your connections. When the whole program hangs probably the cs_main lock is contended for some reason. Compiling with -DDEBUG_LOCKCONTENTION could help figure out what threads are contending for the lock.

  3. rebroad commented at 8:31 AM on October 3, 2014: contributor

    Actually, my wording should have been "freezes for ~10 seconds"... I'll try that compile option, thanks.

  4. rebroad commented at 8:34 AM on October 3, 2014: contributor

    @laanwj how do I add that compile flag? By re-running ./configure -DDEBUG_LOCKCONTENTION?

  5. laanwj commented at 8:37 AM on October 3, 2014: member
    ./configure ... CPPFLAGS="-DDEBUG_LOCKCONTENTION"
    
  6. rebroad commented at 6:40 AM on October 5, 2014: contributor

    why is it a compile option rather than the code being enabled by default but optionally logged?

  7. rebroad commented at 6:41 AM on October 5, 2014: contributor

    anyway, I've enabled this, but so far nothing is showing up in the logs.

  8. TheBlueMatt commented at 7:06 AM on October 5, 2014: member

    For performance reasons, originally. Not sure what the overhead actually is, though.

  9. TheBlueMatt commented at 7:06 AM on October 5, 2014: member

    See-also #1550 and #1213

  10. laanwj commented at 2:26 AM on October 6, 2014: member

    Because locking is performance sensitive (that's sort of the point of it). Anything that slows the locking primitives down slows down the whole program. You're free to always build and run with it of course.

  11. laanwj added the label GUI on Oct 28, 2014
  12. laanwj commented at 4:19 PM on October 28, 2014: member

    I've also noticed that the client can hang for seconds at a time while syncing (in ActivateBestChain, which has a loop to catch up), this is mostly an issue in the GUI as it tries to get the cs_main lock as well.

    Message handler thread:

    [#18](/bitcoin-bitcoin/18/) 0x00005555556dd99b in ConnectBlock (block=..., state=..., pindex=pindex@entry=0x7fffb7854240, view=..., fJustCheck=fJustCheck@entry=false) at main.cpp:1612
    [#19](/bitcoin-bitcoin/19/) 0x00005555556e1e23 in ConnectTip (pblock=0x7fff90a9dbf0, pindexNew=0x7fffb7854240, state=...) at main.cpp:1867
    [#20](/bitcoin-bitcoin/20/) ActivateBestChainStep (pblock=0x0, pindexMostWork=0x7fffb64e1ed0, state=...) at main.cpp:1985
    [#21](/bitcoin-bitcoin/21/) ActivateBestChain (state=..., pblock=pblock@entry=0x7fff90a9e440) at main.cpp:2047
    [#22](/bitcoin-bitcoin/22/) 0x00005555556e312a in ProcessBlock (state=..., pfrom=pfrom@entry=0x7fff80000b20, pblock=pblock@entry=0x7fff90a9e440, dbp=dbp@entry=0x0) at main.cpp:2529
    [#23](/bitcoin-bitcoin/23/) 0x00005555556e80f9 in ProcessMessage (pfrom=pfrom@entry=0x7fff80000b20, strCommand=..., vRecv=..., nTimeReceived=nTimeReceived@entry=1414512718258751) at main.cpp:3937
    [#24](/bitcoin-bitcoin/24/) 0x00005555556ea143 in ProcessMessages (pfrom=0x7fff80000b20) at main.cpp:4261
    

    The GUI, meanwhile:

    [#8](/bitcoin-bitcoin/8/)  0x0000555555675631 in TransactionTablePriv::updateWallet (this=0x5555566ab640, hash=..., status=status@entry=0) at qt/transactiontablemodel.cpp:98
    [#9](/bitcoin-bitcoin/9/)  0x000055555567449f in TransactionTableModel::updateTransaction (this=0x555556a77ac0, hash=..., status=0) at qt/transactiontablemodel.cpp:258
    [#10](/bitcoin-bitcoin/10/) 0x000055555561a4d6 in WalletModel::updateTransaction (this=this@entry=0x555556ab9880, hash=..., status=<optimized out>) at qt/walletmodel.cpp:170
    [#11](/bitcoin-bitcoin/11/) 0x0000555555635484 in WalletModel::qt_static_metacall (_o=0x555556ab9880, _c=<optimized out>, _id=<optimized out>, _a=0x7fffcba78470) at qt/moc_walletmodel.cpp:86
    [#12](/bitcoin-bitcoin/12/) 0x00007ffff5f75c1e in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
    
  13. laanwj commented at 8:36 AM on October 29, 2014: member

    #5168 should improve on this (although there are still quite a few places to go where the GUI thread acquires cs_main/cs_wallet)

  14. fanquake commented at 1:09 PM on January 3, 2015: member

    @rebroad Are you still seeing this behaviour after the merge of #5168 ?

  15. gmaxwell closed this on Jan 9, 2015

  16. jonasschnelli commented at 9:06 AM on January 10, 2015: contributor

    Closed because fixed with #5168 and no feedback from @rebroad.

  17. MarcoFalke locked this on Sep 8, 2021

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: 2026-04-13 18:15 UTC

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