implicit-integer-sign-change wallet/interfaces.cpp:289:57 #805

issue maflcko openend this issue on March 20, 2024
  1. maflcko commented at 6:59 pm on March 20, 2024: contributor

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    0wallet/interfaces.cpp:289:57: runtime error: implicit conversion from type 'int' of value -1 (32-bit, signed) to type 'unsigned int' changed the value to 4294967295 (32-bit, unsigned)
    1    [#0](/bitcoin-core-gui/0/) 0x55dcca43aaea in wallet::(anonymous namespace)::WalletImpl::createTransaction(std::vector<wallet::CRecipient, std::allocator<wallet::CRecipient>> const&, wallet::CCoinControl const&, bool, int&, long&) src/wallet/interfaces.cpp:289:57
    2    [#1](/bitcoin-core-gui/1/) 0x55dcc9439953 in WalletModel::prepareTransaction(WalletModelTransaction&, wallet::CCoinControl const&) src/qt/walletmodel.cpp:211:37
    3    [#2](/bitcoin-core-gui/2/) 0x55dcc9624ce5 in SendCoinsDialog::PrepareSendText(QString&, QString&, QString&) src/qt/sendcoinsdialog.cpp:287:28
    4    [#3](/bitcoin-core-gui/3/) 0x55dcc960c98b in SendCoinsDialog::sendButtonClicked(bool) src/qt/sendcoinsdialog.cpp:482:10
    5    [#4](/bitcoin-core-gui/4/) 0x55dcc9665fdc in auto auto GUIUtil::ExceptionSafeConnect<QPushButton*, void (QAbstractButton::*)(bool), SendCoinsDialog*, void (SendCoinsDialog::*)(bool)>(QPushButton*, void (QAbstractButton::*)(bool), SendCoinsDialog*, void (SendCoinsDialog::*)(bool), Qt::ConnectionType)::'lambda'(auto&&...)::operator()<bool&>(auto&&...) const src/./qt/guiutil.h:400:21
    

    Expected behaviour

    no sign change

    Steps to reproduce

    • Compile with integer sanitizer
    • Create transaction in the gui

    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

    Linux

    Machine specifications

    No response

  2. maflcko commented at 7:01 pm on March 20, 2024: contributor
    I presume this is easy to fix. I presume it is the change position and not hiding a bug. The fix will probably be to just use decltype to ensure the type is the same as the one in the coin control struct?
  3. furszy commented at 5:35 pm on March 21, 2024: member

    If the line in question is this one:

    0change_pos = txr.change_pos ? *txr.change_pos : -1;
    

    I’m not seeing the issue. change_pos is an int and txr.change_pos is an optional<unsigned int>.

    Yet, we could clean this code by making the CreatedTransactionResult struct reachable from the GUI code (just need to move it to another file).

  4. furszy commented at 12:57 pm on March 22, 2024: member

    Yet, we could clean this code by making the CreatedTransactionResult struct reachable from the GUI code (just need to move it to another file).

    Self follow-up #807.

  5. pablomartin4btc commented at 3:55 am on March 27, 2024: contributor

    How can I reproduce the issue?

    I’ve tried on Ubuntu 22.04 with these configures:

    • ./configure --with-incompatible-bdb --enable-suppress-external-warnings --with-sqlite --without-bdb --with-sanitizers=undefined,integer CC=clang CXX=clang++
    • ./configure --with-incompatible-bdb --enable-suppress-external-warnings --with-sqlite --without-bdb --with-sanitizers=integer CC=clang CXX=clang++
    • ./configure --with-incompatible-bdb --enable-suppress-external-warnings --with-sqlite --without-bdb --with-sanitizers=signed-integer-overflow CC=clang CXX=clang++

    Got a lot of errors on the crypto library:

    0SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:146:76 in 
    1crypto/sha256.cpp:147:50: runtime error: unsigned integer overflow: 1986661051 + 3477181053 cannot be represented in type 'unsigned int'
    2...
    3
    4script/interpreter.cpp:1066:42: runtime error: unsigned integer overflow: 2 + 18446744073709551615 cannot be represented in type 'unsigned long'
    5SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior script/interpreter.cpp:1066:42 in 
    6/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_algobase.h:385:20: runtime error: implicit conversion from type 'char' of value -24 (8-bit, signed) to type 'unsigned char' changed the value to 232 (8-bit, unsigned)
    7SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_algobase.h:385:20 in 
    

    Tried bitcoin-qt on regtest, sent some sats and got this (after the above):

    0src/hash_impl.h:79:5: runtime error: unsigned integer overflow: 4281340545 + 113926993 cannot be represented in type 'unsigned int'
    1SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/hash_impl.h:79:5 in 
    
  6. maflcko commented at 8:21 am on March 27, 2024: contributor

    @pablomartin4btc Make sure to apply the existing suppressions, as explained in the docs.

    0$ git grep UBSAN doc/
    

    You can then also change halt_on_error=1 to halt_on_error=0, to continue execution when a new error was found.

  7. pablomartin4btc commented at 4:37 pm on March 27, 2024: contributor

    Thanks @maflcko, that worked and now I don’t get the unwanted errors.

    I’m sorry I still can’t reproduce the issue (on both master branches, this repo and bitcoin/bitcoin one):

    0export UBSAN_OPTIONS="suppressions=$(pwd)/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1"
    1./configure --with-incompatible-bdb --enable-suppress-external-warnings --with-sqlite --without-bdb --with-sanitizers=undefined,integer CC=clang CXX=clang++
    

    Am I missing something else?

  8. maflcko commented at 6:15 pm on March 27, 2024: contributor

    IIRC, my steps were to start with a fresh regtest datadir, mine 101 blocks to a fresh wallet, then create a self-transfer transaction in the GUI.

    Did you do the same?

    I’m sorry I still can’t reproduce the issue (on both master branches, this repo and bitcoin/bitcoin one):

    The branches are identical (from the commit hash), as it expected in a monotree, so there is no need to check both.

  9. pablomartin4btc commented at 7:24 pm on March 27, 2024: contributor

    Did you do the same?

    I think I did but I have been using it for a while. Let me start fresh from scratch as you’ve well indicated it.

  10. pablomartin4btc commented at 9:05 pm on March 27, 2024: contributor

    I’ve managed to reproduce the issue now, thanks @maflcko!

    Tested on Ubuntu 22.04 following the steps described above ("… start with a fresh regtest datadir, mine 101 blocks to a fresh wallet, then create a self-transfer transaction in the GUI.").

     0./src/qt/bitcoin-qt -regtest -datadir=$QT_ISSUE_806_TEST_DIR
     1
     2Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
     3qt/notificator.cpp:115:40: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 256 (32-bit, unsigned) to type 'char' changed the value to 0 (8-bit, signed)
     4    [#0](/bitcoin-core-gui/0/) 0x5d567f6b8ca8 in FreedesktopImage::FreedesktopImage(QImage const&) src/./src/qt/notificator.cpp:115:40
     5    [#1](/bitcoin-core-gui/1/) 0x5d567f6b918c in FreedesktopImage::toVariant(QImage const&) src/./src/qt/notificator.cpp:140:22
     6    [#2](/bitcoin-core-gui/2/) 0x5d567f6b958b in Notificator::notifyDBus(Notificator::Class, QString const&, QString const&, QIcon const&, int) src/./src/qt/notificator.cpp:190:26
     7    [#3](/bitcoin-core-gui/3/) 0x5d567f6b9cab in Notificator::notify(Notificator::Class, QString const&, QString const&, QIcon const&, int) src/./src/qt/notificator.cpp:227:9
     8    [#4](/bitcoin-core-gui/4/) 0x5d567f65b601 in BitcoinGUI::message(QString const&, QString, unsigned int, bool*, QString const&) src/./src/qt/bitcoingui.cpp:1267:22
     9    [#5](/bitcoin-core-gui/5/) 0x5d567f65821b in BitcoinGUI::incomingTransaction(QString const&, BitcoinUnits::Unit, long const&, QString const&, QString const&, QString const&, QString const&) src/./src/qt/bitcoingui.cpp:1348:5
    10    [#6](/bitcoin-core-gui/6/) 0x5d567f673d69 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1, 2, 3, 4, 5, 6>, QtPrivate::List<QString const&, BitcoinUnits::Unit, long const&, QString const&, QString const&, QString const&, QString const&>, void, void (BitcoinGUI::*)(QString const&, BitcoinUnits::Unit, long const&, QString const&, QString const&, QString const&, QString const&)>::call(void (BitcoinGUI::*)(QString const&, BitcoinUnits::Unit, long const&, QString const&, QString const&, QString const&, QString const&), BitcoinGUI*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:152:13
    11    [#7](/bitcoin-core-gui/7/) 0x5d567f6739c8 in void QtPrivate::FunctionPointer<void (BitcoinGUI::*)(QString const&, BitcoinUnits::Unit, long const&, QString const&, QString const&, QString const&, QString const&)>::call<QtPrivate::List<QString const&, BitcoinUnits::Unit, long const&, QString const&, QString const&, QString const&, QString const&>, void>(void (BitcoinGUI::*)(QString const&, BitcoinUnits::Unit, long const&, QString const&, QString const&, QString const&, QString const&), BitcoinGUI*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:185:13
    12    [#8](/bitcoin-core-gui/8/) 0x5d567f6739c8 in QtPrivate::QSlotObject<void (BitcoinGUI::*)(QString const&, BitcoinUnits::Unit, long const&, QString const&, QString const&, QString const&, QString const&), QtPrivate::List<QString const&, BitcoinUnits::Unit, long const&, QString const&, QString const&, QString const&, QString const&>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:418:17
    13    [#9](/bitcoin-core-gui/9/) 0x76d40ecf1792  (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2f1792) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    14    [#10](/bitcoin-core-gui/10/) 0x5d567f80db60 in WalletView::incomingTransaction(QString const&, BitcoinUnits::Unit, long const&, QString const&, QString const&, QString const&, QString const&) src/./src/qt/moc_walletview.cpp:334:5
    15    [#11](/bitcoin-core-gui/11/) 0x5d567f7d5916 in WalletView::processNewTransaction(QModelIndex const&, int, int) src/./src/qt/walletview.cpp:143:12
    16    [#12](/bitcoin-core-gui/12/) 0x5d567f7dc790 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1, 2>, QtPrivate::List<QModelIndex const&, int, int>, void, void (WalletView::*)(QModelIndex const&, int, int)>::call(void (WalletView::*)(QModelIndex const&, int, int), WalletView*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:152:13
    17    [#13](/bitcoin-core-gui/13/) 0x5d567f7dc508 in void QtPrivate::FunctionPointer<void (WalletView::*)(QModelIndex const&, int, int)>::call<QtPrivate::List<QModelIndex const&, int, int>, void>(void (WalletView::*)(QModelIndex const&, int, int), WalletView*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:185:13
    18    [#14](/bitcoin-core-gui/14/) 0x5d567f7dc508 in QtPrivate::QSlotObject<void (WalletView::*)(QModelIndex const&, int, int), QtPrivate::List<QModelIndex const&, int, int>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:418:17
    19    [#15](/bitcoin-core-gui/15/) 0x76d40ecf1792  (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2f1792) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    20    [#16](/bitcoin-core-gui/16/) 0x76d40ec52cb1 in QAbstractItemModel::rowsInserted(QModelIndex const&, int, int, QAbstractItemModel::QPrivateSignal) (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x252cb1) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    21    [#17](/bitcoin-core-gui/17/) 0x76d40ec5b3f1 in QAbstractItemModel::endInsertRows() (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x25b3f1) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    22    [#18](/bitcoin-core-gui/18/) 0x5d567f91e030 in TransactionTablePriv::updateWallet(interfaces::Wallet&, uint256 const&, int, bool) src/./src/qt/transactiontablemodel.cpp:184:29
    23    [#19](/bitcoin-core-gui/19/) 0x5d567f9160fd in TransactionTableModel::updateTransaction(QString const&, int, bool) src/./src/qt/transactiontablemodel.cpp:282:11
    24    [#20](/bitcoin-core-gui/20/) 0x5d567f7ff5e5 in TransactionTableModel::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) src/./src/qt/moc_transactiontablemodel.cpp:92:21
    25    [#21](/bitcoin-core-gui/21/) 0x76d40ece741d in QObject::event(QEvent*) (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2e741d) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    26    [#22](/bitcoin-core-gui/22/) 0x76d40e36c712 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x16c712) (BuildId: 5dfa607522386957ffec95c0a46150c189e064bd)
    27    [#23](/bitcoin-core-gui/23/) 0x76d40ecb9e39 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2b9e39) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    28    [#24](/bitcoin-core-gui/24/) 0x76d40ecbcf26 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2bcf26) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    29    [#25](/bitcoin-core-gui/25/) 0x76d40ed13a66  (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x313a66) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    30    [#26](/bitcoin-core-gui/26/) 0x76d40cb20d3a in g_main_context_dispatch (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55d3a) (BuildId: c74e800dfd5f72649d673b44292f4a817e45150b)
    31    [#27](/bitcoin-core-gui/27/) 0x76d40cb76257  (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0xab257) (BuildId: c74e800dfd5f72649d673b44292f4a817e45150b)
    32    [#28](/bitcoin-core-gui/28/) 0x76d40cb1e3e2 in g_main_context_iteration (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x533e2) (BuildId: c74e800dfd5f72649d673b44292f4a817e45150b)
    33    [#29](/bitcoin-core-gui/29/) 0x76d40ed130b7 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x3130b7) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    34    [#30](/bitcoin-core-gui/30/) 0x76d40ecb875a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2b875a) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    35    [#31](/bitcoin-core-gui/31/) 0x76d40ecc0cf3 in QCoreApplication::exec() (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2c0cf3) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    36    [#32](/bitcoin-core-gui/32/) 0x5d567f62244d in GuiMain(int, char**) src/./src/qt/bitcoin.cpp:706:13
    37    [#33](/bitcoin-core-gui/33/) 0x5d567f619ef1 in main src/./src/qt/main.cpp:26:12
    38    [#34](/bitcoin-core-gui/34/) 0x76d40d229d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    39    [#35](/bitcoin-core-gui/35/) 0x76d40d229e3f in __libc_start_main csu/../csu/libc-start.c:392:3
    40    [#36](/bitcoin-core-gui/36/) 0x5d567f5f0314 in _start (/home/pablo/workspace/bitcoin/src/qt/bitcoin-qt+0xce2314) (BuildId: d5048cc1e20b13b8211302204fa3fe22df5d6109)
    41
    42SUMMARY: UndefinedBehaviorSanitizer: implicit-signed-integer-truncation-or-sign-change qt/notificator.cpp:115:40 in 
    
     0
     1./src/qt/bitcoin-qt -regtest -datadir=$QT_ISSUE_806_TEST_DIR
     2
     3Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
     4qt/walletview.cpp:137:21: runtime error: implicit conversion from type 'qulonglong' (aka 'unsigned long long') of value 18446744073709526475 (64-bit, unsigned) to type 'qint64' (aka 'long long') changed the value to -25141 (64-bit, signed)
     5    [#0](/bitcoin-core-gui/0/) 0x5c78914a7ae2 in WalletView::processNewTransaction(QModelIndex const&, int, int) src/./src/qt/walletview.cpp:137:21
     6    [#1](/bitcoin-core-gui/1/) 0x5c78914ae790 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1, 2>, QtPrivate::List<QModelIndex const&, int, int>, void, void (WalletView::*)(QModelIndex const&, int, int)>::call(void (WalletView::*)(QModelIndex const&, int, int), WalletView*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:152:13
     7    [#2](/bitcoin-core-gui/2/) 0x5c78914ae508 in void QtPrivate::FunctionPointer<void (WalletView::*)(QModelIndex const&, int, int)>::call<QtPrivate::List<QModelIndex const&, int, int>, void>(void (WalletView::*)(QModelIndex const&, int, int), WalletView*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:185:13
     8    [#3](/bitcoin-core-gui/3/) 0x5c78914ae508 in QtPrivate::QSlotObject<void (WalletView::*)(QModelIndex const&, int, int), QtPrivate::List<QModelIndex const&, int, int>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:418:17
     9    [#4](/bitcoin-core-gui/4/) 0x75bacccf1792  (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2f1792) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    10    [#5](/bitcoin-core-gui/5/) 0x75baccc52cb1 in QAbstractItemModel::rowsInserted(QModelIndex const&, int, int, QAbstractItemModel::QPrivateSignal) (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x252cb1) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    11    [#6](/bitcoin-core-gui/6/) 0x75baccc5b3f1 in QAbstractItemModel::endInsertRows() (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x25b3f1) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    12    [#7](/bitcoin-core-gui/7/) 0x5c78915f0030 in TransactionTablePriv::updateWallet(interfaces::Wallet&, uint256 const&, int, bool) src/./src/qt/transactiontablemodel.cpp:184:29
    13    [#8](/bitcoin-core-gui/8/) 0x5c78915e80fd in TransactionTableModel::updateTransaction(QString const&, int, bool) src/./src/qt/transactiontablemodel.cpp:282:11
    14    [#9](/bitcoin-core-gui/9/) 0x5c78914d15e5 in TransactionTableModel::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) src/./src/qt/moc_transactiontablemodel.cpp:92:21
    15    [#10](/bitcoin-core-gui/10/) 0x75baccce741d in QObject::event(QEvent*) (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2e741d) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    16    [#11](/bitcoin-core-gui/11/) 0x75bacc36c712 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x16c712) (BuildId: 5dfa607522386957ffec95c0a46150c189e064bd)
    17    [#12](/bitcoin-core-gui/12/) 0x75bacccb9e39 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2b9e39) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    18    [#13](/bitcoin-core-gui/13/) 0x75bacccbcf26 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2bcf26) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    19    [#14](/bitcoin-core-gui/14/) 0x75baccd13a66  (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x313a66) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    20    [#15](/bitcoin-core-gui/15/) 0x75bacab20d3a in g_main_context_dispatch (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55d3a) (BuildId: c74e800dfd5f72649d673b44292f4a817e45150b)
    21    [#16](/bitcoin-core-gui/16/) 0x75bacab76257  (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0xab257) (BuildId: c74e800dfd5f72649d673b44292f4a817e45150b)
    22    [#17](/bitcoin-core-gui/17/) 0x75bacab1e3e2 in g_main_context_iteration (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x533e2) (BuildId: c74e800dfd5f72649d673b44292f4a817e45150b)
    23    [#18](/bitcoin-core-gui/18/) 0x75baccd130b7 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x3130b7) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    24    [#19](/bitcoin-core-gui/19/) 0x75bacccb875a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2b875a) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    25    [#20](/bitcoin-core-gui/20/) 0x75bacccc0cf3 in QCoreApplication::exec() (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2c0cf3) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    26    [#21](/bitcoin-core-gui/21/) 0x5c78912f444d in GuiMain(int, char**) src/./src/qt/bitcoin.cpp:706:13
    27    [#22](/bitcoin-core-gui/22/) 0x5c78912ebef1 in main src/./src/qt/main.cpp:26:12
    28    [#23](/bitcoin-core-gui/23/) 0x75bacb229d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    29    [#24](/bitcoin-core-gui/24/) 0x75bacb229e3f in __libc_start_main csu/../csu/libc-start.c:392:3
    30    [#25](/bitcoin-core-gui/25/) 0x5c78912c2314 in _start (/home/pablo/workspace/bitcoin/src/qt/bitcoin-qt+0xce2314) (BuildId: d5048cc1e20b13b8211302204fa3fe22df5d6109)
    31
    32SUMMARY: UndefinedBehaviorSanitizer: implicit-integer-sign-change qt/walletview.cpp:137:21 in 
    
  11. maflcko commented at 9:14 pm on March 27, 2024: contributor
    Nice, so you have reproduced all issues that I fixed in #806 ?
  12. pablomartin4btc commented at 9:23 pm on March 27, 2024: contributor
    I was already checking the PR and those issues actually, I got 2/ 3. Can’t reproduce the one starting with: wallet/interfaces.cpp:289:57: runtime error: implicit conversion from type 'int' of value -1, tried with both --with-sanitizers=undefined,integer and just --with-sanitizers=integer, any ideas?
  13. maflcko commented at 9:35 pm on March 27, 2024: contributor
    Did you make sure that no change (position) was specified in the GUI window? I don’t recall if I had “subtract fee from amount” enabled or not. Maybe try both?
  14. pablomartin4btc commented at 10:50 pm on March 27, 2024: contributor
     0./src/qt/bitcoin-qt -regtest -datadir=$QT_ISSUE_806_TEST_DIR
     1
     2Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
     3wallet/interfaces.cpp:289:57: runtime error: implicit conversion from type 'int' of value -1 (32-bit, signed) to type 'unsigned int' changed the value to 4294967295 (32-bit, unsigned)
     4    [#0](/bitcoin-core-gui/0/) 0x63d87d6f373c in wallet::(anonymous namespace)::WalletImpl::createTransaction(std::vector<wallet::CRecipient, std::allocator<wallet::CRecipient> > const&, wallet::CCoinControl const&, bool, int&, long&) src/./src/wallet/interfaces.cpp:289:57
     5    [#1](/bitcoin-core-gui/1/) 0x63d87d1d5f61 in WalletModel::prepareTransaction(WalletModelTransaction&, wallet::CCoinControl const&) src/./src/qt/walletmodel.cpp:211:37
     6    [#2](/bitcoin-core-gui/2/) 0x63d87d22abb8 in SendCoinsDialog::PrepareSendText(QString&, QString&, QString&) src/./src/qt/sendcoinsdialog.cpp:287:28
     7    [#3](/bitcoin-core-gui/3/) 0x63d87d227dca in SendCoinsDialog::sendButtonClicked(bool) src/./src/qt/sendcoinsdialog.cpp:482:10
     8    [#4](/bitcoin-core-gui/4/) 0x63d87d2356e1 in auto auto GUIUtil::ExceptionSafeConnect<QPushButton*, void (QAbstractButton::*)(bool), SendCoinsDialog*, void (SendCoinsDialog::*)(bool)>(QPushButton*, void (QAbstractButton::*)(bool), SendCoinsDialog*, void (SendCoinsDialog::*)(bool), Qt::ConnectionType)::'lambda'(auto&&...)::operator()<bool&>(auto&&...) const src/./qt/guiutil.h:400:21
     9    [#5](/bitcoin-core-gui/5/) 0x63d87d23567f in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<bool>, void, auto GUIUtil::ExceptionSafeConnect<QPushButton*, void (QAbstractButton::*)(bool), SendCoinsDialog*, void (SendCoinsDialog::*)(bool)>(QPushButton*, void (QAbstractButton::*)(bool), SendCoinsDialog*, void (SendCoinsDialog::*)(bool), Qt::ConnectionType)::'lambda'(auto&&...)>::call(auto GUIUtil::ExceptionSafeConnect<QPushButton*, void (QAbstractButton::*)(bool), SendCoinsDialog*, void (SendCoinsDialog::*)(bool)>(QPushButton*, void (QAbstractButton::*)(bool), SendCoinsDialog*, void (SendCoinsDialog::*)(bool), Qt::ConnectionType)::'lambda'(auto&&...)&, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:146:13
    10    [#6](/bitcoin-core-gui/6/) 0x63d87d23567f in void QtPrivate::Functor<auto GUIUtil::ExceptionSafeConnect<QPushButton*, void (QAbstractButton::*)(bool), SendCoinsDialog*, void (SendCoinsDialog::*)(bool)>(QPushButton*, void (QAbstractButton::*)(bool), SendCoinsDialog*, void (SendCoinsDialog::*)(bool), Qt::ConnectionType)::'lambda'(auto&&...), 1>::call<QtPrivate::List<bool>, void>(auto GUIUtil::ExceptionSafeConnect<QPushButton*, void (QAbstractButton::*)(bool), SendCoinsDialog*, void (SendCoinsDialog::*)(bool)>(QPushButton*, void (QAbstractButton::*)(bool), SendCoinsDialog*, void (SendCoinsDialog::*)(bool), Qt::ConnectionType)::'lambda'(auto&&...)&, void*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:256:13
    11    [#7](/bitcoin-core-gui/7/) 0x63d87d23567f in QtPrivate::QFunctorSlotObject<auto GUIUtil::ExceptionSafeConnect<QPushButton*, void (QAbstractButton::*)(bool), SendCoinsDialog*, void (SendCoinsDialog::*)(bool)>(QPushButton*, void (QAbstractButton::*)(bool), SendCoinsDialog*, void (SendCoinsDialog::*)(bool), Qt::ConnectionType)::'lambda'(auto&&...), 1, QtPrivate::List<bool>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:443:17
    12    [#8](/bitcoin-core-gui/8/) 0x7b6cffcf1792  (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2f1792) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    13    [#9](/bitcoin-core-gui/9/) 0x7b6cff462115 in QAbstractButton::clicked(bool) (/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x262115) (BuildId: 5dfa607522386957ffec95c0a46150c189e064bd)
    14    [#10](/bitcoin-core-gui/10/) 0x7b6cff46239d  (/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x26239d) (BuildId: 5dfa607522386957ffec95c0a46150c189e064bd)
    15    [#11](/bitcoin-core-gui/11/) 0x7b6cff463fc3  (/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x263fc3) (BuildId: 5dfa607522386957ffec95c0a46150c189e064bd)
    16    [#12](/bitcoin-core-gui/12/) 0x7b6cff4641e6 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) (/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x2641e6) (BuildId: 5dfa607522386957ffec95c0a46150c189e064bd)
    17    [#13](/bitcoin-core-gui/13/) 0x7b6cff3af4ed in QWidget::event(QEvent*) (/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x1af4ed) (BuildId: 5dfa607522386957ffec95c0a46150c189e064bd)
    18    [#14](/bitcoin-core-gui/14/) 0x7b6cff36c712 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x16c712) (BuildId: 5dfa607522386957ffec95c0a46150c189e064bd)
    19    [#15](/bitcoin-core-gui/15/) 0x7b6cff374363 in QApplication::notify(QObject*, QEvent*) (/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x174363) (BuildId: 5dfa607522386957ffec95c0a46150c189e064bd)
    20    [#16](/bitcoin-core-gui/16/) 0x7b6cffcb9e39 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2b9e39) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    21    [#17](/bitcoin-core-gui/17/) 0x7b6cff372e46 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) (/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x172e46) (BuildId: 5dfa607522386957ffec95c0a46150c189e064bd)
    22    [#18](/bitcoin-core-gui/18/) 0x7b6cff3c8d3f  (/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x1c8d3f) (BuildId: 5dfa607522386957ffec95c0a46150c189e064bd)
    23    [#19](/bitcoin-core-gui/19/) 0x7b6cff3cbfd4  (/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x1cbfd4) (BuildId: 5dfa607522386957ffec95c0a46150c189e064bd)
    24    [#20](/bitcoin-core-gui/20/) 0x7b6cff36c712 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x16c712) (BuildId: 5dfa607522386957ffec95c0a46150c189e064bd)
    25    [#21](/bitcoin-core-gui/21/) 0x7b6cffcb9e39 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2b9e39) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    26    [#22](/bitcoin-core-gui/22/) 0x7b6cfeb41306 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) (/lib/x86_64-linux-gnu/libQt5Gui.so.5+0x141306) (BuildId: 9732c114cf66c10694879a302e94acd2199646cb)
    27    [#23](/bitcoin-core-gui/23/) 0x7b6cfeb16a2b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) (/lib/x86_64-linux-gnu/libQt5Gui.so.5+0x116a2b) (BuildId: 9732c114cf66c10694879a302e94acd2199646cb)
    28    [#24](/bitcoin-core-gui/24/) 0x7b6cf98f8d6d  (/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5+0x73d6d) (BuildId: 431728065877d9043132d65c1fafedab195974f6)
    29    [#25](/bitcoin-core-gui/25/) 0x7b6cfdb20d3a in g_main_context_dispatch (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55d3a) (BuildId: c74e800dfd5f72649d673b44292f4a817e45150b)
    30    [#26](/bitcoin-core-gui/26/) 0x7b6cfdb76257  (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0xab257) (BuildId: c74e800dfd5f72649d673b44292f4a817e45150b)
    31    [#27](/bitcoin-core-gui/27/) 0x7b6cfdb1e3e2 in g_main_context_iteration (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x533e2) (BuildId: c74e800dfd5f72649d673b44292f4a817e45150b)
    32    [#28](/bitcoin-core-gui/28/) 0x7b6cffd130b7 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x3130b7) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    33    [#29](/bitcoin-core-gui/29/) 0x7b6cffcb875a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2b875a) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    34    [#30](/bitcoin-core-gui/30/) 0x7b6cffcc0cf3 in QCoreApplication::exec() (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2c0cf3) (BuildId: 4745cda28772e27ab5124c79ddc26da084782cee)
    35    [#31](/bitcoin-core-gui/31/) 0x63d87d139b67 in GuiMain(int, char**) src/./src/qt/bitcoin.cpp:706:13
    36    [#32](/bitcoin-core-gui/32/) 0x63d87d133fc9 in main src/./src/qt/main.cpp:26:12
    37    [#33](/bitcoin-core-gui/33/) 0x7b6cfe229d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    38    [#34](/bitcoin-core-gui/34/) 0x7b6cfe229e3f in __libc_start_main csu/../csu/libc-start.c:392:3
    39    [#35](/bitcoin-core-gui/35/) 0x63d87d10a3f4 in _start (/home/pablo/workspace/bitcoin/src/qt/bitcoin-qt+0x1fe3f4) (BuildId: 1964c5fb2ae670ca1919146a50178c72815cf99d)
    40
    41SUMMARY: UndefinedBehaviorSanitizer: implicit-integer-sign-change wallet/interfaces.cpp:289:57 in 
    

    Finally got the 3/ 3 :pray:. I’ll review the fix now!

  15. hebasto closed this on Apr 18, 2024

  16. hebasto referenced this in commit aaab5fb3c5 on Apr 18, 2024

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-11-21 09:20 UTC

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