1. October 13, 2009

      Safari Crashes, PubSubAgent has issues, everything dies, oh my!

      Ever had one of those days, where everything just seems to be going wrong? Over the last 6 hours, I’ve been trying to debug why Safari, Mail.app, iTunes and Adium crash without ANY explanation, after any of said applications tried to load a webpage.

      It started randomly (haven’t made major changes in the last few days), so I assumed it was something corrupted. The only hint was that after Safari, Mail, iTunes or Adium crashed, PubSubAgent would use 100% CPU time. So, I fire up Instruments and look at the trace for PubSubAgent. It seems to be calling CFHTTPCookieStorageFlushCookieStores many times, which is odd, because a quick Google doesn’t return anything useful about this system call, obviously related to CFHTTP.

      Fast forward 4 hours later when I’ve cleared caches, nuked my Safari config, tried removing PubSubAgent (which just made it worse). The fix? Removing ~/Library/Cookies/Cookies.plist. Oddly enough, it has a companion – ~/Library/Cookies/Cookies.plist – corrupt.

      So, just a recap; somewhere the system knew my Cookies file was corrupted. But instead of spitting this out to the Console, throwing a Dialog, or ANY form of useful information, I had to trudge through my Library looking for something which could be causing the problem, and manually removing it. It was by chance that I noticed the Cookies folder, which is strangely not in the Safari folder where one would normally expect it.

      And just to make matters worse; Safari’s “Reset Safari” did nothing to solve the problem. That’s right, checking the “Remove all cookies” checkbox did NOT remove the cookies!

      Good user interaction FTW!

    2. September 19, 2009

      Snow Leopard: Outdated-software-R-us!

      I apologize in advance for the lack of coherency in this post; it’s late, and I’m tired.

      So, I have a custom backup script (mostly because I know I can do it better for my workflow than some off the shelf solution). It uses tar’s listed-incremental function to do, as you can guess, incremental backups over a monthly cycle. It’s been working well since I made it on Tiger, except today, the first time I’ve tried to take a backup since upgrading to Snow Leopard. It straight off failed, claiming it doesn’t understand listed-incrementals.

      I’m scratching my head as to why (it’s really not a complex script), before I realise it’s using an older version of tar than what shipped with Tiger and Leopard (or it’s using BSD tar as opposed to GNU tar… but I can’t verify what Tiger/Leopard had, all I know is it worked previously). Hmmm… ok. So I open Macports, install the latest version of gnutar, removed the crappy Snow Leopard tar and all keps going happily… except I now have a wiggling suspicion in the back of my mind that there is another disturbance in the force…

      I dig a little, and it’s not long before I discover that Apple also decided to ship bzip2 1.0.4, which has a security exploit that was fixed 1 year 6 months before 10.6 was released…

      WTF Apple? Is anyone paying attention to software releases over there? It makes me wonder, what other outdated, exploitable software is installed on my laptop?

    3. August 30, 2009

      iPhone 3GS WiFi Speed Issues

      So, since buying my iPhone 3GS, it’s been plauged with speed issues over WiFi. Not the awesome Lightwire service on campus, but my home, with my Cisco Aironet 123AG access point, the last place in the world I expect to have problems.

      For those lucky enough not to experience slack WiFi, the problem is that is some applications are completely unusable. Using the http://i.dslr.net/tinyspeedtest.html website, my iPhone (on good days) gets ~4000ms pings and I~50kbps. But there should be no reason for this; The speedtest.net app works fine, showing speeds of ~14Mbps… Curious…

      So, I did some packet captures (the capture point being on wired ethernet, directly after the AP); the iPhone takes seconds to ACK the TCP packets when running Mail or Safari (didn’t bother testing any other applications).

      My logic may be failed, but if I run the test and get 256ms and 3500kbps on my MacBook, there should be no reason why this isn’t possible on my iPhone. My MacBook uses .11a, while the iPhone 3GS seems to only use .11b/g (which is very odd, because the chipset is there to support 802.11a), so each device isn’t sharing radio space with the other.

      So I tried screwing with the settings, and the thing which had the most profound effect was the Beacon Interval. By changing it from 4000 Kusec to 40 Kusec, instantly I went from having ~4000ms pings to ~330ms pings, and a usable data rate of 864kbps! I then lowered it to the absolutely lowest time possible, 20 Kusec, and now have ~285ms pings and ~1500kbps to http://i.dslr.net/tinyspeedtest.html.

      This does, however, bring one very pressing question; Why does this only affect my 3GS? Beverley’s original iPhone worked fine before changing the settings, as well as our 2 laptops, and various visitor’s laptops. In fact, I used this and 4 other identical APs at the NZ WCG, providing internets to ~25 different laptops and PDAs of various descriptions, all roaming around the event, with the exact same configuration I started with, and not a single complaint. It obviously can’t be the fault of the AP… can it?