-keepnotewitnesscache -rescan -rescanheight with no blocks does a coredump #103

Open
opened 2 years ago by duke · 0 comments
duke commented 2 years ago
Owner

I ran into an issue and removed the blocks/ and chainstate/ directories inside my HUSH3 directory, which had a default autocreated wallet.dat. I had a script to start hushd which uses -keepnotewitnesscache -rescan -rescanheight and used that. hushd coredumped.

This is not high priority, as users will not normally do this, but hushd should not coredump in this situation. It should either sync normally or exit with an error that the CLI arguments were not valid.

This is the end of the debug.log:

2022-01-30 20:12:42 Initializing databases...
2022-01-30 20:12:42 init message: Verifying blocks...
2022-01-30 20:12:42 Verifying block DB... block index              16ms
2022-01-30 20:12:42 init message: Loading wallet...
2022-01-30 20:12:42 nFileVersion = 3090150
2022-01-30 20:12:42 Keys: 102 plaintext, 0 encrypted, 102 w/ metadata, 102 total
2022-01-30 20:12:42 ZKeys: 0 plaintext, 0 encrypted, 0 w/metadata, 0 total
2022-01-30 20:12:42  wallet                    5ms
2022-01-30 20:12:42 AppInit2: keeping NoteWitnessCache with rescan height=817463

This is the backtrace:

#0  AppInit2 (threadGroup=..., scheduler=...) at /usr/include/c++/8/bits/stl_vector.h:805
#1  0x000056453f1ca114 in AppInit (argc=<optimized out>, argv=<optimized out>) at bitcoind.cpp:238
#2  0x000056453f1b6a6f in main (argc=6, argv=0x7ffe5a88c368) at bitcoind.cpp:268

Looks like AppInit2 is potentially missing some error-checking to see if arguments are valid block heights the node knows about.

I ran into an issue and removed the `blocks/` and `chainstate/` directories inside my HUSH3 directory, which had a default autocreated wallet.dat. I had a script to start hushd which uses -keepnotewitnesscache -rescan -rescanheight and used that. hushd coredumped. This is not high priority, as users will not normally do this, but hushd should not coredump in this situation. It should either sync normally or exit with an error that the CLI arguments were not valid. This is the end of the debug.log: ``` 2022-01-30 20:12:42 Initializing databases... 2022-01-30 20:12:42 init message: Verifying blocks... 2022-01-30 20:12:42 Verifying block DB... block index 16ms 2022-01-30 20:12:42 init message: Loading wallet... 2022-01-30 20:12:42 nFileVersion = 3090150 2022-01-30 20:12:42 Keys: 102 plaintext, 0 encrypted, 102 w/ metadata, 102 total 2022-01-30 20:12:42 ZKeys: 0 plaintext, 0 encrypted, 0 w/metadata, 0 total 2022-01-30 20:12:42 wallet 5ms 2022-01-30 20:12:42 AppInit2: keeping NoteWitnessCache with rescan height=817463 ``` This is the backtrace: ``` #0 AppInit2 (threadGroup=..., scheduler=...) at /usr/include/c++/8/bits/stl_vector.h:805 #1 0x000056453f1ca114 in AppInit (argc=<optimized out>, argv=<optimized out>) at bitcoind.cpp:238 #2 0x000056453f1b6a6f in main (argc=6, argv=0x7ffe5a88c368) at bitcoind.cpp:268 ``` Looks like AppInit2 is potentially missing some error-checking to see if arguments are valid block heights the node knows about.
duke added the
bug
label 1 year ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.