Author

Topic: Wallet which crashes Bitcoin Core 23.0 without any info (Read 153 times)

full member
Activity: 244
Merit: 126
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.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
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()).
hero member
Activity: 714
Merit: 1010
Crypto Swap Exchange
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.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
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.
legendary
Activity: 2338
Merit: 5297
Self-proclaimed Genius
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
full member
Activity: 244
Merit: 126
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.
legendary
Activity: 2338
Merit: 5297
Self-proclaimed Genius
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.
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
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.
legendary
Activity: 952
Merit: 1367
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?
full member
Activity: 244
Merit: 126
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.
legendary
Activity: 2380
Merit: 5178
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.
full member
Activity: 244
Merit: 126
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
Jump to: