The fun of a dumb implementation

Matts on 2006-07-07T14:04:55

Last night I was helping pudge fix his Mac::* modules to work on OSX/Intel. One of the tests he got me to do was to create a calendar entry next week and switch focus to iCal.

Only the bug was in endian conversion of a number, so instead of getting a date (as epoch seconds) next week, we got one back as epoch seconds in about 10,000 years from now.

iCal kindly obliged, only it did so dumbly - seemingly creating memory space for all the dates from now until 10,000 years in the future. Used up all my ram. Crashed iCal, knocked me off the net, had to restart Mail.app and Safari too to recover some memory.

What fun. (I see the bug is now fixed and on CPAN).


wow

da on 2006-07-07T16:47:57

that's quite the crash.

Wait, does that mean there's a DoS attack built into iCal, if you import somebody's badly formatted .ics file? (I say this with minimal knowlege, not having used ical much).

Re:wow

Matts on 2006-07-07T16:57:20

Probably.

Re:wow

pudge on 2006-07-08T16:56:51

Maybe, I don't know. I did some more testing on this (trying to put a little-endian date into my big-endian iCal), and I observed the same behavior, except it was a bit inconsistent in how it failed.

However, I was wrong about it being tens of thousands of years. It was probably more like tens of billions. With a b. What I was misremembering is that the new 64-bit time can go to about 500 billion years, but the OS is at present designed to go out to only 30,000.

groan

fishbot on 2006-07-11T12:30:00

Sounds like you fixed the bug, so at least the story has a happy endian.