ID:1271439
 
BYOND Version:498
Operating System:Windows 7 Home Premium 64-bit
Web Browser:Firefox 20.0
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:

When using the 'as icon' input() type it seems to return 'null' with about 90% of the icon files I've tried. Seems to be fine in version 497 and previous. Certain icons and images work properly, but most do not, even with verified valid icon data.

Numbered Steps to Reproduce Problem:

1) Create a project with a simple 'changeicon' command that uses 'as icon' for input, with a check for null data.

2) Run the project and attempt to load an icon using the command.

3) Observe as most icons cause the input() to return null.

Code Snippet (if applicable) to Reproduce Problem:
I've provided an example project at http://ncomproductions.com/iconbug.zip -- it includes an icon that I've been able to get to return null consistently.

Expected Results:

The icon to load without returning null.

Actual Results:

No data is loaded and input() returns null.

Does the problem occur:
Every time? Or how often? Every time.
In other games? Yes.
In other user accounts? Yes.
On other computers? Yes.

When does the problem NOT occur?
When using older BYOND versions and seemingly random icons that work with the current.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)

Seems to work fine in everything before 498 in my tests.

Workarounds:
None known.
I can't confirm this.

I made my own code and none of my icons are returning null and I downloaded your file and the icons are not returning null, instead I am getting the output "[icon] uploaded." where [icon] is the actual image of the icon.

I tested this multiple times just in case it was a one off thing but I can't seem to reproduce the problem.

I am using BYOND version 498.1163 and Windows 7 Ultimate 64 bit.
Please try again using the latest beta, I may have been testing with it and not 498 -- gets a bit tricky when you're running the beta along side the live version.
I tested in the latest beta and it worked for me as well.
After clearing my cache several times this bug seems to have vanished. I have a feeling it was failing to put the icon into the cache for some reason and therefore failing outright to upload. Perhaps running into some kind of size limit on the cache?
I tested in 499.1186 and it still worked for me. So maybe it is a cache problem.
Bringing this back up. I've run into this again and realized that 'as icon' and similar upload-type functions will silently fail if the cache is "full" or the process of caching the file fails. This results in the prompt returning null without any indication why.

Shouldn't it be pushing old cache files out to make space for new ones, and if not, shouldn't the failure provide some kind of message to the client why?
I'm fairly sure I've experienced this bug as well. At random when I attempt to change my icon to any icon at runtime, it just... silently fails and doesn't change it. The only real workaround I've found is to modify the icon you're trying to change to in some way (but even then it still doesn't work half the time).
The server really has no concept of an unused cache file. We don't refcount them. The process of caching the file shouldn't fail for any reason though unless the upload is canceled or maybe if the file was corrupted.

Are you saying this happens when uploading a file that's already in the cache, though? Seems like those cases should always return the existing icon.
It's when uploading a new icon that hasn't been cached before. The process will fail and return null until the cache is cleared, at which point the file works as expected.

Files that were cached previous to the issue seem to load up fine as well. I probably should have kept a copy of my cache before I wiped it out but I was in the middle of a project and wasn't really thinking about it. If it starts happening again I'll make a backup of my cache folder.

But yeah, the process will succeed after a cache wipe, using the same exact steps as when it fails beforehand, same file, same verb, same environment, etc.