The Safari Image of Doom

It's Friday, which means it's report Report-an-Apple-Bug Friday. Dan Wood started this a few weeks ago, and it seems to be catching some traction around the web. This is a very cool idea, and it'll let me throw out something I'll be referring back to over some upcoming posts.

Now, before you click and view the following image, if you happen to be using Apple's Safari or possibly OmniWeb, you may want to commit www.drunkenblog.com to memory, as there's a very high likelihood your browser is about to crash...

»» Safari Image of Doom ««

When Safari tries to load the image, or any application based on WebCore or WebKit tries to load it, it seems to create a race condition in one log and/or a deadlock in another, which ends in a crash pretty quickly. Don't be too mislead by that, as my log reading skills are dull to say the least.

Sometimes it takes a reload to do it, but it's highly likely to go wonky. The image itself is just a simple animated .GIF file that was used as an advertisement on a site. While there is obviously something abnormal about it it isn't immediately obvious to me what's wrong with it.

It displays correctly in Internet Explorer and Mozilla-based browsers, but something is causing it to choke webkit. Even worse, its causing webkit to crash. An image should never cause Safari, or WebKit, to do this.

This may not seem like that big of a deal, however if I'd displayed this as a normal image and you'd come to view the site, your browser would have crashed while loading it. If that animated .gif was served as an advertisement you had set as your home page, Safari would crash every time you launched it with you not having a clue what was going on except that every time you tried to launch Safari it would crash.

Since it seems to affect anything based on WebKit, it could be emailed to you -- or an image with something similarly funky going on -- and if you had images turned Mail.app would crash. Since Mail.app defaults to reselecting the last message you were viewing when it opens, you could well be in for some fun whenever you tried to relaunch it.

Someone malicious could take this image, link to it as their avatar in a forum somewhere, and if there were lot of Safari users there would be a ton of crashing going on untill someone figured it out. Unless it had a ton of Mac people visiting, it probably wouldn't get figured out at all, but rather those Mac users would just get a crash clicking around the web and probably blame the site or their newsreader and never put it together.

As mentioned, the image itself may well be to blame -- there could be something off or corrupted about it -- but even if the image is wonky that's no excuse for Safari to go into a spiral.

Quality applications have checks and balances on what is fed to them, precisely so they don't go HAL9000 when they're fed something they didn't expect. Now that WebKit is being incorporated so pervasively into third party applications, it's Game On. It's not so much about The Safari Image of Doom™ specifically, but rather that a bug like this shouldn't exist.

By building a browser engine into the OS, Apple took on a responsibility to make sure its quality, as WebCore's fragility directly -- and adversely -- affects the robustness of everything built on top of it.

Update: Some in the comments are saying this isn't crashing for them in Safari, up until now I'd pinged 7 people who all had crashes. I added 7 more pings this morning, and 5 out of the 7 had the crash. I can duplicate it with Safari and several WebKit apps, but OmniWeb 5.1.1 did load it correctly.

Update 2: Adam Iser of AdiumX noted he can reproduce the crash, but not if the image is first saved to a local drive and then loaded directly into Safari. Same for me.

Update 3: That was fast. From Eric Peyton @ Apple: "Saw your crasher today. Filed it as radar 4233417: 'Image crashes IOImage code' with Apple. You won't be able to see it, but it will hopefully get addressed."

yummy alcohol posted button Posted by drunkenbatman
    August 26, 2005, at 09:08 AM


Comments (121)




Post a comment



Anonymous comments are allowed, but please enter something for a name.

And do endeavor to appear sane.









Remember personal info?