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

Serializer misbehaving #875

Closed
thrust26 opened this issue Feb 19, 2022 · 1 comment
Closed

Serializer misbehaving #875

thrust26 opened this issue Feb 19, 2022 · 1 comment
Assignees
Labels
Milestone

Comments

@thrust26
Copy link
Member

thrust26 commented Feb 19, 2022

While other F6 games create state files which are smaller than 2KB, CG state files were 6.4 MB(!) (see #858).

BUT, while trying to narrow down the bug, the problem suddenly disappeared. Even after undoing all changes and even in 6.5.3! It turned out that deleting the old 6.4MB state files fixed the problem.

So it seem like there is a problem in the Serializer when overwriting large files and the files are not cut to their current length.

Looks like line 259 in StateManager could be fixed to use Serializer out(buf.str(), Serializer::Mode::ReadWriteTrunc);

@thrust26 thrust26 added the bug label Feb 19, 2022
@thrust26 thrust26 added this to the Prio 2 milestone Feb 19, 2022
@thrust26 thrust26 self-assigned this Feb 19, 2022
@thrust26
Copy link
Member Author

thrust26 commented Feb 20, 2022

Saving all states also creates way too large files (e.g. 2 KB game with 160 MB for 1000 save states, single state is 1.2K). The value returned in RewindManager::saveAllStates() by state.data.size() is way tool large (156 KB).

@sa666666 This seems to result from a general bug in the 'RewindManager' and also causes excessive memory usage.

Nevermind 😳

@thrust26 thrust26 modified the milestones: Prio 2, Prio 1 Feb 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants