Compiling Bitcoin Core on Raspbian Jessie (Raspberry Pi 2) #6882

issue ghost opened this issue on October 23, 2015
  1. ghost commented at 8:10 PM on October 23, 2015: none

    I have been trying to run bitcoin node on my raspberry pi 2, but not with much success. My bitcoind seems to crash.

    *** Error in `/home/pi/bin/bitcoind': malloc(): smallbin double linked list corrupted:   0x6c722290 ***
    

    I am not really sure what is the issue, but I have decided to recompile Bitcoin Core anyway. This time I noticed that there were several warnings when making LevelDB and in util_tests.cpp. What can I do to fix this warning? Looking at the source, I couldn't identify why compiler is complaining. Any help would be appreciated. Full log is available upon the request.

    In file included from ./util/arena.h:9:0,
                     from ./db/skiplist.h:33,
                     from ./db/memtable.h:11,
                     from db/memtable.cc:5:
    db/memtable.cc: In member function ‘void leveldb::MemTable::Add(leveldb::Sequenc                                                                                                 eNumber, leveldb::ValueType, const leveldb::Slice&, const leveldb::Slice&)’:
    db/memtable.cc:104:31: warning: comparison between signed and unsigned integer e                                                                                                 xpressions [-Wsign-compare]
       assert((p + val_size) - buf == encoded_len);
    
    table/filter_block.cc: In member function ‘bool leveldb::FilterBlockReader::KeyM                                                                                                 ayMatch(uint64_t, const leveldb::Slice&)’:
    table/filter_block.cc:100:33: warning: comparison between signed and unsigned in                                                                                                 teger expressions [-Wsign-compare]
         if (start <= limit && limit <= (offset_ - data_)) {
    
    util/bloom.cc: In member function ‘virtual void leveldb::{anonymous}::BloomFilte                                                                                                 rPolicy::CreateFilter(const leveldb::Slice*, int, std::string*) const’:
    util/bloom.cc:50:26: warning: comparison between signed and unsigned integer exp                                                                                                 ressions [-Wsign-compare]
         for (size_t i = 0; i < n; i++) {
    
    util/logging.cc: In function ‘bool leveldb::ConsumeDecimalNumber(leveldb::Slice*                                                                                                 , uint64_t*)’:
    util/logging.cc:58:40: warning: comparison between signed and unsigned integer e                                                                                                 xpressions [-Wsign-compare]
               (v == kMaxUint64/10 && delta > kMaxUint64%10)) {
    
    test/util_tests.cpp:322:5: warning: this decimal constant is unsigned only in ISO C90
         BOOST_CHECK(ParseInt32("-2147483648", &n) && n == -2147483648);
         ^
    In file included from /usr/include/boost/test/unit_test.hpp:19:0,
                     from test/util_tests.cpp:18:
    test/util_tests.cpp: In member function ‘void util_tests::test_ParseInt32::test_method()’:
    test/util_tests.cpp:322:52: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         BOOST_CHECK(ParseInt32("-2147483648", &n) && n == -2147483648);
                                                        ^
    
  2. pstratem commented at 1:37 AM on October 24, 2015: contributor

    99% memory corruption 1% actual bug

  3. TheBlueMatt commented at 1:39 AM on October 24, 2015: member

    The compilation warnings in question are almost definitely not the cause. As @pstratem so eloquently put it, it is mostly likely this is just a memory corruption issue (RPIs are fairly unreliable little beasts), but if you can reproduce it, run it under valgrind and see what you get.

  4. laanwj commented at 6:53 AM on October 26, 2015: member

    The error indicates that there is a heap overflow. The most common non-malicious cause of these is object size mismatch, caused by using incompatible headers and link library for a certain dependency.

    My recommendation would be to cross-build with recommended dependencies on another machine:

    git clone https://github.com/bitcoin/bitcoin.git bitcoin-arm
    ./autogen.sh
    cd bitcoin-arm/depends
    make HOST=arm-linux-gnueabihf NO_QT=1  # possibly NO_WALLET=1 NO_UPNP=1
    cd ..
    ./configure --prefix=`pwd`/arm-linux-gnueabihf
    make
    scp src/bitcoind src/bitcoin-cli src/test/test_bitcoin <ARM host>:
    

    This gives a 'canonical' executable to compare to. if you can reproduce the problem with that, we need to debug this further. If not, hunt for the inconsistency in your local setup.

    (if you can't cross-compile you can also use depends while building on the device itself, will just take a long time)

  5. ghost commented at 7:01 AM on October 26, 2015: none

    Thanks. I will take a look at it tomorrow and see where it goes.

  6. ghost commented at 11:05 AM on October 27, 2015: none

    Alright, I tried to cross-compile on Debian in VirtualBox. However, when I run this command: make HOST=arm-linux-gnueabihf NO_QT=1 NO_WALLET=1 NO_UPNP=1 I get the following errors:

    Fetching boost...
    2015-10-27 03:57:41 URL:http://iweb.dl.sourceforge.net/project/boost/boost/1.58.0/boost_1_58_0.tar.bz2 [70394057/70394057] -> "/home/kurodatsubasa/bitcoin-arm/depends/work/download/boost-1_58_0/boost_1_58_0.tar.bz2.temp" [1]
    /home/kurodatsubasa/bitcoin-arm/depends/work/download/boost-1_58_0/boost_1_58_0.tar.bz2.temp: OK
    Extracting boost...
    /home/kurodatsubasa/bitcoin-arm/depends/sources/boost_1_58_0.tar.bz2: OK
    Preprocessing boost...
    Configuring boost...
    Building Boost.Build engine with toolset gcc... tools/build/src/engine/bin.linuxx86_64/b2
    Unicode/ICU support for Boost.Regex?... disabled.
    Generating Boost.Build configuration in project-config.jam...
    
    Bootstrapping is done. To build, run:
    
        ./b2
    
    To adjust configuration, edit 'project-config.jam'.
    Further information:
    
       - Command line help:
         ./b2 --help
    
       - Getting started guide: 
         http://www.boost.org/more/getting_started/unix-variants.html
    
       - Boost.Build documentation:
         http://www.boost.org/build/doc/html/index.html
    
    Building boost...
    /home/kurodatsubasa/bitcoin-arm/depends/work/build/arm-linux-gnueabihf/boost/1_58_0-d6d275ebd98/tools/build/src/tools/gcc.jam:83: in gcc.init from module gcc
    error: toolset gcc initialization:
    error: provided command 'arm-linux-gnueabihf-g++' not found
    error: initialized from /home/kurodatsubasa/bitcoin-arm/depends/work/build/arm-linux-gnueabihf/boost/1_58_0-d6d275ebd98/user-config.jam:1
    /home/kurodatsubasa/bitcoin-arm/depends/work/build/arm-linux-gnueabihf/boost/1_58_0-d6d275ebd98/tools/build/src/build/toolset.jam:43: in toolset.using from module toolset
    /home/kurodatsubasa/bitcoin-arm/depends/work/build/arm-linux-gnueabihf/boost/1_58_0-d6d275ebd98/tools/build/src/build/project.jam:1026: in using from module project-rules
    /home/kurodatsubasa/bitcoin-arm/depends/work/build/arm-linux-gnueabihf/boost/1_58_0-d6d275ebd98/user-config.jam:1: in modules.load from module user-config
    /home/kurodatsubasa/bitcoin-arm/depends/work/build/arm-linux-gnueabihf/boost/1_58_0-d6d275ebd98/tools/build/src/build-system.jam:249: in load-config from module build-system
    /home/kurodatsubasa/bitcoin-arm/depends/work/build/arm-linux-gnueabihf/boost/1_58_0-d6d275ebd98/tools/build/src/build-system.jam:385: in load-configuration-files from module build-system
    /home/kurodatsubasa/bitcoin-arm/depends/work/build/arm-linux-gnueabihf/boost/1_58_0-d6d275ebd98/tools/build/src/build-system.jam:524: in load from module build-system
    /home/kurodatsubasa/bitcoin-arm/depends/work/build/arm-linux-gnueabihf/boost/1_58_0-d6d275ebd98/tools/build/src/kernel/modules.jam:289: in import from module modules
    /home/kurodatsubasa/bitcoin-arm/depends/work/build/arm-linux-gnueabihf/boost/1_58_0-d6d275ebd98/tools/build/src/kernel/bootstrap.jam:139: in boost-build from module
    /home/kurodatsubasa/bitcoin-arm/depends/work/build/arm-linux-gnueabihf/boost/1_58_0-d6d275ebd98/boost-build.jam:17: in module scope from module
    
    funcs.mk:238: recipe for target '/home/kurodatsubasa/bitcoin-arm/depends/work/build/arm-linux-gnueabihf/boost/1_58_0-d6d275ebd98/./.stamp_built' failed
    make: *** [/home/kurodatsubasa/bitcoin-arm/depends/work/build/arm-linux-gnueabihf/boost/1_58_0-d6d275ebd98/./.stamp_built] Error 1
    
  7. laanwj commented at 11:35 AM on October 27, 2015: member

    You need to install the cross-compile chain, on ubuntu this is a matter of

    apt-get install g++-arm-linux-gnueabihf
    
  8. ghost commented at 1:56 PM on October 27, 2015: none

    I have decided not to give myself a hard time. Ditched Debian and installed Ubuntu instead in virtual box. Cross-compiled successfully without any visible errors and copied to my RPI 2. It seems to be working. However, I will continue to monitor my node and will close the thread if it turns out to be stable this time.

  9. ghost commented at 9:04 AM on October 29, 2015: none

    Well, no change, it still crashes randomly. I am giving up. It's not worth the hassle so I am going to look for other single-board computers.

  10. unknown closed this on Oct 29, 2015

  11. MarcoFalke locked this on Sep 8, 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: 2026-04-17 15:15 UTC

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