Bitcoin Forum
November 02, 2024, 04:18:53 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Wallet which crashes Bitcoin Core 23.0 without any info  (Read 171 times)
pbies (OP)
Full Member
***
Offline Offline

Activity: 296
Merit: 133



View Profile
August 01, 2022, 04:14:14 PM
 #1

I have small wallet which crashes Bitcoin Core 23.0 without any info in logs or on the screen.
Bitcoin Core window just disappear and there is no info in logs about anything related.
This happens at the end of rescan, which takes over an hour.

I can share the wallet.

Code:
2022-08-01T15:56:33Z [129 88k] Still rescanning. At block 723625. Progress=0.944998
2022-08-01T15:57:33Z [129 88k] Still rescanning. At block 728203. Progress=0.955480
2022-08-01T15:58:33Z [129 88k] Still rescanning. At block 732816. Progress=0.966037
2022-08-01T15:59:33Z [129 88k] Still rescanning. At block 737312. Progress=0.976120
2022-08-01T16:00:33Z [129 88k] Still rescanning. At block 741972. Progress=0.986982
2022-08-01T16:01:33Z [129 88k] Still rescanning. At block 746621. Progress=0.997961
2022-08-01T16:01:44Z [129 88k] Rescan completed in         5110486ms
2022-08-01T16:01:44Z [129 88k] setKeyPool.size() = 100
2022-08-01T16:01:44Z [129 88k] mapWallet.size() = 2
2022-08-01T16:01:44Z [129 88k] m_address_book.size() = 1

BTC: bc1qmrexlspd24kevspp42uvjg7sjwm8xcf9w86h5k
hosseinimr93
Legendary
*
Offline Offline

Activity: 2576
Merit: 5661



View Profile
August 01, 2022, 04:28:33 PM
 #2

I can share the wallet.
Take note that your wallet file includes all the private keys and anyone who has access to the file and know the passphrase (if there's any) can steal your bitcoin. (The passphrase can be brute-forced, if it's not strong enough.)
Share the wallet file if you are sure that the person is trustworthy enough and ignore personal messages you will probably receive.

▄▄███████▄▄
▄██████████████▄
▄██████████████████▄
▄████▀▀▀▀███▀▀▀▀█████▄
▄█████████████▄█▀████▄
███████████▄███████████
██████████▄█▀███████████
██████████▀████████████
▀█████▄█▀█████████████▀
▀████▄▄▄▄███▄▄▄▄████▀
▀██████████████████▀
▀███████████████▀
▀▀███████▀▀
.
 MΞTAWIN  THE FIRST WEB3 CASINO   
.
.. PLAY NOW ..
pbies (OP)
Full Member
***
Offline Offline

Activity: 296
Merit: 133



View Profile
August 01, 2022, 05:41:10 PM
 #3

I can share the wallet.
Take note that your wallet file includes all the private keys and anyone who has access to the file and know the passphrase (if there's any) can steal your bitcoin. (The passphrase can be brute-forced, if it's not strong enough.)
Share the wallet file if you are sure that the person is trustworthy enough and ignore personal messages you will probably receive.

No worries, I know that.

BTC: bc1qmrexlspd24kevspp42uvjg7sjwm8xcf9w86h5k
PawGo
Legendary
*
Offline Offline

Activity: 952
Merit: 1385


View Profile
August 01, 2022, 05:43:33 PM
 #4

Is it a new wallet or old one?
Is Bitcoin Core fully synchronized? Do you use full-node or pruned version?
Is it possible that you do not have information about historical transactions from the wallet?
How does it happen - do you select wallet file after Bitcoin Core is opened or is it default wallet?
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
August 01, 2022, 06:46:45 PM
 #5

I have small wallet which crashes Bitcoin Core 23.0 without any info in logs or on the screen.
Bitcoin Core window just disappear and there is no info in logs about anything related.
This happens at the end of rescan, which takes over an hour.

I can share the wallet.

Is it encrypted, can you decrypt it on your system and see if it produces a reasonable output?

I'd assume it means there's something wrong with the wallet file if it randomly crashes but not sure what so it might be helpful if you look through an unencrypted file or look for wallet recovery software that's well reputed to see if you can find anything that'll help you make it more readable/not crash.
nc50lc
Legendary
*
Offline Offline

Activity: 2590
Merit: 6310


Self-proclaimed Genius


View Profile
August 02, 2022, 07:15:05 AM
 #6

Try to launch Bitcoin Core with -debug=walletdb command-line option to output wallet database-related info or -debug=1 to enable all categories.
Then re-check the logs if you can find an error related to the crash.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
pbies (OP)
Full Member
***
Offline Offline

Activity: 296
Merit: 133



View Profile
August 02, 2022, 08:52:35 AM
Merited by ABCbits (2), nc50lc (1)
 #7

