ID:102898
 
Resolved
A corrupted temporary resource file could result in newly created files added to the cache having a bigger size than they should. The .dyn.rsc file will now be deleted when it detects corruption.
BYOND Version:477
Operating System:Windows 7 Ultimate
Web Browser:N/A
Applies to:Dream Daemon
Status: Resolved (478)

This issue has been resolved.
Demo: http://www.byond.com/members/tenkuu/files/src/ test%20proj.zip

The dynamic rsc file included with the demo is critical in getting this issue to occur. It's roughly 7 megs, from another project, but it can cause the issue to occur with the tiny demo I put together. I thought that the dynamic rsc was supposed to be cleared each time a game was run and closed, but it doesn't seem to have happened for me which has caused it to swell up to the current size.

To the issue at hand, just run the one verb I've put together and the game should prompt you to save one icon that's also 7 megs, but really it should be saving nothing. This also causes a buggy.rsc to be created alongside the rest of the demo files.

I ran the same code without a dynamic rsc and it doesn't prompt me to save a file as I would expect.

I would also like to mention that providing a default icon for initialization also produces an icon with a size that is also around 7 megs.
The .dyn.rsc file isn't necessarily deleted or emptied normally. It is not deleted when the program is closed, unless it was created just to be a temporary file and cache_lifespan is set to 0. The next time the server is opened, it checks the files inside and does some pruning according to the value of cache_lifespan, but it also removes files that don't have names (like dynamic icons), so basically only user uploads are kept.

In the case of this bug it was detecting the corrupted cache and outputting buggy.rsc, but then it left the cache intact instead of deleting it to start over. This confused the code responsible for writing dynamic icons to the cache.