cygnusxi/CurecoinSource

curecoin-qt v2.1.0.1 segfaults on wallet unlock on Arch Linux

Closed this issue · 3 comments

After the recent update to v2.1.0.1 (8cd2c3b), curecoin-qt started to segfault when you try to unlock a wallet, enter any passphrase and press OK:

Reading symbols from curecoin-qt...
(gdb) run
Starting program: /usr/bin/curecoin-qt 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff2fe0700 (LWP 102556)]
[New Thread 0x7ffff1266700 (LWP 102557)]
[New Thread 0x7ffff0a65700 (LWP 102558)]
[New Thread 0x7fffe17e6700 (LWP 102559)]
qt.qpa.xcb: QXcbConnection: XCB error: 148 (Unknown), sequence: 220, resource id: 0, major code: 140 (Unknown), minor code: 20
[New Thread 0x7fffdbfff700 (LWP 102560)]
[New Thread 0x7fffdb7fe700 (LWP 102727)]
[New Thread 0x7fffdaffd700 (LWP 102728)]
[New Thread 0x7fffda7fc700 (LWP 102729)]
[New Thread 0x7fffd9ffb700 (LWP 102730)]
[New Thread 0x7fffd97fa700 (LWP 102731)]
[New Thread 0x7fffd8ff9700 (LWP 102732)]
[Thread 0x7fffd8ff9700 (LWP 102732) exited]
[New Thread 0x7fffcbfff700 (LWP 102733)]
[New Thread 0x7fffd8ff9700 (LWP 102734)]
[New Thread 0x7fffcb7fe700 (LWP 102735)]
[New Thread 0x7fffcaffd700 (LWP 102736)]
[Thread 0x7fffdaffd700 (LWP 102728) exited]
[New Thread 0x7fffdaffd700 (LWP 102745)]

Thread 1 "curecoin-qt" received signal SIGSEGV, Segmentation fault.
0x00007ffff7d2c6cd in EVP_CipherInit_ex () from /usr/lib/libcrypto.so.1.1
(gdb) bt
#0  0x00007ffff7d2c6cd in EVP_CipherInit_ex () at /usr/lib/libcrypto.so.1.1
#1  0x00005555557817e4 in CCrypter::Decrypt(std::vector<unsigned char, std::allocator<unsigned char> > const&, std::vector<unsigned char, secure_allocator<unsigned char> >&)
    (this=this@entry=0x7fffffffb240, vchCiphertext=std::vector of length 48, capacity 48 = {...}, vchPlaintext=std::vector of length 48, capacity 48 = {...}) at src/crypter.cpp:91
#2  0x00005555556e0fd0 in CWallet::Unlock(std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> > const&)
    (this=0x555555fba420, strWalletPassphrase="123") at src/wallet.cpp:102
#3  0x000055555570c5dd in WalletModel::setWalletLocked(bool, std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> > const&) (this=<optimized out>, this=<optimized out>, locked=false, passPhrase=...) at src/qt/walletmodel.cpp:290
#4  WalletModel::setWalletLocked(bool, std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> > const&)
    (this=<optimized out>, locked=<optimized out>, passPhrase=...) at src/qt/walletmodel.cpp:280
#5  0x00007fffffffb380 in  ()
#6  0x00007fffffffb360 in  ()
#7  0x00007fffffffb370 in  ()
#8  0x00007fffffffb390 in  ()
#9  0x00007fffffffb3b0 in  ()
#10 0x00007fffffffb3d0 in  ()
#11 0x4054000000000000 in  ()
#12 0x403a000000000000 in  ()
#13 0x3ff0000000000000 in  ()
#14 0x0000000000000000 in  ()
(gdb) quit

The package was built against openssl 1.1.1.g-1, boost 1.72.0 with gcc 10.1.0, but this still happens when I build it with gcc 9.3.0 or against boost 1.69.0 and openssl 1.0.2-u:

Thread 1 "curecoin-qt" received signal SIGSEGV, Segmentation fault.
0x00007ffff7accb90 in EVP_CIPHER_CTX_init () from /usr/lib/libcrypto.so.1.0.0
(gdb) bt
#0  0x00007ffff7accb90 in EVP_CIPHER_CTX_init () at /usr/lib/libcrypto.so.1.0.0
#1  0x000055555577cfd8 in CCrypter::Decrypt(std::vector<unsigned char, std::allocator<unsigned char> > const&, std::vector<unsigned char, secure_allocator<unsigned char> >&)
    (this=this@entry=0x7fffffffb240, vchCiphertext=std::vector of length 48, capacity 48 = {...}, vchPlaintext=std::vector of length 48, capacity 48 = {...}) at src/crypter.cpp:90
#2  0x00005555556e06c0 in CWallet::Unlock(std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> > const&)
    (this=0x555555c93ed0, strWalletPassphrase="3214") at src/wallet.cpp:102
#3  0x000055555570bfcd in WalletModel::setWalletLocked(bool, std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> > const&) (this=<optimized out>, this=<optimized out>, locked=false, passPhrase=...) at src/qt/walletmodel.cpp:290
#4  WalletModel::setWalletLocked(bool, std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> > const&)
    (this=<optimized out>, locked=<optimized out>, passPhrase=...) at src/qt/walletmodel.cpp:280
#5  0x00007fffffffb380 in  ()
#6  0x00007fffffffb360 in  ()
#7  0x00007fffffffb370 in  ()
#8  0x00007fffffffb390 in  ()
#9  0x00007fffffffb3b0 in  ()
#10 0x00007fffffffb3d0 in  ()
#11 0x4054000000000000 in  ()
#12 0x403a000000000000 in  ()
#13 0x3ff0000000000000 in  ()
#14 0x0000000000000000 in  ()

and this does not happen if I build an older version (f9d54f9) on current system (gcc 10.1.0, boost 1.69.0 and openssl 1.0.2-u).

Can you try the version in in pull request #54 ?

Both #54 and #55 fix the issue for me (openssl 1.1.1.g-1, boost 1.72.0, gcc 10.1.0).

These have been merged.