Bitcoin-Qt freezes on startup #16417

issue QPotato openend this issue on July 18, 2019
  1. QPotato commented at 6:37 pm on July 18, 2019: none

    Describe the issue:

    Bitcoin-Qt freezes on start-up, giving two transparent windows. I suspect it’s related to my system clock changing (more details below). This means the issue is not caused by the Bitcoin Core software but, I’m submitting it anyway because the error could maybe be catched and handled more graciously. Even crashing in a secure way would be better: when this happens I’m kinda scared to kill the process and mess the blockchain.

    What behaviour did you expect?

    Bitcoin-Qt should start normally.

    The program freezes giving a transparent Bitcoin Core window and another transparent Bitcoin - Warning window. Screenshot for reference: Screenshot_2019-07-18 Screenshot at 2019-07-18 14-52-13 png (PNG Image, 1920 × 1080 pixels) - Scaled (86%)

    How reliably can you reproduce the issue, what are the steps to do so?

    When I start my computer on linux after I’ve been using windows (it’s dual boot), the OS changes the system clock seconds after entering the desktop, syncing with some internet time server. Around 30% of the times, this produces the issue. I suspect the time change in the middle of the initialization makes the software freak out.

    It should also occur with any other kind of use that makes the system clock change inmediatly after boot but I mention this details because I think it’s a very common use case. I think I could try to manually reproduce the error consistently by changing the system clock on the BIOS if needed.

    What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)?

    I believe I installed it from my package manager. It was either that or downloaded from website.

    What type of machine are you observing the error on (OS/CPU and disk type)?

    uname -a says: Linux [removed host name] .0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

    Linux Mint 19 Mate 64-bit

    Any extra information that might be useful in the debugging process.

    Logs confirm it’s clock related: https://pastebin.com/ni7bWgL9

    I understand that this issue occurs in very very specific circunstances and it’s ok if fixing it is not a priority. If you consider this to be important and it could use a fix, I would be happy to try to investigate it further and submit a PR.

    Thanks for reading and for the hard work mantaining this.

  2. jonasschnelli added the label GUI on Jul 18, 2019
  3. hebasto commented at 10:37 am on July 19, 2019: member
    @QPotato Could you clarify: does a crash happen after the splash screen?
  4. maflcko commented at 2:33 pm on July 19, 2019: member
    It looks like a deadlock because the modal dialog is blocking the GUI?
  5. QPotato commented at 4:16 pm on July 19, 2019: none

    @QPotato Could you clarify: does a crash happen after the splash screen?

    Yes, it’s after the splash screen. The two dead dialogs in the screenshot are the main window with the balances, menus and all that and a warning dialog.

    It looks like a deadlock because the modal dialog is blocking the GUI?

    I does look like a deadlock. Any idea wich locks could be causing the problem? Any source file I could look into?

    Also, killing the program and restarting was safe. No blockchain resync needed.

  6. hebasto commented at 6:13 pm on July 19, 2019: member
    Cannot reproduce the issue on Linux Mint 19.1: the warning window does not cause a deadlock.
  7. QPotato commented at 8:26 pm on July 20, 2019: none
    I’m trying to get a more reliable and deterministic way to reproduce the issue. I will comment here if I find one.
  8. promag commented at 10:16 am on July 23, 2019: member

    @QPotato are you able to reproduce? Can you try with the following patch

    0--- a/src/qt/sendcoinsdialog.cpp
    1+++ b/src/qt/sendcoinsdialog.cpp
    2@@ -439,7 +439,6 @@ SendCoinsEntry *SendCoinsDialog::addEntry()
    3     entry->clear();
    4     entry->setFocus();
    5     ui->scrollAreaWidgetContents->resize(ui->scrollAreaWidgetContents->sizeHint());
    6-    qApp->processEvents();
    7     QScrollBar* bar = ui->scrollArea->verticalScrollBar();
    8     if(bar)
    9         bar->setSliderPosition(bar->maximum());
    
  9. QPotato commented at 0:17 am on July 28, 2019: none

    @QPotato are you able to reproduce? Can you try with the following patch

    0--- a/src/qt/sendcoinsdialog.cpp
    1+++ b/src/qt/sendcoinsdialog.cpp
    2@@ -439,7 +439,6 @@ SendCoinsEntry *SendCoinsDialog::addEntry()
    3     entry->clear();
    4     entry->setFocus();
    5     ui->scrollAreaWidgetContents->resize(ui->scrollAreaWidgetContents->sizeHint());
    6-    qApp->processEvents();
    7     QScrollBar* bar = ui->scrollArea->verticalScrollBar();
    8     if(bar)
    9         bar->setSliderPosition(bar->maximum());
    

    Working on it. I’ll try the patch.

  10. fanquake added the label Linux/Unix on Aug 4, 2019
  11. fanquake commented at 5:52 am on August 4, 2019: member
    @QPotato How did you go testing that patch?
  12. QPotato commented at 7:32 pm on August 4, 2019: none

    @QPotato How did you go testing that patch?

    I finally managed to reproduce the issue consistently. The node needs to be sufficiently behind on synchronization (some hours is enough) and the system clock wrong. Then, it will start syncing just fine and then crash when the OS changes the time while still syncing. It also happens with the patch applied.

  13. hebasto commented at 11:21 am on August 10, 2019: member

    @QPotato

    I finally managed to reproduce the issue consistently. The node needs to be sufficiently behind on synchronization (some hours is enough) and the system clock wrong. Then, it will start syncing just fine and then crash when the OS changes the time while still syncing.

    Cannot reproduce the issue on Linux Mint 19.2. During testing my logs contain info about the system clock adjustment:

    02019-08-10T11:04:12Z Using obfuscation key for /home/hebasto/.bitcoin/testnet3/blocks/index: 0000000000000000
    12019-08-10T05:04:15Z LoadBlockIndexDB: last block file = 166
    

    In your log I can see a similar change just after a warning message:

    02019-07-18T14:40:35Z Warning: Please check that your computer's date and time are correct! If your clock is wrong, Bitcoin Core will not work properly.
    12019-07-18T17:40:48Z socket sending timeout: 10818s
    

    Do I understand correctly that this is a moment when your Linux adjusted the system clock?

  14. hebasto commented at 11:24 am on August 10, 2019: member
    @QPotato Does bitcoind behave well in similar circumstances?
  15. wakeup6621 commented at 0:32 am on August 11, 2019: none

    almost the same issue here…. just upgraded running debian 10…

    bitcoin-qt loads the splash screen, verifys the chain and then freezes at the splash screen once the chain is verified and it says done loading…. upgraded by simply copying the new bin files to the old in /usr/local/bin

  16. QPotato commented at 5:11 pm on August 16, 2019: none

    @QPotato Does bitcoind behave well in similar circumstances?

    Just tested it. bitcoind behaves well.

  17. promag commented at 10:45 pm on November 11, 2019: member
    Please assign this to me.
  18. hebasto commented at 8:49 pm on March 25, 2021: member
    A possible reason of the bug: #18953 (comment)
  19. pinheadmz commented at 2:02 pm on April 27, 2023: member
    This is no longer an issue in recent versions of Bitcoin Core. We’ll close it for now, please feel free to add additional comments or open a new issue if you think that would be helpful.
  20. pinheadmz closed this on Apr 27, 2023

  21. bitcoin locked this on Apr 26, 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 09:12 UTC

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