Skip to content

Segmentation Fault in V21 and V22 releases #24335

Closed

Description

@GITErnesO

OS: Ubuntu 20.04.
Releases: Bitcoin Core V21 and V22.

The problem:
I have a lot of HD wallets, with the first transaction in Dic 2017, encrypted, not checked for 5 years.

It starts reescaning and segmentation fault error. Tried with bitcoin-qt, bitcoind, reindex the whole blockchain, and still segmentation fault.
After loading the GUI, load the wallet, again it closes with segmentation fault

V21 and V22 downloaded and checked for signatures and hashes.

The same wallets, if checked after mid-2018-2019 (a year or more) work.

The machine is a DELL inspiron with 16Gb of ram (dbcache=8000). Tried a lot of other things (-rescan, etc) that didn't work.

All other wallets work fine, no problems, but these ones fail with newer versions of bitcoin core. Run bitcoin-wallet info, the wallets are ok, (not corrupted or anything).

If I do the reindex while the wallet is loaded, it crashes the moment the reindex gets to Dic 2017-Jan 2018. Then I reestart without the wallet loaded and it finishes reindexing OK.

In the log says it loads the wallet OK (5s :)), starts reescaning and then nothing else (it crashes).

It crashes 4 or 5 seconds after reescaning (really fast) both bitcoin-qt and bitcoind.

Activity

  1. laanwj commented on Feb 14, 2022

    @laanwj
    Member

    We need a traceback to know where this segfault happens in the code. Can you run the binary in gdb and run bt after the crash?

  2. GITErnesO commented on Feb 14, 2022

    @GITErnesO
    Author

    OK. I'll run gdb and post results.

    To add some context, been using bitcoin core for a long time and it's great. Each version is faster and better. Big fan of descriptor wallets and really big fan of sqlite. Bitcoin core is really fast and stable considering scope and compatibility.

  3. GITErnesO commented on Feb 14, 2022

    @GITErnesO
    Author

    This is bitcoind before the crash:

    2022-02-14T12:32:41Z [default wallet] Wallet completed loading in 45ms
    2022-02-14T12:32:41Z init message: Rescanning…
    2022-02-14T12:32:41Z [default wallet] Rescanning last 291840 blocks (from block 406601)...
    2022-02-14T12:32:41Z [default wallet] Rescan started from block 0000000000000000005ec2ccf319ce976a0804209a89650558b0e19e9edf0f54...
    Segmentation fault (core dumped)


    This is gdb with bt:

    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    [New Thread 0x7ffff71a9700 (LWP 24378)]
    [New Thread 0x7ffff6103700 (LWP 24379)]
    [New Thread 0x7ffff57e4700 (LWP 24380)]
    [New Thread 0x7ffff4fe3700 (LWP 24381)]
    [New Thread 0x7fffe5ffd700 (LWP 24382)]
    [New Thread 0x7fffe57fc700 (LWP 24383)]
    [New Thread 0x7fffe4ffb700 (LWP 24384)]
    [New Thread 0x7fffd7fff700 (LWP 24385)]
    [New Thread 0x7fffd77fe700 (LWP 24386)]
    [New Thread 0x7fffd6ffd700 (LWP 24387)]
    [New Thread 0x7fffd67fc700 (LWP 24388)]
    [New Thread 0x7fff3bcf9700 (LWP 24389)]
    
    Thread 4 "b-qt-init" received signal SIGSEGV, Segmentation fault.
    [Switching to Thread 0x7ffff57e4700 (LWP 24380)]
    0x0000555555bfe3b9 in ?? ()
    (gdb) bt
    #0  0x0000555555bfe3b9 in ?? ()
    #1  0x0000555555c29445 in ?? ()
    #2  0x0000555555c29ab1 in ?? ()
    #3  0x0000555555c2ab5c in ?? ()
    #4  0x0000555555c2b9e1 in ?? ()
    #5  0x0000555555c2e899 in ?? ()
    #6  0x0000555555b7ef36 in ?? ()
    #7  0x00005555558a8226 in ?? ()
    #8  0x0000555555774ee3 in ?? ()
    #9  0x0000555556418e72 in ?? ()
    #10 0x0000555556591631 in ?? ()
    #11 0x0000555556599200 in ?? ()
    #12 0x00005555563eb2d9 in ?? ()
    #13 0x00005555563ef78b in ?? ()
    #14 0x000055555643b65b in ?? ()
    #15 0x00005555563ea0ff in ?? ()
    #16 0x000055555629cd0e in ?? ()
    #17 0x000055555629dbf3 in ?? ()
    #18 0x00007ffff7f9f609 in start_thread (arg=<optimized out>)
        at pthread_create.c:477
    #19 0x00007ffff7bcc293 in clone ()
        at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
    
    Hope it helps.
    
  4. laanwj commented on Feb 14, 2022

    @laanwj
    Member

    Thanks. I can look up the addresses in debug info with addr2line but would need to know what exact version it is.

    Alternatively, if you build from source you'll have symbols yourself instead of bare addresses.

  5. GITErnesO commented on Feb 14, 2022

    @GITErnesO
    Author

    Version is 22.0.0.

    ./bitcoin-qt -version
    Bitcoin Core version v22.0.0
    Copyright (C) 2009-2021 The Bitcoin Core developers

    It's the release version

    I'll try to build the source. I tried once but had problems installing the berkeley db.
    Anyway, building from sources has been in my to-do list for some time :).

  6. lsilva01 commented on Feb 14, 2022

    @lsilva01
    Contributor

    I'll try to build the source. I tried once but had problems installing the berkeley db.

    Have you tried the command below?

    git clone https://github.com/bitcoin/bitcoin.git
    ./bitcoin/contrib/install_db4.sh `pwd`
    

    There is more information at:
    https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md
    https://jonatack.github.io/articles/how-to-compile-bitcoin-core-and-run-the-tests

  7. maflcko commented on Feb 15, 2022

    @maflcko
    Member

    Aren't there debug symbols available for releases?

  8. GITErnesO commented on Feb 15, 2022

    @GITErnesO
    Author

    Tell me how to debug symbols and I do it.

    It will take me some time to build the sources.

    I have wallets to reproduce this bug that are empty, so I can give them to someone who can debug the source (I'm not sure it's the way to go).

  9. GITErnesO commented on Feb 16, 2022

    @GITErnesO
    Author

    V20.1 works fine. So you can load the wallet in 20.1 and then run V22 and problem solved. Once updated the wallet will load in V21 and V22.

  10. achow101 commented on Feb 17, 2022

    @achow101
    Member

    Thanks. I can look up the addresses in debug info with addr2line but would need to know what exact version it is.

    Can you post the result when you do that? I'm having a hard time getting addr2line to output anything sensible.

    I have wallets to reproduce this bug that are empty, so I can give them to someone who can debug the source (I'm not sure it's the way to go).

    If you are comfortable with doing that, you can upload them in a comment here, or send me an email at [email protected]

  11. achow101 commented on Feb 17, 2022

    @achow101
    Member

    I think this may be the same issue as #21605


    Edit: I was sent a wallet and have confirmed it is the same problem.

  12. IvRRimum commented on Feb 19, 2022

    @IvRRimum

    This happens to me too: #24388

  13. added this to the 23.0 milestone on Feb 20, 2022
  14. laanwj commented on Feb 24, 2022

    @laanwj
    Member

    Should be solved by #23304.

  15. GITErnesO commented on Feb 24, 2022

    @GITErnesO
    Author

    I'm glad this is going to be fixed in V23.
    Many people may have wallets they didn't check from that time, may not find the workaround with V20.1, panic, etc.

    I have 6 other wallets that crash with segmentation fault from that era (old copies) to check if this issue is solved.

  16. locked and limited conversation to collaborators on Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions