Crash on exit #7

issue hebasto opened this issue on June 19, 2020
  1. hebasto commented at 11:13 AM on June 19, 2020: member

    On master (dbd7a91fdf3ff801fe5e4107e8346d0d6d11a899):

    $ lldb ./src/qt/bitcoin-qt -- -testnet
    (lldb) target create "./src/qt/bitcoin-qt"
    Current executable set to './src/qt/bitcoin-qt' (x86_64).
    (lldb) settings set -- target.run-args  "-testnet"
    (lldb) run
    Process 5006 launched: './src/qt/bitcoin-qt' (x86_64)
    Process 5006 stopped
    * thread [#1](/bitcoin-core-gui/1/), name = 'bitcoin-qt', stop reason = signal SIGSEGV: invalid address (fault address: 0x38)
        frame [#0](/bitcoin-core-gui/0/): 0x00007ffff72e1fa0 libpthread.so.0`__GI___pthread_mutex_lock
    libpthread.so.0`__GI___pthread_mutex_lock:
    ->  0x7ffff72e1fa0 <+0>:  movl   0x10(%rdi), %eax
        0x7ffff72e1fa3 <+3>:  movl   %eax, %edx
        0x7ffff72e1fa5 <+5>:  andl   $0x17f, %edx              ; imm = 0x17F 
        0x7ffff72e1fab <+11>: nop    
    (lldb) bt
    error: bitcoin-qt :: Class 'ClientModel' has a base class 'QObject' which does not have a complete definition.
    error: bitcoin-qt :: Try compiling the source file with -fstandalone-debug.
    * thread [#1](/bitcoin-core-gui/1/), name = 'bitcoin-qt', stop reason = signal SIGSEGV: invalid address (fault address: 0x38)
      * frame [#0](/bitcoin-core-gui/0/): 0x00007ffff72e1fa0 libpthread.so.0`__GI___pthread_mutex_lock
        frame [#1](/bitcoin-core-gui/1/): 0x00005555555ea443 bitcoin-qt`ClientModel::getBestBlockHash() [inlined] __gthread_mutex_lock(__mutex=0x0000000000000028) at gthr-default.h:748
        frame [#2](/bitcoin-core-gui/2/): 0x00005555555ea43b bitcoin-qt`ClientModel::getBestBlockHash() [inlined] std::mutex::lock(this=0x0000000000000028) at std_mutex.h:103
        frame [#3](/bitcoin-core-gui/3/): 0x00005555555ea42d bitcoin-qt`ClientModel::getBestBlockHash() [inlined] std::unique_lock<std::mutex>::lock(this=<unavailable>) at std_mutex.h:267
        frame [#4](/bitcoin-core-gui/4/): 0x00005555555ea42d bitcoin-qt`ClientModel::getBestBlockHash() [inlined] UniqueLock<AnnotatedMixin<std::mutex>, std::unique_lock<std::mutex> >::Enter(this=<unavailable>, pszFile=<unavailable>, nLine=119) at sync.h:139
        frame [#5](/bitcoin-core-gui/5/): 0x00005555555ea42d bitcoin-qt`ClientModel::getBestBlockHash() [inlined] UniqueLock<AnnotatedMixin<std::mutex>, std::unique_lock<std::mutex> >::UniqueLock(this=<unavailable>, mutexIn=0x0000000000000028, pszFile=<unavailable>, nLine=119, fTry=false) at sync.h:160
        frame [#6](/bitcoin-core-gui/6/): 0x00005555555ea42d bitcoin-qt`ClientModel::getBestBlockHash() [inlined] ClientModel::getBestBlockHash(this=<unavailable>)::$_2::operator()() const at clientmodel.cpp:119
        frame [#7](/bitcoin-core-gui/7/): 0x00005555555ea42d bitcoin-qt`ClientModel::getBestBlockHash(this=0x0000000000000000) at clientmodel.cpp:119
        frame [#8](/bitcoin-core-gui/8/): 0x00005555556a23f6 bitcoin-qt`TransactionTableModel::index(this=0x0000555556472cf0, row=11, column=4, parent=<unavailable>) const at transactiontablemodel.cpp:667
        frame [#9](/bitcoin-core-gui/9/): 0x00007ffff5a9c5e9 libQt5Core.so.5`___lldb_unnamed_symbol1919$$libQt5Core.so.5 + 249
        frame [#10](/bitcoin-core-gui/10/): 0x00007ffff5a9cb56 libQt5Core.so.5`QSortFilterProxyModel::flags(QModelIndex const&) const + 166
        frame [#11](/bitcoin-core-gui/11/): 0x00007ffff6adf3c5 libQt5Widgets.so.5`QListView::moveCursor(QAbstractItemView::CursorAction, QFlags<Qt::KeyboardModifier>) + 437
        frame [#12](/bitcoin-core-gui/12/): 0x00007ffff6aad083 libQt5Widgets.so.5`QAbstractItemView::focusInEvent(QFocusEvent*) + 259
        frame [#13](/bitcoin-core-gui/13/): 0x00007ffff68987ff libQt5Widgets.so.5`QWidget::event(QEvent*) + 2479
        frame [#14](/bitcoin-core-gui/14/): 0x00007ffff69394de libQt5Widgets.so.5`QFrame::event(QEvent*) + 30
        frame [#15](/bitcoin-core-gui/15/): 0x00007ffff6942623 libQt5Widgets.so.5`QAbstractScrollArea::event(QEvent*) + 899
        frame [#16](/bitcoin-core-gui/16/): 0x00007ffff6aac87b libQt5Widgets.so.5`QAbstractItemView::event(QEvent*) + 187
        frame [#17](/bitcoin-core-gui/17/): 0x00007ffff685983c libQt5Widgets.so.5`QApplicationPrivate::notify_helper(QObject*, QEvent*) + 156
        frame [#18](/bitcoin-core-gui/18/): 0x00007ffff6861104 libQt5Widgets.so.5`QApplication::notify(QObject*, QEvent*) + 676
        frame [#19](/bitcoin-core-gui/19/): 0x00007ffff5adb8d8 libQt5Core.so.5`QCoreApplication::notifyInternal2(QObject*, QEvent*) + 280
        frame [#20](/bitcoin-core-gui/20/): 0x00007ffff685ecbe libQt5Widgets.so.5`QApplicationPrivate::setFocusWidget(QWidget*, Qt::FocusReason) + 526
        frame [#21](/bitcoin-core-gui/21/): 0x00007ffff68927ef libQt5Widgets.so.5`QWidget::setFocus(Qt::FocusReason) + 415
        frame [#22](/bitcoin-core-gui/22/): 0x00007ffff685f14b libQt5Widgets.so.5`QApplication::setActiveWindow(QWidget*) + 1067
        frame [#23](/bitcoin-core-gui/23/): 0x00007ffff685f243 libQt5Widgets.so.5`QApplicationPrivate::notifyActiveWindowChange(QWindow*) + 51
        frame [#24](/bitcoin-core-gui/24/): 0x00007ffff609eee5 libQt5Gui.so.5`QGuiApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate::ActivatedWindowEvent*) + 789
        frame [#25](/bitcoin-core-gui/25/): 0x00007ffff609f14d libQt5Gui.so.5`QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) + 557
        frame [#26](/bitcoin-core-gui/26/): 0x00007ffff60762eb libQt5Gui.so.5`QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 171
        frame [#27](/bitcoin-core-gui/27/): 0x00007fffecd98260 libQt5XcbQpa.so.5`___lldb_unnamed_symbol984$$libQt5XcbQpa.so.5 + 16
        frame [#28](/bitcoin-core-gui/28/): 0x00007ffff19d5417 libglib-2.0.so.0`g_main_context_dispatch + 743
        frame [#29](/bitcoin-core-gui/29/): 0x00007ffff19d5650 libglib-2.0.so.0`___lldb_unnamed_symbol192$$libglib-2.0.so.0 + 512
        frame [#30](/bitcoin-core-gui/30/): 0x00007ffff19d56dc libglib-2.0.so.0`g_main_context_iteration + 44
        frame [#31](/bitcoin-core-gui/31/): 0x00007ffff5b3488f libQt5Core.so.5`QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 95
        frame [#32](/bitcoin-core-gui/32/): 0x00007ffff5ad990a libQt5Core.so.5`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 314
        frame [#33](/bitcoin-core-gui/33/): 0x00007ffff5ae29b4 libQt5Core.so.5`QCoreApplication::exec() + 148
        frame [#34](/bitcoin-core-gui/34/): 0x00005555555d2985 bitcoin-qt`GuiMain(argc=<unavailable>, argv=<unavailable>) at bitcoin.cpp:594
        frame [#35](/bitcoin-core-gui/35/): 0x00005555555cea43 bitcoin-qt`main(argc=<unavailable>, argv=<unavailable>) at main.cpp:21
        frame [#36](/bitcoin-core-gui/36/): 0x00007ffff3c7db97 libc.so.6`__libc_start_main(main=(bitcoin-qt`main at main.cpp:21), argc=2, argv=0x00007fffffffdcf8, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=0x00007fffffffdce8) at libc-start.c:310
        frame [#37](/bitcoin-core-gui/37/): 0x00005555555ce96a bitcoin-qt`_start + 42
    
  2. MarcoFalke added the label bug on Jun 19, 2020
  3. MarcoFalke commented at 11:20 AM on June 19, 2020: contributor

    Does this also happen on the latest release?

  4. hebasto commented at 11:26 AM on June 19, 2020: member

    Does this also happen on the latest release?

    No. Tracked until https://github.com/bitcoin/bitcoin/pull/19132. The regression happened before it.

  5. MarcoFalke commented at 11:28 AM on June 19, 2020: contributor

    Is there any commit that works?

  6. hebasto commented at 11:41 AM on June 19, 2020: member

    Is there any commit that works?

    f4b603cff63aea798a55e7a129edf8324f8e19b1 works fine.

  7. hebasto commented at 12:32 PM on June 19, 2020: member

    @MarcoFalke

    Is there any commit that works?

    This crash is not reliably reproducible. I've observed it three times only:

    • the first time on master without debugger
    • the second time on master (dbd7a91fdf3ff801fe5e4107e8346d0d6d11a899) in lldb, see OP
    • the third time on f4f222045693a4d611d8a1d755d7e4d2b91d5183 in lldb
  8. hebasto commented at 12:35 PM on June 19, 2020: member

    cc @vasild

  9. promag commented at 12:48 PM on June 19, 2020: contributor

    ClientModel::getBestBlockHash(this=0x0000000000000000) 👀

  10. hebasto commented at 1:14 PM on June 19, 2020: member

    The results of the commit digging.

    The regression was supposedly introduced in https://github.com/bitcoin/bitcoin/pull/17993.

    Steps to reproduce:

    • precondition: the old chain
    • start bitcoin-qt
    • wait until sync
    • on main window: Menu -> File -> Quit
    • crash
  11. ryanofsky commented at 1:35 PM on June 19, 2020: contributor

    re: #7 (comment)

    ClientModel::getBestBlockHash(this=0x0000000000000000)

    From stack trace, call happens on this line:

    https://github.com/bitcoin-core/gui/blob/dbd7a91fdf3ff801fe5e4107e8346d0d6d11a899/src/qt/transactiontablemodel.cpp#L667

    As a minimal fix, walletModel->clientModel().getBestBlockHash() here could be replaced by a more direct walletMode->getLastBlockProcessed() call. This method could be implemented to either return m_cached_last_update_tip to go back to pre-#17993 behavior or return m_client_model ? m_client_model->getBestBlockHash() : uint256{} to keep the current behavior but avoid crashing.

    Review comment https://github.com/bitcoin/bitcoin/pull/17993#discussion_r430655941 describes differences between two behaviors and also what ideal behavior would be.

  12. hebasto commented at 2:19 PM on June 19, 2020: member

    @ryanofsky Thank you Russ! Mind looking into #8?

  13. MarcoFalke closed this on Jun 26, 2020

  14. MarcoFalke closed this on Jun 26, 2020

  15. laanwj referenced this in commit 31bdd86631 on Jul 15, 2020
  16. laanwj referenced this in commit 924a4ff7eb on Oct 29, 2020
  17. jonasschnelli referenced this in commit c33662a0ea on Dec 2, 2020
  18. MarcoFalke referenced this in commit 590e49ccf2 on Apr 4, 2021
  19. MarcoFalke referenced this in commit bce09da122 on Apr 28, 2021
  20. fanquake referenced this in commit fa00bb2c5c on Apr 29, 2021
  21. MarcoFalke referenced this in commit eb9a1fe037 on May 7, 2021
  22. laanwj referenced this in commit ee9befe8b4 on May 12, 2021
  23. MarcoFalke referenced this in commit c857148636 on May 15, 2021
  24. MarcoFalke referenced this in commit 444b6b342d on Feb 15, 2022
  25. bitcoin-core locked this on Feb 15, 2022
Labels
Linked (view graph)
#1 gui: Remove unused `Decrypt` wallet#2 Activate travis in this repo#3 scripted-diff: Make SeparatorStyle a scoped enum#4 UI external signer support (e.g. hardware wallet)#5 [meta] GUI repo Questions and Feedback#6 Do not truncate node flag strings in debugwindow peers details tab#8 Fix regression in TransactionTableModel#9 PSA: ASan Travis instance always times out, rebase#10 Use random free port for test_bitcoin-qt#11 Remove needless headers from qt/walletview.cpp#12 test: Tsan times out on travis, move to cirrus#13 Hide peer detail view if multiple are selected#14 scripted-diff: rename movie folder to animation#15 Update pruning tooltip#16 [Open Wallet] click freeze system, when in sync node#17 doc: Remove outdated comment in TransactionTablePriv#18 Add peertablesortproxy module#19 Import dialog#20 Wrap tooltips in the intro window#21 Update pruning tooltip, original author BitcoinErrorLog#22 The GUI appears non-responsive when the 'still syncing' overlay is visible#23 Make clickable elements look clickable -- warning symbol buttons on Overview screen#24 Give primary action items more visual weight#25 Make Close/OK buttons consistent across all windows#26 Establish better delineation between Node & Wallet#27 Move the UI window style to a top to bottom layout#28 bitcoin-qt 20. GUI opens empty#29 refactor: Optimize signal-slot connections logic#30 Disable the main window toolbar when the modal overlay is shown#31 Generate .desktop file for Gnome and other desktop environments.#32 Bitcoin Core on Ubuntu 18.04 not allowing to chose data directory#33 QFileDialog fails to use platform-native dialog if static linked#34 Show permissions instead of whitelisted#35 Parse params directly instead of through node (partial revert #10244)#36 Deprecation warnings when building against Qt 5.15#37 indicate explicit to the user that the wallet balances shown is watch only.#247 bitcoin-qt stays at "Done loading" for a long time#545 SIGABRT on macOS after Dock menu --> Quit#668 Got stuck in "loading wallets", then segfault on closing#689 Segmentation fault when closing while loading wallets#785 New crash in v26.0#796 ci_native_asan: UndefinedBehaviorSanitizer: null-pointer-use qt/test/wallettests.cpp:424:25 in#880 SegFault in QSortFilterProxyModelPrivate::build_source_to_proxy_mapping

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: 2026-04-14 18:20 UTC

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