Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save file corruption #1275

Closed
naxuroqa opened this issue Dec 4, 2018 · 14 comments
Closed

Save file corruption #1275

naxuroqa opened this issue Dec 4, 2018 · 14 comments
Labels
P3 Low priority
Milestone

Comments

@naxuroqa
Copy link

naxuroqa commented Dec 4, 2018

Yesterday I was experimenting with the latest version of toxcore from git/master and in about one out of ten times of saving the data file, it got corrupted and could not be loaded anymore. I'll try to get some more info about what exactly fails to be restored, for now I just wanted to find out if somebody else experienced this.

This never happened to me with 0.2.8, so I think that's a regression.

toxcore version: 9770880

Arch Linux x86_64 4.14.63-1-lts
libsodium 1.0.16
@zoff99
Copy link

zoff99 commented Dec 4, 2018

@naxuroqa are you sure you are not allocating on the stack?
also it could be #1242

@naxuroqa
Copy link
Author

naxuroqa commented Dec 4, 2018

I'm creating a new uint8 array of size tox_get_savedata_size(), and call tox_get_savedata() with this array (https://github.com/naxuroqa/Venom/blob/develop/src/vapi/toxcore.vapi#L1205-L1218), which is called in the tox session destructor, after stopping and joining on the session thread (https://github.com/naxuroqa/Venom/blob/develop/src/tox/ToxSession.vala#L235-L244).
This then gets saved to the save file location (https://github.com/naxuroqa/Venom/blob/develop/src/core/Profile.vala#L72-L83).

Creating an array with new in vala allocates it on the heap.

There were no runtime errors in this process, otherwise I would have seen them logged, and neither has this ever happened with 0.2.8, ever.

@zoff99
Copy link

zoff99 commented Dec 4, 2018

when it is allocated on the heap it should be ok. most likely you need to wait for #1242 to be merged.
there could be still other bugs, because even with #1242 i get corrupted profile with utox all the time still

@zugz
Copy link

zugz commented Dec 4, 2018 via email

@naxuroqa
Copy link
Author

naxuroqa commented Dec 4, 2018

@zugz I was, that's why I tried it out :)

Is there anything I can do to provide you with more info? I can try to get a savefile to corrupt and send it to you if that helps.

@zugz
Copy link

zugz commented Dec 4, 2018 via email

@zoff99
Copy link

zoff99 commented Dec 4, 2018

does analyzing make sense? we should merge #1242 before that. i don't understand what the holdup is there?

@zugz
Copy link

zugz commented Dec 4, 2018 via email

@zugz
Copy link

zugz commented Dec 4, 2018 via email

@zoff99
Copy link

zoff99 commented Dec 4, 2018

@zugz :-) ok mate
still we need to merge #1242
it's a critical bug with crashes

@iphydf iphydf added this to the v0.2.x milestone Jan 6, 2019
@sudden6
Copy link

sudden6 commented Jan 13, 2019

This should be fixed with 0.2.9, right? can anyone confirm?

@naxuroqa
Copy link
Author

@sudden6 I'll see if 0.2.9 fixed it, will close if it doesn't occur anymore.

@anthonybilinski
Copy link

Fixed for me, tested pre and post fix: #1267 (comment)
There's also a recovery option there if your save file was corrupted.

@naxuroqa
Copy link
Author

oh, nice. So it was only partially corrupted?

You are right, I can't reproduce the corruption anymore.
Fixed for me as well.

@robinlinden robinlinden modified the milestones: v0.2.x, v0.2.9 Jan 14, 2019
@iphydf iphydf added the P3 Low priority label Feb 4, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 Low priority
Projects
None yet
Development

No branches or pull requests

7 participants