It is an old wallet. Rescan begins from block 0, so it is completely not scanned.
Yes, Bitcoin Core is fully synced. Full-node.
I know nothing about this wallet. It size is 88 kB (90112 B).
Seems like it can be wallet without any private keys (see logs below).
Also no version of this wallet is given in logs, which is very strange.
I close all wallets and open only this one from menu.

I don't know if it is encrypted. There may be no private keys so there could be nothing to encrypt.
It does not randomly crash - it does crash when finishing rescan, at 100%.

I suspect it can be forged wallet, as any wallet cannot have rescan at block 0. Minimal chance for any wallet.

When opening the wallet I get in logs (started with -debug=1):

Code:
2022-08-02T08:07:19Z Using wallet h:\blockchain\129 88k crsh\wallet.dat
2022-08-02T08:07:19Z BerkeleyEnvironment::Open: LogDir=h:\blockchain\129 88k crsh\database ErrorFile=h:\blockchain\129 88k crsh\db.log
2022-08-02T08:07:19Z init message: Loading wallet…
2022-08-02T08:07:19Z [129 88k crsh] CDataStream::read(): end of data: iostream error
2022-08-02T08:07:19Z [129 88k crsh] CDataStream::read(): end of data: iostream error
2022-08-02T08:07:19Z [129 88k crsh] Wallet completed loading in              10ms
2022-08-02T08:07:19Z init message: Rescanning…
2022-08-02T08:07:19Z [129 88k crsh] Rescanning last 747619 blocks (from block 0)...
2022-08-02T08:07:19Z [129 88k crsh] Rescan started from block 000000000000000000cd74d3024470a4e206096e3a6ce5091bcfae787d5d32df...

When Bitcoin Core crashes I get in logs:

Code:
2022-08-02T08:52:10Z [129 88k crsh] Rescan completed in         2691375ms
2022-08-02T08:52:10Z [129 88k crsh] setKeyPool.size() = 100
2022-08-02T08:52:10Z [129 88k crsh] mapWallet.size() = 2
2022-08-02T08:52:10Z [129 88k crsh] m_address_book.size() = 1
2022-08-02T08:52:10Z TransactionAddedToMempool: txid=5c038f0c544e283e3588fa7daecdc6d29cf78e66cf4dde02aa78fa798e8eadca wtxid=282df781a2deb15d524e1c1b1d77bb44034b8ddc3ab9102f3847c5dd61153882

Nothing more. -debug=1 was used.

I cannot do further tests, if you want - you can, I can share the wallet.

Idea of my thread is to fix Bitcoin Core from crashing, not repairing the wallet.

BTC: bc1qmrexlspd24kevspp42uvjg7sjwm8xcf9w86h5k
nc50lc
Legendary
*
Offline Offline

Activity: 2590
Merit: 6310


Self-proclaimed Genius


View Profile
August 02, 2022, 10:41:17 AM
 #8

I suspect it can be forged wallet, as any wallet cannot have rescan at block 0. Minimal chance for any wallet.
-snip-
You're probably right (given your post history).

After loading the wallet, instead of getting: Wallet File Version = n
and Keys: n plaintext, n encrypted, n w/ metadata, n total. Unknown wallet records: n

Those are replaced by:
Quote from: pbies
Code:
2022-08-02T08:07:19Z [129 88k crsh] CDataStream::read(): end of data: iostream error
2022-08-02T08:07:19Z [129 88k crsh] CDataStream::read(): end of data: iostream error

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
NotATether
Legendary
*
Offline Offline

Activity: 1778
Merit: 7354


Top Crypto Casino


View Profile WWW
August 02, 2022, 10:42:10 AM
 #9

Once again, a runaway exception proves to be the fiend!

Code:
2022-08-02T08:07:19Z Using wallet h:\blockchain\129 88k crsh\wallet.dat
2022-08-02T08:07:19Z BerkeleyEnvironment::Open: LogDir=h:\blockchain\129 88k crsh\database ErrorFile=h:\blockchain\129 88k crsh\db.log
2022-08-02T08:07:19Z init message: Loading wallet
2022-08-02T08:07:19Z [129 88k crsh] CDataStream::read(): end of data: iostream error
2022-08-02T08:07:19Z [129 88k crsh] CDataStream::read(): end of data: iostream error

In C++ (the language that Core is written in), if an exception propagates all the way out of a thread's main() function (It could be the actual main() or the function that you program a newly-created thread to start running in), all of the threads are terminated, not just the one with the runaway exception. That's why there are still some logged messages after the exception.

Solution would be to trap exceptions for CDataStream at the wallet loading level, and then fail the loading of the wallet with a GUI error box, or an RPC error message if running as daemon.

███████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████

