Bitcoin Core compiled with Ubuntu Focal gcc-8 immediately segfaults #27487

issue maflcko openend this issue on April 18, 2023
  1. maflcko commented at 3:16 pm on April 18, 2023: member

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    segfault

    Expected behaviour

    no segfault

    Steps to reproduce

    • Fresh install of Ubuntu Focal
    • export DEBIAN_FRONTEND=noninteractive && apt update && apt install curl wget htop git vim ccache -y && git clone https://github.com/bitcoin/bitcoin.git --depth=1 ./bitcoin-core && cd bitcoin-core && apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq libevent-dev libboost-dev gcc-8 g++-8 -y
    • ./autogen.sh && ./configure CC=gcc-8 CXX=g++-8 && make -j $(nproc) src/bitcoind
    • valgrind ./src/bitcoind

    Relevant log output

     0# valgrind ./src/bitcoind 
     1==19993== Memcheck, a memory error detector
     2==19993== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
     3==19993== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
     4==19993== Command: ./src/bitcoind
     5==19993== 
     6==19993== Invalid read of size 8
     7==19993==    at 0x1FD15F: ~vector (stl_vector.h:567)
     8==19993==    by 0x1FD15F: std::filesystem::__cxx11::path::~path() (fs_path.h:209)
     9==19993==    by 0x1FD18B: ~_Cmpt (fs_path.h:644)
    10==19993==    by 0x1FD18B: _Destroy<std::filesystem::__cxx11::path::_Cmpt> (stl_construct.h:98)
    11==19993==    by 0x1FD18B: __destroy<std::filesystem::__cxx11::path::_Cmpt*> (stl_construct.h:108)
    12==19993==    by 0x1FD18B: _Destroy<std::filesystem::__cxx11::path::_Cmpt*> (stl_construct.h:137)
    13==19993==    by 0x1FD18B: _Destroy<std::filesystem::__cxx11::path::_Cmpt*, std::filesystem::__cxx11::path::_Cmpt> (stl_construct.h:206)
    14==19993==    by 0x1FD18B: ~vector (stl_vector.h:567)
    15==19993==    by 0x1FD18B: std::filesystem::__cxx11::path::~path() (fs_path.h:209)
    16==19993==    by 0x1C5A7C: ~path (fs.h:30)
    17==19993==    by 0x1C5A7C: ArgsManager::GetConfigFilePath() const [clone .cold.494] (system.cpp:838)
    18==19993==    by 0x6057E0: ArgsManager::ReadConfigFiles(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool) (system.cpp:849)
    19==19993==    by 0x4F557F: common::InitConfig(ArgsManager&, std::function<bool (bilingual_str const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)>) (init.cpp:24)
    20==19993==    by 0x1CC16E: AppInit (bitcoind.cpp:155)
    21==19993==    by 0x1CC16E: main (bitcoind.cpp:266)
    22==19993==  Address 0x2b is not stack'd, malloc'd or (recently) free'd
    23==19993== 
    24==19993== 
    25==19993== Process terminating with default action of signal 11 (SIGSEGV): dumping core
    26==19993==  Access not within mapped region at address 0x2B
    27==19993==    at 0x1FD15F: ~vector (stl_vector.h:567)
    28==19993==    by 0x1FD15F: std::filesystem::__cxx11::path::~path() (fs_path.h:209)
    29==19993==    by 0x1FD18B: ~_Cmpt (fs_path.h:644)
    30==19993==    by 0x1FD18B: _Destroy<std::filesystem::__cxx11::path::_Cmpt> (stl_construct.h:98)
    31==19993==    by 0x1FD18B: __destroy<std::filesystem::__cxx11::path::_Cmpt*> (stl_construct.h:108)
    32==19993==    by 0x1FD18B: _Destroy<std::filesystem::__cxx11::path::_Cmpt*> (stl_construct.h:137)
    33==19993==    by 0x1FD18B: _Destroy<std::filesystem::__cxx11::path::_Cmpt*, std::filesystem::__cxx11::path::_Cmpt> (stl_construct.h:206)
    34==19993==    by 0x1FD18B: ~vector (stl_vector.h:567)
    35==19993==    by 0x1FD18B: std::filesystem::__cxx11::path::~path() (fs_path.h:209)
    36==19993==    by 0x1C5A7C: ~path (fs.h:30)
    37==19993==    by 0x1C5A7C: ArgsManager::GetConfigFilePath() const [clone .cold.494] (system.cpp:838)
    38==19993==    by 0x6057E0: ArgsManager::ReadConfigFiles(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool) (system.cpp:849)
    39==19993==    by 0x4F557F: common::InitConfig(ArgsManager&, std::function<bool (bilingual_str const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)>) (init.cpp:24)
    40==19993==    by 0x1CC16E: AppInit (bitcoind.cpp:155)
    41==19993==    by 0x1CC16E: main (bitcoind.cpp:266)
    42==19993==  If you believe this happened as a result of a stack
    43==19993==  overflow in your program's main thread (unlikely but
    44==19993==  possible), you can try to increase the size of the
    45==19993==  main thread stack using the --main-stacksize= flag.
    46==19993==  The main thread stack size used in this run was 8388608.
    47==19993== 
    48==19993== HEAP SUMMARY:
    49==19993==     in use at exit: 122,654 bytes in 1,182 blocks
    50==19993==   total heap usage: 2,545 allocs, 1,363 frees, 383,342 bytes allocated
    51==19993== 
    52==19993== LEAK SUMMARY:
    53==19993==    definitely lost: 0 bytes in 0 blocks
    54==19993==    indirectly lost: 0 bytes in 0 blocks
    55==19993==      possibly lost: 136 bytes in 1 blocks
    56==19993==    still reachable: 122,518 bytes in 1,181 blocks
    57==19993==         suppressed: 0 bytes in 0 blocks
    58==19993== Rerun with --leak-check=full to see details of leaked memory
    59==19993== 
    60==19993== For lists of detected and suppressed errors, rerun with: -s
    61==19993== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
    62Segmentation fault (core dumped)
    63
    64
    65### How did you obtain Bitcoin Core
    66
    67Compiled from source
    68
    69### What version of Bitcoin Core are you using?
    70
    71current master
    72
    73### Operating system and version
    74
    75-
    76
    77### Machine specifications
    78
    79_No response_
    
  2. maflcko added the label Bug on Apr 18, 2023
  3. maflcko added the label Upstream on Apr 18, 2023
  4. maflcko added the label Build system on Apr 18, 2023
  5. maflcko commented at 3:21 pm on April 18, 2023: member
  6. fanquake commented at 3:21 pm on April 18, 2023: member
    Need to double check, but iirc this is due to an issue with the libstdc++ shipped with Focal being incompatible with GCC 8 (for some std::filesystem usage), becuase it’s actually from GCC 9.
  7. maflcko commented at 3:27 pm on April 18, 2023: member
    Thanks
  8. maflcko closed this on Apr 18, 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-09-28 22:12 UTC

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