Something goes wrong when saving claimtrie nodes to disk and loading it #133

Closed
opened 2018-05-07 00:47:08 +02:00 by kaykurokawa · 2 comments
kaykurokawa commented 2018-05-07 00:47:08 +02:00 (Migrated from github.com)

Discovered in https://github.com/lbryio/lbrycrd/pull/110

When loading in claimtrie nodes using function InsertFromDisk() https://github.com/lbryio/lbrycrd/blob/master/src/claimtrie.cpp#L1072 , we discovered that for some reason the "name" variable contains an extra bogus character at the end.

However, I suspect that there is not always a bogus character attached to the "name" variable, thus this function will completely fail.

I've tested the serialization classes to see if there is any problem loading/saving string classes and there is no problem, so its likely a problem originating from when we save nodes, particularly when the function markNodeDirty() gets called https://github.com/lbryio/lbrycrd/blob/master/src/claimtrie.cpp#L828 which marks nodes to be saved on disk.

Discovered in https://github.com/lbryio/lbrycrd/pull/110 When loading in claimtrie nodes using function InsertFromDisk() https://github.com/lbryio/lbrycrd/blob/master/src/claimtrie.cpp#L1072 , we discovered that for some reason the "name" variable contains an extra bogus character at the end. However, I suspect that there is not always a bogus character attached to the "name" variable, thus this function will completely fail. I've tested the serialization classes to see if there is any problem loading/saving string classes and there is no problem, so its likely a problem originating from when we save nodes, particularly when the function markNodeDirty() gets called https://github.com/lbryio/lbrycrd/blob/master/src/claimtrie.cpp#L828 which marks nodes to be saved on disk.
bvbfan commented 2018-08-02 20:38:58 +02:00 (Migrated from github.com)

This probably should be fixed when merging new code.

This *probably* should be fixed when merging new code.
BrannonKing commented 2019-05-08 17:46:20 +02:00 (Migrated from github.com)

I'm closing this as unreproducible. The serialization code has been updated with the upstream merge. Also, the code for loading the trie will be different with the new memory improvements.

I'm closing this as unreproducible. The serialization code has been updated with the upstream merge. Also, the code for loading the trie will be different with the new memory improvements.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbrycrd#133
No description provided.