bitcoind immediately segfaults on ppc64 openbsd 7.4 #29517

issue grubles openend this issue on February 29, 2024
  1. grubles commented at 6:14 pm on February 29, 2024: contributor

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    v26.0 and v26.1rc1 both build successfully on big endian ppc64 openbsd 7.4 but when starting, bitcoind immediately segfaults. CPU is POWER9.

    Unfortunately, gdb on this platform also crashes when attempting to debug so all I have is this:

     0$ egdb bitcoind bitcoind.core                                                            
     1GNU gdb (GDB) 9.2
     2Copyright (C) 2020 Free Software Foundation, Inc.
     3License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
     4This is free software: you are free to change and redistribute it.
     5There is NO WARRANTY, to the extent permitted by law.
     6Type "show copying" and "show warranty" for details.
     7This GDB was configured as "powerpc64-unknown-openbsd7.4".
     8Type "show configuration" for configuration details.
     9For bug reporting instructions, please see:
    10<http://www.gnu.org/software/gdb/bugs/>.
    11Find the GDB manual and other documentation resources online at:
    12    <http://www.gnu.org/software/gdb/documentation/>.
    13
    14For help, type "help".
    15Type "apropos word" to search for commands related to "word"...
    16Reading symbols from bitcoind...
    17[New process 613405]
    18Core was generated by `bitcoind'.
    19Program terminated with signal SIGSEGV, Segmentation fault.
    20[#0](/bitcoin-bitcoin/0/)  libunwind::LocalAddressSpace::get32 (this=<optimized out>, addr=<optimized out>) at /usr/src/gnu/lib/libcxxabi/../../../gnu/llvm/libunwind/src/AddressSpace.hpp:221
    21221     /usr/src/gnu/lib/libcxxabi/../../../gnu/llvm/libunwind/src/AddressSpace.hpp: No such file or directory.
    22(gdb) bt       
    23[#0](/bitcoin-bitcoin/0/)  libunwind::LocalAddressSpace::get32 (this=<optimized out>, addr=<optimized out>) at /usr/src/gnu/lib/libcxxabi/../../../gnu/llvm/libunwind/src/AddressSpace.hpp:221
    24Abort trap (core dumped) 
    

    Expected behaviour

    Bitcoind starts to sync.

    Steps to reproduce

    Build bitcoind on powerpc64 OpenBSD 7.4 on IBM POWER9. Start bitcoind.

    How did you obtain Bitcoin Core

    Compiled from source

    What version of Bitcoin Core are you using?

    v26.0 and v26.1rc1

    Operating system and version

    OpenBSD 7.4

  2. maflcko commented at 8:09 am on March 1, 2024: member

    Compiled from source

    What are the exact steps to reproduce? Does it also happen with another version of g++ or clang++? Does it happen also in valgrind?

  3. grubles commented at 2:05 pm on March 1, 2024: contributor
    Follow the build instructions in build-openbsd.md and then start bitcoind. I haven’t tried other versions of clang or gcc. Just the clang in OBSD base. Also have not tried valgrind yet.
  4. grubles commented at 5:14 pm on March 1, 2024: contributor

    When building with gcc 11.2.0p9:

     0 CXX      bench/bench_bitcoin-data.o
     1  CXX      test/fuzz/libtest_fuzz_a-util.o
     2test/fuzz/util.cpp: In member function 'FILE* FuzzedFileProvider::open()':
     3test/fuzz/util.cpp:259:11: error: 'cookie_io_functions_t' does not name a type
     4  259 |     const cookie_io_functions_t io_hooks = {
     5      |           ^~~~~~~~~~~~~~~~~~~~~
     6test/fuzz/util.cpp:265:44: error: 'io_hooks' was not declared in this scope
     7  265 |     return fopencookie(this, mode.c_str(), io_hooks);
     8      |                                            ^~~~~~~~
     9test/fuzz/util.cpp:265:12: error: 'fopencookie' was not declared in this scope
    10  265 |     return fopencookie(this, mode.c_str(), io_hooks);
    11      |            ^~~~~~~~~~~
    12gmake[2]: *** [Makefile:12286: test/fuzz/libtest_fuzz_a-util.o] Error 1
    13gmake[2]: *** Waiting for unfinished jobs....
    14gmake[2]: Leaving directory '/home/user/builds/bitcoin/src'
    15gmake[1]: *** [Makefile:20136: all-recursive] Error 1
    16gmake[1]: Leaving directory '/home/user/builds/bitcoin/src'
    17gmake: *** [Makefile:812: all-recursive] Error 1
    
  5. fanquake referenced this in commit a07206a82b on Mar 1, 2024
  6. fanquake commented at 7:46 pm on March 1, 2024: member

    When building with gcc 11.2.0p9:

    #29529 should resolve this issue.

  7. grubles commented at 9:56 pm on March 1, 2024: contributor

    #29529 should resolve this issue.

    Thanks, that has allowed bitcoind to be built with gcc. Unfortunately bitcoind crashes immediately still.

    If I load the bitcoind.core into gdb this is what I get for a backtrace:

    0Reading symbols from ./src/bitcoind...
    1[New process 594075]
    2Core was generated by `bitcoind'.
    3Program terminated with signal SIGABRT, Aborted.
    4[#0](/bitcoin-bitcoin/0/)  thrkill () at /tmp/-:3
    53       /tmp/-: No such file or directory.
    6(gdb) bt
    7[#0](/bitcoin-bitcoin/0/)  thrkill () at /tmp/-:3
    8[#1](/bitcoin-bitcoin/1/)  0x0000000000000000 in ?? ()
    9(gdb) 
    
  8. fanquake commented at 6:23 pm on March 3, 2024: member

    Unfortunately, gdb on this platform also crashes when attempting to debug

    Maybe you could try lldb? Hard to debug this further without any more info. Could also configure with --enable-debug.

  9. grubles commented at 2:39 pm on March 4, 2024: contributor
    lldb also segfaults when loading the bitcoind.core dump. :-/
  10. fanquake commented at 10:59 am on March 5, 2024: member
    Does the bitcoind installable from ports run? It is version 26.0, and claims to run on powerpc64. If so, given I can’t see any major patches in https://github.com/openbsd/ports/tree/master/net/bitcoin/patches, you could compare how that is being compiled, to your compilation of 26.0, as another avenue for debugging? Even though GCC compilation will be fixed shortly, my suggestion is to continue using the system compiler (Clang) and --enable-debug.
  11. fanquake referenced this in commit 68ae33d98a on Mar 5, 2024
  12. fanquake referenced this in commit a663ff9836 on Mar 5, 2024
  13. fanquake referenced this in commit 312f3381a2 on Mar 5, 2024
  14. m3dwards commented at 11:15 am on March 6, 2024: contributor

    I’ve been unable to replicate this issue so far.

    I haven’t been able to get ppc64 + OpenBSD host running (ISO wouldn’t boot) but I did manage to get a big endian ppc64 + FreeBSD running and was able to successfully build and run bitcoind.

    Screenshot 2024-03-06 at 11 12 49

    I was able to get OpenBSD 7.4 running on x86 and was also able to build and run bitcoind using the default clang compiler and their default libc library.

  15. fanquake referenced this in commit 6c77dbfd7e on Mar 6, 2024
  16. grubles commented at 2:12 pm on March 6, 2024: contributor

    That’s good to hear. Keep trying to get OpenBSD booted. I had a little bit of trouble myself when using SATA SSD drives post-install. For some reason only a HDD would actually boot.

    I’ll give the ports bitcoind a go, @fanquake.

  17. glozow referenced this in commit fce992b38e on Mar 7, 2024
  18. maflcko commented at 7:58 am on March 12, 2024: member
    Any success with the ports one?
  19. kevkevinpal referenced this in commit 9594644467 on Mar 13, 2024
  20. kevkevinpal referenced this in commit c2c3ff795b on Mar 13, 2024
  21. janus referenced this in commit c44aafba7b on Apr 6, 2024
  22. maflcko commented at 12:49 pm on May 29, 2024: member
    Closing for now due to inactivity. Please leave a comment if there are updates or more more information.
  23. maflcko closed this on May 29, 2024


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

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