Coder Social home page Coder Social logo

Comments (3)

olanti-p avatar olanti-p commented on June 11, 2024

I'm not sure what's precisely going on here, but it seems that the game uses wrong parser function for reading the saved integer back from JSON. It saves a 64-bit integer, but tries to load it back as a 32-bit integer, so it doesn't fit and throws a parse error.

Uploading Cridersville.zip…

It seems you have submitted the issue form before waiting for the upload to finish (the text changes to file name once that happens).

from cataclysm-bn.

olanti-p avatar olanti-p commented on June 11, 2024

On further thought, in code that number means count of references, which in theory should stay far, far, far below limits of 32-bit unsigned int.

uint32_t count = it.second->json_count;
if( count != 0 ) {
json.write( id );
json.write( count );

But in the screenshot, it seems that the count has reached -1 for some reason, which caused overflow and had it appear as 2^32-1 = 4294967295, which got saved, and then promptly failed to be loaded.
So the root of the issue is more likely somewhere inside reference tracking code.

from cataclysm-bn.

olanti-p avatar olanti-p commented on June 11, 2024

For archival purposes, here's the save file from the issue:
Cridersville.zip

And the problematic snippet:

  "safe_references": { "items": [ 11602, 4294967295 ] },

Another save file from same user:
Boulder.zip

Different values this time - this doesn't even look like integer overflow, maybe memory corruption?

  "safe_references": { "items": [ 18446744073709551615, 2636248448, 11322597028362325620, 2636247792, 98784247841, 50559 ] },

As a note, those numbers don't repeat anywhere else in the save folder.

from cataclysm-bn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.