Segmentation Fault in V21 and V22 releases #24335

issue GITErnesO openend this issue on February 14, 2022
  1. GITErnesO commented at 0:08 am on February 14, 2022: none

    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.

  2. GITErnesO added the label Bug on Feb 14, 2022
  3. MarcoFalke added the label Wallet on Feb 14, 2022
  4. laanwj commented at 11:34 am on February 14, 2022: 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?
  5. GITErnesO commented at 12:30 pm on February 14, 2022: none

    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.

  6. GITErnesO commented at 12:47 pm on February 14, 2022: none

    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:

     0[Thread debugging using libthread_db enabled]
     1Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
     2[New Thread 0x7ffff71a9700 (LWP 24378)]
     3[New Thread 0x7ffff6103700 (LWP 24379)]
     4[New Thread 0x7ffff57e4700 (LWP 24380)]
     5[New Thread 0x7ffff4fe3700 (LWP 24381)]
     6[New Thread 0x7fffe5ffd700 (LWP 24382)]
     7[New Thread 0x7fffe57fc700 (LWP 24383)]
     8[New Thread 0x7fffe4ffb700 (LWP 24384)]
     9[New Thread 0x7fffd7fff700 (LWP 24385)]
    10[New Thread 0x7fffd77fe700 (LWP 24386)]
    11[New Thread 0x7fffd6ffd700 (LWP 24387)]
    12[New Thread 0x7fffd67fc700 (LWP 24388)]
    13[New Thread 0x7fff3bcf9700 (LWP 24389)]
    14
    15Thread 4 "b-qt-init" received signal SIGSEGV, Segmentation fault.
    16[Switching to Thread 0x7ffff57e4700 (LWP 24380)]
    170x0000555555bfe3b9 in ?? ()
    18(gdb) bt
    19[#0](/bitcoin-bitcoin/0/)  0x0000555555bfe3b9 in ?? ()
    20[#1](/bitcoin-bitcoin/1/)  0x0000555555c29445 in ?? ()
    21[#2](/bitcoin-bitcoin/2/)  0x0000555555c29ab1 in ?? ()
    22[#3](/bitcoin-bitcoin/3/)  0x0000555555c2ab5c in ?? ()
    23[#4](/bitcoin-bitcoin/4/)  0x0000555555c2b9e1 in ?? ()
    24[#5](/bitcoin-bitcoin/5/)  0x0000555555c2e899 in ?? ()
    25[#6](/bitcoin-bitcoin/6/)  0x0000555555b7ef36 in ?? ()
    26[#7](/bitcoin-bitcoin/7/)  0x00005555558a8226 in ?? ()
    27[#8](/bitcoin-bitcoin/8/)  0x0000555555774ee3 in ?? ()
    28[#9](/bitcoin-bitcoin/9/)  0x0000555556418e72 in ?? ()
    29[#10](/bitcoin-bitcoin/10/) 0x0000555556591631 in ?? ()
    30[#11](/bitcoin-bitcoin/11/) 0x0000555556599200 in ?? ()
    31[#12](/bitcoin-bitcoin/12/) 0x00005555563eb2d9 in ?? ()
    32[#13](/bitcoin-bitcoin/13/) 0x00005555563ef78b in ?? ()
    33[#14](/bitcoin-bitcoin/14/) 0x000055555643b65b in ?? ()
    34[#15](/bitcoin-bitcoin/15/) 0x00005555563ea0ff in ?? ()
    35[#16](/bitcoin-bitcoin/16/) 0x000055555629cd0e in ?? ()
    36[#17](/bitcoin-bitcoin/17/) 0x000055555629dbf3 in ?? ()
    37[#18](/bitcoin-bitcoin/18/) 0x00007ffff7f9f609 in start_thread (arg=<optimized out>)
    38    at pthread_create.c:477
    39[#19](/bitcoin-bitcoin/19/) 0x00007ffff7bcc293 in clone ()
    40    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
    41
    42Hope it helps.
    
  7. laanwj commented at 1:03 pm on February 14, 2022: 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.

  8. GITErnesO commented at 1:34 pm on February 14, 2022: none

    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 :).

  9. lsilva01 commented at 11:20 pm on February 14, 2022: contributor

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

    Have you tried the command below?

    0git clone https://github.com/bitcoin/bitcoin.git
    1./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

  10. MarcoFalke commented at 7:44 am on February 15, 2022: member
    Aren’t there debug symbols available for releases?
  11. GITErnesO commented at 4:28 pm on February 15, 2022: none

    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).

  12. GITErnesO commented at 7:31 pm on February 16, 2022: none
    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.
  13. achow101 commented at 5:13 pm on February 17, 2022: 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 andrew@achow101.com

  14. achow101 commented at 5:27 pm on February 17, 2022: 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.

  15. IvRRimum commented at 9:21 pm on February 19, 2022: none
  16. MarcoFalke added this to the milestone 23.0 on Feb 20, 2022
  17. laanwj commented at 7:14 pm on February 24, 2022: member
    Should be solved by #23304.
  18. GITErnesO commented at 11:05 pm on February 24, 2022: none

    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.

  19. laanwj closed this on Mar 2, 2022

  20. DrahtBot locked this on Mar 2, 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-11-22 06:12 UTC

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