███████████████████████
.
BC.GAME
▄▄▀▀▀▀▀▀▀▄▄
▄▀▀░▄██▀░▀██▄░▀▀▄
▄▀░▐▀▄░▀░░▀░░▀░▄▀▌░▀▄
▄▀▄█▐░▀▄▀▀▀▀▀▄▀░▌█▄▀▄
▄▀░▀░░█░▄███████▄░█░░▀░▀▄
█░█░▀░█████████████░▀░█░█
█░██░▀█▀▀█▄▄█▀▀█▀░██░█
█░█▀██░█▀▀██▀▀█░██▀█░█
▀▄▀██░░░▀▀▄▌▐▄▀▀░░░██▀▄▀
▀▄▀██░░▄░▀▄█▄▀░▄░░██▀▄▀
▀▄░▀█░▄▄▄░▀░▄▄▄░█▀░▄▀
▀▄▄▀▀███▄███▀▀▄▄▀
██████▄▄▄▄▄▄▄██████
.
..CASINO....SPORTS....RACING..


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Cricktor
Legendary
*
Offline Offline

Activity: 938
Merit: 1447


Crypto Swap Exchange


View Profile
August 02, 2022, 10:59:25 AM
Merited by vapourminer (2)
 #10

That's weird. While it says it starts rescanning more or less from the start of the blockchain, the blockhash in the log line "Rescan started from block 000000000000000000cd74d3024470a4e206096e3a6ce5091bcfae787d5d32df" belongs to block height 490509 (counting from height 0 for the Genesis block).

What happens when your abort the rescan (execute the command "abortrescan" in console tab of your Bitcoin-QT)? Does it crash again?
If not, you could then try to limit the rescan range with command "rescanblockchain start end", where start and end define the block height range to rescan.

mapWallet.size() tells the size of the wallet in KiB and only 2 KiB is too small for a key pool size of 100. I wonder why it says it has only 1 address in address book, while with a key pool size of 100, there should be also 100 in address book.

But I might be very wrong as I'm no expert for Bitcoin Core interna. I'm currently playing with a wallet full of descriptors and teaching myself.

When I had to restore an old wallet from 2014 it didn't work to feed the wallet.dat file into a recent Bitcoin Core version. There are Core versions where the wallet file interna changed in such a way that you can't skip those versions. At least that was my experience. I upgraded Bitcoin Core incrementally and updated the wallet.dat file with every incremental version. This tedious way might not have been necessary, but at least it worked for me.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
NotATether
Legendary
*
Offline Offline

Activity: 1778
Merit: 7354


Top Crypto Casino


View Profile WWW
August 02, 2022, 11:03:59 AM
 #11

What happens when your abort the rescan (execute the command "abortrescan" in console tab of your Bitcoin-QT)? Does it crash again?
If not, you could then try to limit the rescan range with command "rescanblockchain start end", where start and end define the block height range to rescan.

It should not crash again, because the exception above clearly states that its an iostream (related to files) exception, so the only way it could be triggered is by closing a bad file descriptor pointing to the wallet file, which should not be happening because programs such as Bitcoin Core ought to check if the descriptor is bad first before attempting to close it, and just abandon it if it turns out to be bad (and C++ iostream provides a method for checking for that: fail()).

███████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████

███████████████████████
.
BC.GAME
▄▄▀▀▀▀▀▀▀▄▄
▄▀▀░▄██▀░▀██▄░▀▀▄
▄▀░▐▀▄░▀░░▀░░▀░▄▀▌░▀▄
▄▀▄█▐░▀▄▀▀▀▀▀▄▀░▌█▄▀▄
▄▀░▀░░█░▄███████▄░█░░▀░▀▄
█░█░▀░█████████████░▀░█░█
█░██░▀█▀▀█▄▄█▀▀█▀░██░█
█░█▀██░█▀▀██▀▀█░██▀█░█
▀▄▀██░░░▀▀▄▌▐▄▀▀░░░██▀▄▀
▀▄▀██░░▄░▀▄█▄▀░▄░░██▀▄▀
▀▄░▀█░▄▄▄░▀░▄▄▄░█▀░▄▀
▀▄▄▀▀███▄███▀▀▄▄▀
██████▄▄▄▄▄▄▄██████
.
..CASINO....SPORTS....RACING..


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
pbies (OP)
Full Member
***
Offline Offline

Activity: 296
Merit: 133



View Profile
August 02, 2022, 01:42:04 PM
 #12

What happens when your abort the rescan (execute the command "abortrescan" in console tab of your Bitcoin-QT)? Does it crash again?
If not, you could then try to limit the rescan range with command "rescanblockchain start end", where start and end define the block height range to rescan.

I cannot abort rescan. It gives me message in console:

Code:
No wallet is loaded. Load a wallet using loadwallet or create a new one with createwallet. (Note: A default wallet is no longer automatically created) (code -18)

Even with that message rescan is ongoing in the background with progress messages in logs.

Normally I have no option to go into console when opening wallet. Additional window is open and I need to close it, but it does not change much.

BTC: bc1qmrexlspd24kevspp42uvjg7sjwm8xcf9w86h5k
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!