bitcoind Segmentation fault (core dumped) #13934

issue funasty1985 openend this issue on August 10, 2018
  1. funasty1985 commented at 4:26 am on August 10, 2018: none

    Trying to run bitcoind on Ubuntu 18.04 and have all the required libraries . After building from source without any parameters triggered i get the following error:

    bitcoind Segmentation fault (core dumped)

    Apparently this is due to trying to access a memory index out of bounds however does anyone know how i might be able to resolve it?

    Any help would be great :)

  2. domob1812 commented at 6:11 am on August 10, 2018: contributor
    Useful information to debug this could be your debug.log file (or at least just take a look yourself what it says around the end), or running bitcoind with gdb to get a stack trace.
  3. MarcoFalke commented at 11:10 am on August 10, 2018: member
    Please include exact steps to reproduce.
  4. fanquake added the label Linux/Unix on Aug 12, 2018
  5. funasty1985 commented at 4:52 am on August 13, 2018: none

    This is what I got as I run bitcoind with gdb

    fu@fu-VirtualBox:~/.bitcoin$ gdb bitcoind GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type “show copying” and “show warranty” for details. This GDB was configured as “x86_64-linux-gnu”. Type “show configuration” for configuration details. For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/. For help, type “help”. Type “apropos word” to search for commands related to “word”… Reading symbols from bitcoind…done. (gdb) r Starting program: /usr/local/bin/bitcoind [Thread debugging using libthread_db enabled] Using host libthread_db library “/lib/x86_64-linux-gnu/libthread_db.so.1”. [New Thread 0x7ffff209a700 (LWP 24996)] [New Thread 0x7ffff1899700 (LWP 24997)] [New Thread 0x7ffff1098700 (LWP 24998)] [New Thread 0x7ffff0897700 (LWP 24999)] [New Thread 0x7fffebfff700 (LWP 25000)] [New Thread 0x7fffeb7fe700 (LWP 25001)]

    Thread 1 “bitcoind” received signal SIGSEGV, Segmentation fault. __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:62 62 ../sysdeps/x86_64/multiarch/strlen-avx2.S: No such file or directory. (gdb) l 57 in ../sysdeps/x86_64/multiarch/strlen-avx2.S (gdb) b Breakpoint 1 at 0x7ffff57d35a1: file ../sysdeps/x86_64/multiarch/strlen-avx2.S, line 62. (gdb)

    Also , cat ~/.bitcoin/debug.log is the following

    2018-08-10 03:36:36 Bitcoin Core version v0.16.0 (release build) 2018-08-10 03:36:36 InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1 2018-08-10 03:36:36 Assuming ancestors of block 0000000000000000005214481d2d96f898e3d5416e43359c145944a909d242e0 have valid signatures. 2018-08-10 03:36:36 Setting nMinimumChainWork=000000000000000000000000000000000000000000f91c579d57cad4bc5278cc 2018-08-10 03:36:36 Using the ‘sse4’ SHA256 implementation 2018-08-10 03:36:36 Using RdRand as an additional entropy source 2018-08-10 03:36:36 Default data directory /home/fu/.bitcoin 2018-08-10 03:36:36 Using data directory /home/fu/.bitcoin 2018-08-10 03:36:36 Using config file /home/fu/.bitcoin/bitcoin.conf 2018-08-10 03:36:36 Using at most 125 automatic connections (1024 file descriptors available) 2018-08-10 03:36:36 Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements 2018-08-10 03:36:36 Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements 2018-08-10 03:36:36 Using 0 threads for script verification 2018-08-10 03:36:36 scheduler thread start 2018-08-10 03:36:36 HTTP: creating work queue of depth 16 2018-08-10 03:36:36 No rpcpassword set - using random cookie authentication 2018-08-10 03:36:36 Generated RPC authentication cookie /home/fu/.bitcoin/.cookie 2018-08-10 03:36:36 HTTP: starting 4 worker threads 2018-08-10 03:36:36 Using wallet directory /home/fu/.bitcoin/wallets 2018-08-10 03:36:36 init message: Verifying wallet(s)… 2018-08-10 03:36:36 Using BerkeleyDB version Berkeley DB 4.8.30: (April 9, 2010) 2018-08-10 03:36:36 Using wallet wallet.dat 2018-08-10 03:36:36 CDBEnv::Open: LogDir=/home/fu/.bitcoin/wallets/database ErrorFile=/home/fu/.bitcoin/wallets/db.log 2018-08-10 03:47:33

    How could I solve it ? Thank you very much

  6. sipa commented at 4:58 am on August 13, 2018: member
    Can you give a backtrace (“bt” in gdb)?
  7. funasty1985 commented at 6:42 am on August 13, 2018: none
    (gdb) bt #0 __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:62 #1 0x0000555555997082 in __os_strdup () #2 0x0000555555969772 in __env_add_data_dir () #3 0x0000555555969841 in __env_set_data_dir () #4 0x0000555555934c13 in DbEnv::set_data_dir(char const*) () #5 0x00005555558941d5 in CDBEnv::Open (this=this@entry=0x555555e872e0 , pathIn=…, retry=retry@entry=true) at wallet/db.cpp:121 #6 0x000055555589756e in CDB::VerifyEnvironment (walletFile=“wallet.dat”, walletDir=…, errorStr="") at wallet/db.cpp:294 #7 0x000055555587b45d in CWalletDB::VerifyEnvironment (walletFile=“wallet.dat”, walletDir=…, errorStr="") at wallet/walletdb.cpp:811 #8 0x0000555555812ef0 in VerifyWallets () at wallet/init.cpp:248 #9 0x00005555555ba2e8 in AppInitMain () at init.cpp:1278 #10 0x000055555559bbfc in AppInit (argc=1, argv=) at bitcoind.cpp:160 #11 0x000055555558f5bf in main (argc=1, argv=0x7fffffffe0b8) at bitcoind.cpp:186
  8. MarcoFalke commented at 11:20 am on August 13, 2018: member
    Does it happen with -disablewallet as well. Also what about setting a different -datadir?
  9. MarcoFalke commented at 11:21 am on August 13, 2018: member
    Also, you could try valgrind bitcoind to see if there was an invalid read or write before the segfault.
  10. funasty1985 commented at 2:37 pm on August 13, 2018: none

    I received the following error when I complied with ./configure --disable-wallet and then make

    CXX qt/qt_libbitcoinqt_a-optionsmodel.o CXX qt/qt_libbitcoinqt_a-peertablemodel.o CXX qt/qt_libbitcoinqt_a-rpcconsole.o CXX qt/qt_libbitcoinqt_a-splashscreen.o CXX qt/qt_libbitcoinqt_a-utilitydialog.o CXX qt/qt_libbitcoinqt_a-moc_bantablemodel.o CXX qt/qt_libbitcoinqt_a-moc_bitcoingui.o qt/moc_bitcoingui.cpp: In static member function ‘static void BitcoinGUI::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)’: qt/moc_bitcoingui.cpp:219:21: error: ‘class BitcoinGUI’ has no member named ‘setEncryptionStatus’; did you mean ‘setDockOptions’? case 6: _t->setEncryptionStatus((reinterpret_cast< int()>(_a[1]))); break; ^~~~~~~~~~~~~~~~~~~ setDockOptions qt/moc_bitcoingui.cpp:220:21: error: ‘class BitcoinGUI’ has no member named ‘setHDStatus’; did you mean ‘setStatusBar’? case 7: _t->setHDStatus((reinterpret_cast< int()>(_a[1]))); break; ^~~~~~~~~~~ setStatusBar qt/moc_bitcoingui.cpp:221:33: error: ‘class BitcoinGUI’ has no member named ‘handlePaymentRequest’ case 8: { bool _r = _t->handlePaymentRequest((reinterpret_cast< const SendCoinsRecipient()>(_a[1]))); ^~~~~~~~~~~~~~~~~~~~ qt/moc_bitcoingui.cpp:223:21: error: ‘class BitcoinGUI’ has no member named ‘incomingTransaction’ case 9: _t->incomingTransaction((reinterpret_cast< const QString()>(_a[1])),(reinterpret_cast< int()>(_a[2])),(reinterpret_cast< const CAmount()>(_a[3])),(reinterpret_cast< const QString()>(_a[4])),(reinterpret_cast< const QString()>(_a[5])),(reinterpret_cast< const QString()>(_a[6]))); break; ^~~~~~~~~~~~~~~~~~~ qt/moc_bitcoingui.cpp:224:22: error: ‘class BitcoinGUI’ has no member named ‘gotoOverviewPage’ case 10: _t->gotoOverviewPage(); break; ^~~~~~~~~~~~~~~~ qt/moc_bitcoingui.cpp:225:22: error: ‘class BitcoinGUI’ has no member named ‘gotoHistoryPage’ case 11: _t->gotoHistoryPage(); break; ^~~~~~~~~~~~~~~ qt/moc_bitcoingui.cpp:226:22: error: ‘class BitcoinGUI’ has no member named ‘gotoReceiveCoinsPage’ case 12: _t->gotoReceiveCoinsPage(); break; ^~~~~~~~~~~~~~~~~~~~ qt/moc_bitcoingui.cpp:227:22: error: ‘class BitcoinGUI’ has no member named ‘gotoSendCoinsPage’ case 13: _t->gotoSendCoinsPage((reinterpret_cast< QString()>(_a[1]))); break; ^~~~~~~~~~~~~~~~~ qt/moc_bitcoingui.cpp:228:22: error: ‘class BitcoinGUI’ has no member named ‘gotoSendCoinsPage’ case 14: _t->gotoSendCoinsPage(); break; ^~~~~~~~~~~~~~~~~ qt/moc_bitcoingui.cpp:229:22: error: ‘class BitcoinGUI’ has no member named ‘gotoSignMessageTab’ case 15: _t->gotoSignMessageTab((reinterpret_cast< QString()>(_a[1]))); break; ^~~~~~~~~~~~~~~~~~ qt/moc_bitcoingui.cpp:230:22: error: ‘class BitcoinGUI’ has no member named ‘gotoSignMessageTab’ case 16: _t->gotoSignMessageTab(); break; ^~~~~~~~~~~~~~~~~~ qt/moc_bitcoingui.cpp:231:22: error: ‘class BitcoinGUI’ has no member named ‘gotoVerifyMessageTab’ case 17: _t->gotoVerifyMessageTab((reinterpret_cast< QString()>(_a[1]))); break; ^~~~~~~~~~~~~~~~~~~~ qt/moc_bitcoingui.cpp:232:22: error: ‘class BitcoinGUI’ has no member named ‘gotoVerifyMessageTab’ case 18: _t->gotoVerifyMessageTab(); break; ^~~~~~~~~~~~~~~~~~~~ qt/moc_bitcoingui.cpp:233:22: error: ‘class BitcoinGUI’ has no member named ‘openClicked’; did you mean ‘optionsClicked’? case 19: _t->openClicked(); break; ^~~~~~~~~~~ optionsClicked Makefile:7216: recipe for target ‘qt/qt_libbitcoinqt_a-moc_bitcoingui.o’ failed make[2]: *** [qt/qt_libbitcoinqt_a-moc_bitcoingui.o] Error 1 make[2]: Leaving directory ‘/home/fu/bitcoin-source/bitcoin/src’ Makefile:9462: recipe for target ‘all-recursive’ failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ‘/home/fu/bitcoin-source/bitcoin/src’ Makefile:747: recipe for target ‘all-recursive’ failed make: *** [all-recursive] Error 1

  11. funasty1985 commented at 2:42 pm on August 13, 2018: none

    Once I commanded valgrind bitcoind , I received the following .

    fu@fu-VirtualBox:~/bitcoin-source/bitcoin$ valgrind bitcoind ==2185== Memcheck, a memory error detector ==2185== Copyright (C) 2002-2017, and GNU GPL’d, by Julian Seward et al. ==2185== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info ==2185== Command: bitcoind ==2185== ==2185== Invalid read of size 1 ==2185== at 0x4C32CF2: strlen (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==2185== by 0x54B081: __os_strdup (in /usr/local/bin/bitcoind) ==2185== by 0x51D771: __env_add_data_dir (in /usr/local/bin/bitcoind) ==2185== by 0x51D840: __env_set_data_dir (in /usr/local/bin/bitcoind) ==2185== by 0x4E8C12: DbEnv::set_data_dir(char const*) (in /usr/local/bin/bitcoind) ==2185== by 0x4481D4: CDBEnv::Open(boost::filesystem::path const&, bool) (db.cpp:121) ==2185== by 0x44B56D: CDB::VerifyEnvironment(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, boost::filesystem::path const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator >&) (db.cpp:294) ==2185== by 0x3C6EEF: VerifyWallets() (init.cpp:248) ==2185== by 0x16E2E7: AppInitMain() (init.cpp:1278) ==2185== by 0x14FBFB: AppInit(int, char**) (bitcoind.cpp:160) ==2185== by 0x1435BE: main (bitcoind.cpp:186) ==2185== Address 0x0 is not stack’d, malloc’d or (recently) free’d ==2185== ==2185== ==2185== Process terminating with default action of signal 11 (SIGSEGV) ==2185== Access not within mapped region at address 0x0 ==2185== at 0x4C32CF2: strlen (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==2185== by 0x54B081: __os_strdup (in /usr/local/bin/bitcoind) ==2185== by 0x51D771: __env_add_data_dir (in /usr/local/bin/bitcoind) ==2185== by 0x51D840: __env_set_data_dir (in /usr/local/bin/bitcoind) ==2185== by 0x4E8C12: DbEnv::set_data_dir(char const*) (in /usr/local/bin/bitcoind) ==2185== by 0x4481D4: CDBEnv::Open(boost::filesystem::path const&, bool) (db.cpp:121) ==2185== by 0x44B56D: CDB::VerifyEnvironment(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, boost::filesystem::path const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator >&) (db.cpp:294) ==2185== by 0x3C6EEF: VerifyWallets() (init.cpp:248) ==2185== by 0x16E2E7: AppInitMain() (init.cpp:1278) ==2185== by 0x14FBFB: AppInit(int, char**) (bitcoind.cpp:160) ==2185== by 0x1435BE: main (bitcoind.cpp:186) ==2185== If you believe this happened as a result of a stack ==2185== overflow in your program’s main thread (unlikely but ==2185== possible), you can try to increase the size of the ==2185== main thread stack using the –main-stacksize= flag. ==2185== The main thread stack size used in this run was 8388608. ==2185== ==2185== HEAP SUMMARY: ==2185== in use at exit: 36,058,372 bytes in 2,338 blocks ==2185== total heap usage: 3,696 allocs, 1,358 frees, 40,514,987 bytes allocated ==2185== ==2185== LEAK SUMMARY: ==2185== definitely lost: 77 bytes in 1 blocks ==2185== indirectly lost: 0 bytes in 0 blocks ==2185== possibly lost: 1,824 bytes in 6 blocks ==2185== still reachable: 36,056,471 bytes in 2,331 blocks ==2185== of which reachable via heuristic: ==2185== newarray : 48 bytes in 1 blocks ==2185== suppressed: 0 bytes in 0 blocks ==2185== Rerun with –leak-check=full to see details of leaked memory ==2185== ==2185== For counts of detected and suppressed errors, rerun with: -v ==2185== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) Segmentation fault (core dumped)

  12. MarcoFalke commented at 6:19 pm on August 13, 2018: member
    Hmm interesting, and with valgrind bitcoind -disablewallet?
  13. funasty1985 commented at 4:35 am on August 14, 2018: none
    @domob1812 it works , thanks very much !!!
  14. funasty1985 closed this on Aug 14, 2018

  15. domob1812 commented at 6:07 am on August 14, 2018: contributor
    I didn’t really give much helpful information, to be honest, but thanks - glad it works for you now anyway. :D
  16. sipa commented at 9:33 am on August 14, 2018: member
    Is this solved? It sounds like a serious problem, even if it could be worked around.
  17. funasty1985 commented at 10:10 am on August 14, 2018: none
  18. cryptozeny commented at 11:31 am on January 3, 2019: none
    This is not a solution. It’s just a workaround… plz reopen this. @funasty1985
  19. ehoffman2 commented at 8:15 pm on January 25, 2019: none
    See my comment at #12047 Look like duplicate (linked against libdb_cxx-4.8.so, using 5.3 header).
  20. DrahtBot locked this on Dec 16, 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: 2024-12-21 15:12 UTC

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