Starting with an unsupported wallet configured leads to a segfault (master only?) #25146

issue luke-jr openend this issue on May 16, 2022
  1. luke-jr commented at 5:48 pm on May 16, 2022: member
     0[#0](/bitcoin-bitcoin/0/)  __ubsan::UBsanOnDeadlySignal(int, void*, void*) ()
     1    at /var/tmp/portage/sys-libs/compiler-rt-sanitizers-13.0.1/work/compiler-rt/lib/ubsan/ubsan_signals_standalone.cpp:53
     2[#1](/bitcoin-bitcoin/1/)  <signal handler called>
     3[#2](/bitcoin-bitcoin/2/)  std::__detail::_List_node_base::_M_unhook (this=0x13dca9a70)
     4    at /var/tmp/portage/sys-devel/gcc-11.2.0/work/gcc-11.2.0/libstdc++-v3/src/c++98/list.cc:141
     5[#3](/bitcoin-bitcoin/3/)  0x000000011f25c9c0 in std::__cxx11::list<std::function<void (std::unique_ptr<interfaces::Wallet, std::default_delete<interfaces::Wallet> >)>, std::allocator<std::function<void (std::unique_ptr<interfaces::Wallet, std::default_delete<interfaces::Wallet> >)> > >::_M_erase(std::_List_iterator<std::function<void (std::unique_ptr<interfaces::Wallet, std::default_delete<interfaces::Wallet> >)> >) (this=0x7ffef8013e98, __position=...)
     6    at /usr/lib/gcc/powerpc64le-unknown-linux-gnu/11.2.0/include/g++-v11/bits/stl_list.h:1922
     7[#4](/bitcoin-bitcoin/4/)  0x000000011f241cc4 in std::__cxx11::list<std::function<void (std::unique_ptr<interfaces::Wallet, std::default_delete<interfaces::Wallet> >)>, std::allocator<std::function<void (std::unique_ptr<interfaces::Wallet, std::default_delete<interfaces::Wallet> >)> > >::erase(std::_List_const_iterator<std::function<void (std::unique_ptr<interfaces::Wallet, std::default_delete<interfaces::Wallet> >)> >) (this=0x7ffef8013e98, __position=...)
     8    at /usr/lib/gcc/powerpc64le-unknown-linux-gnu/11.2.0/include/g++-v11/bits/list.tcc:158
     9[#5](/bitcoin-bitcoin/5/)  wallet::HandleLoadWallet(wallet::WalletContext&, std::function<void (std::unique_ptr<interfaces::Wallet, std::default_delete<interfaces::Wallet> >)>)::$_1::operator()() const (this=<optimized out>) at wallet/wallet.cpp:165
    10[#6](/bitcoin-bitcoin/6/)  std::__invoke_impl<void, wallet::HandleLoadWallet(wallet::WalletContext&, std::function<void (std::unique_ptr<interfaces::Wallet, std::default_delete<interfaces::Wallet> >)>)::$_1&>(std::__invoke_other, wallet::HandleLoadWallet(wallet::WalletContext&, std::function<void (std::unique_ptr<interfaces::Wallet, std::default_delete<interfaces::Wallet> >)>)::$_1&) (__f=...) at /usr/lib/gcc/powerpc64le-unknown-linux-gnu/11.2.0/include/g++-v11/bits/invoke.h:61
    11[#7](/bitcoin-bitcoin/7/)  std::__invoke_r<void, wallet::HandleLoadWallet(wallet::WalletContext&, std::function<void (std::unique_ptr<interfaces::Wallet, std::default_delete<interfaces::Wallet> >)>)::$_1&>(wallet::HandleLoadWallet(wallet::WalletContext&, std::function<void (std::unique_ptr<interfaces::Wallet, std::default_delete<interfaces::Wallet> >)>)::$_1&) (__fn=...) at /usr/lib/gcc/powerpc64le-unknown-linux-gnu/11.2.0/include/g++-v11/bits/invoke.h:111
    12[#8](/bitcoin-bitcoin/8/)  std::_Function_handler<void (), wallet::HandleLoadWallet(wallet::WalletContext&, std::function<void (std::unique_ptr<interfaces::Wallet, std::default_delete<interfaces::Wallet> >)>)::$_1>::_M_invoke(std::_Any_data const&) (__functor=...)
    13    at /usr/lib/gcc/powerpc64le-unknown-linux-gnu/11.2.0/include/g++-v11/bits/std_function.h:291
    14[#9](/bitcoin-bitcoin/9/)  0x000000011e8fb1f8 in std::function<void ()>::operator()() const (this=<optimized out>)
    15    at /usr/lib/gcc/powerpc64le-unknown-linux-gnu/11.2.0/include/g++-v11/bits/std_function.h:560
    16[#10](/bitcoin-bitcoin/10/) 0x000000011f08d6c0 in interfaces::(anonymous namespace)::CleanupHandler::~CleanupHandler (this=0x7ffef801edd0) at interfaces/handler.cpp:28
    17[#11](/bitcoin-bitcoin/11/) 0x000000011f08d7fc in interfaces::(anonymous namespace)::CleanupHandler::~CleanupHandler (this=0x7ffef801edd0) at interfaces/handler.cpp:28
    18[#12](/bitcoin-bitcoin/12/) 0x000000011e7fcd34 in std::default_delete<interfaces::Handler>::operator() (__ptr=0x7ffef801edd0, this=<optimized out>) at /usr/lib/gcc/powerpc64le-unknown-linux-gnu/11.2.0/include/g++-v11/bits/unique_ptr.h:85
    19[#13](/bitcoin-bitcoin/13/) std::unique_ptr<interfaces::Handler, std::default_delete<interfaces::Handler> >::~unique_ptr (this=<optimized out>) at /usr/lib/gcc/powerpc64le-unknown-linux-gnu/11.2.0/include/g++-v11/bits/unique_ptr.h:361
    20[#14](/bitcoin-bitcoin/14/) 0x000000011e90e038 in SplashScreen::~SplashScreen (this=0x13dc49f00) at qt/splashscreen.cpp:138
    21[#15](/bitcoin-bitcoin/15/) 0x000000011e90e6ec in SplashScreen::~SplashScreen (this=0x13dc49f00) at qt/splashscreen.cpp:136
    22[#16](/bitcoin-bitcoin/16/) 0x00007fffa4ff35f4 in qDeleteInEventHandler (o=<optimized out>) at /var/tmp/portage/dev-qt/qtcore-5.15.3/work/qtbase-everywhere-src-5.15.3/src/corelib/kernel/qobject.cpp:4815
    23[#17](/bitcoin-bitcoin/17/) 0x00007fffa4ff8550 in QObject::event (this=<optimized out>, e=<optimized out>) at /var/tmp/portage/dev-qt/qtcore-5.15.3/work/qtbase-everywhere-src-5.15.3/src/corelib/kernel/qobject.cpp:1301
    24[#18](/bitcoin-bitcoin/18/) 0x00007fffa45bd41c in QWidget::event (this=0x13dc49f00, event=0x7fff98023f40) at /var/tmp/portage/dev-qt/qtwidgets-5.15.3/work/qtbase-everywhere-src-5.15.3/src/widgets/kernel/qwidget.cpp:9094
    25[#19](/bitcoin-bitcoin/19/) 0x00007fffa455da70 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x13dc49f00, e=0x7fff98023f40) at /var/tmp/portage/dev-qt/qtwidgets-5.15.3/work/qtbase-everywhere-src-5.15.3/src/widgets/kernel/qapplication.cpp:3637
    26[#20](/bitcoin-bitcoin/20/) 0x00007fffa4569374 in QApplication::notify (this=0x7ffff9f207a0, receiver=0x13dc49f00, e=0x7fff98023f40) at /var/tmp/portage/dev-qt/qtwidgets-5.15.3/work/qtbase-everywhere-src-5.15.3/src/widgets/kernel/qapplication.cpp:3587
    27[#21](/bitcoin-bitcoin/21/) 0x00007fffa4faec80 in QCoreApplication::notifyInternal2 (receiver=0x13dc49f00, event=0x7fff98023f40) at /var/tmp/portage/dev-qt/qtcore-5.15.3/work/qtbase-everywhere-src-5.15.3/src/corelib/kernel/qcoreapplication.cpp:1064
    28[#22](/bitcoin-bitcoin/22/) 0x00007fffa4faf00c in QCoreApplication::sendEvent (receiver=<optimized out>, event=<optimized out>) at /var/tmp/portage/dev-qt/qtcore-5.15.3/work/qtbase-everywhere-src-5.15.3/src/corelib/kernel/qcoreapplication.cpp:1462
    29[#23](/bitcoin-bitcoin/23/) 0x00007fffa4fb3ee4 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x13dad8900) at /var/tmp/portage/dev-qt/qtcore-5.15.3/work/qtbase-everywhere-src-5.15.3/src/corelib/kernel/qcoreapplication.cpp:1821
    30[#24](/bitcoin-bitcoin/24/) 0x00007fffa4fb4244 in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=<optimized out>) at /var/tmp/portage/dev-qt/qtcore-5.15.3/work/qtbase-everywhere-src-5.15.3/src/corelib/kernel/qcoreapplication.cpp:1680
    31[#25](/bitcoin-bitcoin/25/) 0x00007fffa5037290 in postEventSourceDispatch (s=0x13dbb9ce0) at /var/tmp/portage/dev-qt/qtcore-5.15.3/work/qtbase-everywhere-src-5.15.3/src/corelib/kernel/qeventdispatcher_glib.cpp:277
    32[#26](/bitcoin-bitcoin/26/) 0x00007fffa22e9794 in g_main_dispatch (context=context@entry=0x7fff98019230) at ../glib-2.70.4/glib/gmain.c:3381
    33[#27](/bitcoin-bitcoin/27/) 0x00007fffa22ee930 in g_main_context_dispatch (context=0x7fff98019230) at ../glib-2.70.4/glib/gmain.c:4099
    34[#28](/bitcoin-bitcoin/28/) 0x00007fffa22eeb58 in g_main_context_iterate (context=context@entry=0x7fff98019230, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib-2.70.4/glib/gmain.c:4175
    35[#29](/bitcoin-bitcoin/29/) 0x00007fffa22eec60 in g_main_context_iteration (context=0x7fff98019230, may_block=<optimized out>) at ../glib-2.70.4/glib/gmain.c:4240
    36[#30](/bitcoin-bitcoin/30/) 0x00007fffa5036e7c in QEventDispatcherGlib::processEvents (this=0x13dbbcc70, flags=...) at /var/tmp/portage/dev-qt/qtcore-5.15.3/work/qtbase-everywhere-src-5.15.3/src/corelib/kernel/qeventdispatcher_glib.cpp:423
    37[#31](/bitcoin-bitcoin/31/) 0x00007fff9ef44e64 in QXcbGlibEventDispatcher::processEvents (this=<optimized out>, flags=...) at /var/tmp/portage/dev-qt/qtgui-5.15.3/work/qtbase-everywhere-src-5.15.3/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp:143
    38[#32](/bitcoin-bitcoin/32/) 0x00007fffa4fabcc8 in QEventLoop::processEvents (this=<optimized out>, flags=...) at /var/tmp/portage/dev-qt/qtcore-5.15.3/work/qtbase-everywhere-src-5.15.3/src/corelib/kernel/qeventloop.cpp:139
    39[#33](/bitcoin-bitcoin/33/) 0x00007fffa4fac488 in QEventLoop::exec (this=0x7ffff9f204c8, flags=...) at /var/tmp/portage/dev-qt/qtcore-5.15.3/work/qtbase-everywhere-src-5.15.3/include/QtCore/../../src/corelib/global/qflags.h:69
    40[#34](/bitcoin-bitcoin/34/) 0x00007fffa4fb9588 in QCoreApplication::exec () at /var/tmp/portage/dev-qt/qtcore-5.15.3/work/qtbase-everywhere-src-5.15.3/include/QtCore/../../src/corelib/global/qflags.h:121
    41[#35](/bitcoin-bitcoin/35/) 0x00007fffa3d5704c in QGuiApplication::exec () at /var/tmp/portage/dev-qt/qtgui-5.15.3/work/qtbase-everywhere-src-5.15.3/src/gui/kernel/qguiapplication.cpp:1867
    42[#36](/bitcoin-bitcoin/36/) 0x00007fffa455d98c in QApplication::exec () at /var/tmp/portage/dev-qt/qtwidgets-5.15.3/work/qtbase-everywhere-src-5.15.3/src/widgets/kernel/qapplication.cpp:2829
    43[#37](/bitcoin-bitcoin/37/) 0x000000011e7b4354 in GuiMain (argc=<optimized out>, argv=<optimized out>) at qt/bitcoin.cpp:661
    44[#38](/bitcoin-bitcoin/38/) 0x000000011e7ac070 in main (argc=<optimized out>, argv=<optimized out>) at qt/main.cpp:21
    
  2. luke-jr added the label Bug on May 16, 2022
  3. achow101 commented at 6:56 pm on May 16, 2022: member
    Unsupported wallet in what way? As in SQLite wallet when only BDB is configured or vice versa? Or something else?
  4. luke-jr commented at 10:34 pm on May 16, 2022: member
    Right, I had a build w/o sqlite enabled, and a sqlite wallet in the loaded wallet list
  5. MarcoFalke added the label Wallet on May 17, 2022
  6. jonatack commented at 2:28 pm on May 17, 2022: contributor
    @luke-jr good find, are you working on tests and a fix?
  7. bitcoin deleted a comment on May 17, 2022
  8. bitcoin deleted a comment on May 17, 2022
  9. bitcoin deleted a comment on May 17, 2022
  10. bitcoin deleted a comment on May 17, 2022
  11. luke-jr commented at 7:33 pm on May 17, 2022: member
    No, the code involved is too convoluted to follow
  12. luke-jr commented at 9:33 pm on May 17, 2022: member
    Bisected to f3a17bbe5f7d23b6ecc20e363920492b50859dad. Reverting fixes the crash.
  13. achow101 commented at 9:59 pm on May 17, 2022: member

    @luke-jr can you try this diff:

     0diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
     1index 8cac28400f..21a499ea49 100644
     2--- a/src/qt/bitcoin.cpp
     3+++ b/src/qt/bitcoin.cpp
     4@@ -361,7 +361,7 @@ void BitcoinApplication::requestShutdown()
     5     pollShutdownTimer->stop();
     6 
     7 #ifdef ENABLE_WALLET
     8-    // Delete wallet controller here manually, instead of relying on Qt object
     9+    // Delete splash screen and wallet controller here manually, instead of relying on Qt object
    10     // tracking (https://doc.qt.io/qt-5/objecttrees.html). This makes sure
    11     // walletmodel m_handle_* notification handlers are deleted before wallets
    12     // are unloaded, which can simplify wallet implementations. It also avoids
    13@@ -369,6 +369,8 @@ void BitcoinApplication::requestShutdown()
    14     // destroyed, making GUI code less fragile as well.
    15     delete m_wallet_controller;
    16     m_wallet_controller = nullptr;
    17+    delete m_splash;
    18+    m_splash = nullptr;
    19 #endif // ENABLE_WALLET
    20 
    21     delete clientModel;
    
  14. luke-jr commented at 11:22 pm on May 17, 2022: member
    That seems to fix it, yes
  15. hebasto commented at 5:59 pm on May 22, 2022: member
    Implemented in bitcoin-core/gui#605.
  16. fanquake commented at 2:19 pm on August 8, 2022: member
    Given there is both an open issue https://github.com/bitcoin-core/gui/issues/604, and PR implementing a fix https://github.com/bitcoin-core/gui/pull/605 in the GUI repo, I’m going to close the issue here.
  17. fanquake closed this on Aug 8, 2022

  18. hebasto referenced this in commit 497f26552b on Dec 20, 2022
  19. bitcoin locked this on Aug 8, 2023

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-12-27 15:12 UTC

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