bitcoind aborts #11063

issue janstary opened this issue on August 16, 2017
  1. janstary commented at 8:46 AM on August 16, 2017: none

    This is current git master on OpenBSD 6.1-current/amd64

    $ gdb ~/bin/bitcoind
    GNU gdb 6.3
    Copyright 2004 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and you are
    welcome to change it and/or distribute copies of it under certain conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB.  Type "show warranty" for details.
    This GDB was configured as "amd64-unknown-openbsd6.1"...
    (gdb) run
    Starting program: /home/hans/bin/bitcoind
    
    Program received signal SIGABRT, Aborted.
    thrkill () at -:3
    3	-: No such file or directory.
    	in -
    Current language:  auto; currently asm
    (gdb) bt
    [#0](/bitcoin-bitcoin/0/)  thrkill () at -:3
    [#1](/bitcoin-bitcoin/1/)  0x0000067e899c452b in _libc___stack_smash_handler (func=Variable "func" is not available.
    ) at /usr/src/lib/libc/sys/stack_protector.c:79
    Die: DW_TAG_<unknown> (abbrev = 113, offset = 1678518)
    	has children: FALSE
    	attributes:
    		DW_AT_type (DW_FORM_ref4) constant ref: 1634006 (adjusted)
    Dwarf Error: Cannot find type of die [in module /home/hans/bin/bitcoind]
    (gdb) quit
    The program is running.	 Exit anyway? (y or n) y
    

    Apparently, something bad is happening on the stack and falls victim to to stack protector, but I don't know what it is.

  2. fanquake added the label Linux/Unix on Aug 16, 2017
  3. laanwj commented at 8:10 PM on August 17, 2017: member
    • Does this happen every time you start, or irregularly?
    • Can you paste the last part of the debug.log, before the crash?
    • openbsd's default gdb version is useless (it's from 2004, DWARF 3, the format that modern compilers use for debug information didn't exist yet at the time, and we even have DWARF 4 now). Can you try installing a newer gdb from ports, and get a traceback with that?
    • If you run the tests make check and test/functional/test_runner.py for the unit tests and functional tests respectively, do they pass?

    FYI I tried running bitcoind on OpenBSD 6.1 and did basic sanity tests and did not have this issue, so we need to figure out what triggers it in your case.

  4. janstary commented at 1:24 PM on August 28, 2017: none

    Here's trying again with the current git master on OpenBSD 6.1-current/amd64

     $ env AUTOMAKE_VERSION=1.15 AUTOCONF_VERSION=2.69 sh autogen.sh
    ./configure --prefix=$HOME --mandir=$HOME/man --disable-wallet  CC=cc CXX=c++
    gmake && gmake install
    

    The cc and c++ is actually clang 4.0.0 as patched by OpenBSD.

    The resulting bitcoind consistenly crashes with SIGABRT. This is a backtrace from gdb 6.3:

    $ egdb /home/hans/bin/bitcoind
    GNU gdb (GDB) 7.12.1
    Copyright (C) 2017 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-unknown-openbsd6.2".
    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 /home/hans/bin/bitcoind...done.
    (gdb) run
    Starting program: /home/hans/bin/bitcoind
    [New thread 368295]
    [New thread 219480]
    [New thread 131428]
    [New thread 105176]
    [New thread 528467]
    [New thread 568060]
    [New thread 570717]
    [New thread 370839]
    [New thread 404259]
    
    Thread 1 received signal SIGABRT, Aborted.
    thrkill () at -:3
    3	-: No such file or directory.
    (gdb) bt
    [#0](/bitcoin-bitcoin/0/)  thrkill () at -:3
    [#1](/bitcoin-bitcoin/1/)  0x00001fcadaee152b in _libc___stack_smash_handler (func=<optimized out>, damaged=<optimized out>) at /usr/src/lib/libc/sys/stack_protector.c:79
    [#2](/bitcoin-bitcoin/2/)  0x00001fc7f264e2dd in CDBWrapper::CDBWrapper (this=0x1fca22a6bf00, path=..., nCacheSize=<optimized out>, fMemory=<optimized out>, fWipe=<optimized out>,
        obfuscate=<error reading variable: access outside bounds of object referenced via synthetic pointer>) at dbwrapper.cpp:142
    [#3](/bitcoin-bitcoin/3/)  0x00001fc7f27685a9 in CBlockTreeDB::CBlockTreeDB (this=0x1fca22a6bf00, nCacheSize=2097152, fMemory=<error reading variable: access outside bounds of object referenced via synthetic pointer>,
        fWipe=<error reading variable: access outside bounds of object referenced via synthetic pointer>) at txdb.cpp:150
    [#4](/bitcoin-bitcoin/4/)  0x00001fc7f2623922 in AppInitMain (threadGroup=..., scheduler=...) at init.cpp:1404
    [#5](/bitcoin-bitcoin/5/)  0x00001fc7f2602745 in AppInit (argc=1, argv=0x7f7fffff3228) at bitcoind.cpp:168
    [#6](/bitcoin-bitcoin/6/)  0x00001fc7f2602c3f in main (argc=0, argv=0x6) at bitcoind.cpp:195
    (gdb) quit
    A debugging session is active.
    
    	Inferior 1 [process 72956] will be killed.
    
    Quit anyway? (y or n) y
    

    This is what debug.log says:

    
    2017-08-28 13:21:43 Bitcoin version v0.15.99.0-f088a1bb3
    2017-08-28 13:21:43 InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1
    2017-08-28 13:21:43 Assuming ancestors of block 0000000000000000003b9ce759c2a087d52abc4266f8f4ebd6d768b89defa50a have valid signatures.
    2017-08-28 13:21:43 Using the 'standard' SHA256 implementation
    2017-08-28 13:21:43 Default data directory /home/hans/.bitcoin
    2017-08-28 13:21:43 Using data directory /home/hans/.bitcoin
    2017-08-28 13:21:43 Using config file /home/hans/.bitcoin/bitcoin.conf
    2017-08-28 13:21:43 Using at most 125 automatic connections (512 file descriptors available)
    2017-08-28 13:21:43 Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
    2017-08-28 13:21:43 Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
    2017-08-28 13:21:43 Using 4 threads for script verification
    2017-08-28 13:21:43 scheduler thread start
    2017-08-28 13:21:43 HTTP: creating work queue of depth 16
    2017-08-28 13:21:43 No rpcpassword set - using random cookie authentication
    2017-08-28 13:21:43 Generated RPC authentication cookie /home/hans/.bitcoin/.cookie
    2017-08-28 13:21:43 HTTP: starting 4 worker threads
    2017-08-28 13:21:43 Cache configuration:
    2017-08-28 13:21:43 * Using 2.0MiB for block index database
    2017-08-28 13:21:43 * Using 8.0MiB for chain state database
    2017-08-28 13:21:43 * Using 440.0MiB for in-memory UTXO set (plus up to 286.1MiB of unused mempool space)
    2017-08-28 13:21:43 init message: Loading block index...
    2017-08-28 13:21:43 Opening LevelDB in /home/hans/.bitcoin/blocks/index
    2017-08-28 13:21:43 Opened LevelDB successfully
    2017-08-28 13:21:43 Using obfuscation key for /home/hans/.bitcoin/blocks/index: 0000000000000000
    
  5. laanwj commented at 1:55 PM on August 28, 2017: member

    The cc and c++ is actually clang 4.0.0 as patched by OpenBSD.

    Yes, building with clang++ had some issues for me as well last time I tried, that's why I suggest using eg++ in the openbsd build guide. It looks like some kind of ABI conflict in any case.

  6. fanquake closed this on Mar 7, 2018

  7. DrahtBot 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-13 15:15 UTC

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