DFHack / dfhack

Memory hacking library for Dwarf Fortress and a set of tools that use it
Other
1.84k stars 461 forks source link

stockpiles fails to serialize furniture stockpiles #1013

Closed lethosor closed 3 years ago

lethosor commented 7 years ago

After ec222c0 (#964), trying to save the furniture stockpile in this fort results in the following error:

serialization failed: protobuf exception: CHECK failed: !coded_out.HadError(): 

This occurs on both 32 and 64-bit OS X.

cc @Ramblurr. I'll try to investigate this, but let me know if you have any ideas.

lethosor commented 7 years ago

Could be related to #779.

Edit: it seems unpredictable. Saving a stockpile with sheets in 0.43, then loading it in 0.43 works, but loading it in 0.42 does not (for example; there are other failures as well).

Ramblurr commented 6 years ago

Will look into this!

lethosor commented 3 years ago

Enabling the "furniture/siege ammo" category in 0.47.04-r2 (Linux) and attempting to save now gives a different error:

serialization failed: protobuf exception: CHECK failed: (bytes_produced_by_serialization) == (byte_size_before_serialization): Byte size calculation and serialization were inconsistent.  This may indicate a bug in protocol buffers or it may be caused by concurrent modification of the message.

The "sheets" category appears to be ignored entirely (per #779)

lethosor commented 3 years ago

Commenting out this line appears to fix the issue: https://github.com/DFHack/dfhack/blob/0.47.04-r2/plugins/stockpiles/StockpileSerializer.cpp#L831 SAND_BAG is in furniture_type now, so this check may not be necessary. Changing the sand_bags field doesn't appear to change the stockpile settings, and setting MALLOCPERTURB indicates that it's uninitialized, so maybe it just isn't used anymore.

Ramblurr commented 3 years ago

Thanks @lethosor !