WWDC 2009

June 18th, 2009

Contrarily to WOWODC, I didn’t like WWDC at all this year. Some reasons for that were:

  • The IT track (the one that is of most interest for me) was very poor on this WWDC edition. There were a few talks about OS X Server and some of it’s new technologies, and that was it.
  • There was one (yes, one) talk about Java. This is ridiculous, specially if you consider that, a few years ago, Apple was selling the Mac as the best platform for developing and deploying Java applications. The first time I was at WWDC, 2006, there were a few Java sessions with interesting content. Don’t get me wrong, I love Cocoa, but some people need decent Java support to work.
  • No WebObjects content at all. The only official note about WebObjects was an announcement of an announcement that should happen within weeks. I don’t have any more details (and if I had, they would be under NDA, of course). This is sort of understandable, as they focused their attention on WOWODC, but it makes WWDC kind of pointless for people working on WebObjects projects in full time.
  • They somehow managed to serve even worse food than last year. Those guys must have some special talent, I thought it could not get worse than last years, buy they crossed that barrier at full speed. Also, there was no food on monday of tuesday evening, making it a little hard to eat and get back to watch the Apple Design Awards ceremony on time.
  • There were attendees distributing flyers and merchandising material inside the Moscone, despite the fact that doing that is clearly against the conference rules. Many people that attend WWDC work for some company, but a large part of the attendees own their own business, and everyone would love to promote it. But this is not a consumer exhibition, it’s a developer conference, with well defined rules, and people must respect them. What pissed me even more was the fact that the same flyers were distributed every day, by the same people, and no one from security kicked those guys out. It kinda looked like Portugal, where people break the laws with no apparent consequences.
  • Moscone center was at the limit of it’s capacity, and that showed. Although they could arrange the room sizes and session schedule way better than last year (I could attend all the sessions I wanted, which didn’t happen last year due to some of the rooms being full), there were not enough seats (either on the round tables, or the sofas) on the halls. On the first days it was really hard to find a place to rest for a while, or to write some lines of code.

I think Apple should seriously consider moving to a larger space, or breaking the WWDC in two separate conferences. Maybe one for newbies and another one for advanced users, or one for iPhone OS and another one for Mac and IT. I believe the WWDC is becoming less interesting every year, and the numbers back me up.

Apple claims that 60% of the attendees at WWDC 09 were first timers. Given that they sold out in 2008 and 09, and the Moscone capacity was the same on both events (around 5200 attendees), clearly a lot of people that came to 08 didn’t find it very interesting to come back this year. The fact that they sold out is based on the iPhone SDK hype, but people seem to be not coming back on the next year. I know I won’t, unless something deeply changes about WWDC.

I could not finish, of course, without congratulating João Pavão and the Sofa team for their well-deserved Apple Design Award on Versions, their SVN client. Really good job, guys! :)

WWDC 2009 (Keynote)

June 17th, 2009

I found most of the keynote announcements interesting.

The hardware upgrades on the MacBook Pros were cool. First, Apple seemed to acknowledge that the difference between the unibody MacBook and the MacBook Pro was not strong enough, so the MacBook is dead, long live MacBook Pro. This means the 13 inch laptop has now some of the Pro features, namely Firewire was brought back, in it’s 800 Mbps version. Other nice stuff, like the non-removable high capacity battery and the back-lighted keyboard made their way to the MacBook Pro 13”. The usual CPU speed bumps were there, of course. The only decision that left people a bit confused was the introduction of the SD-card reader. Not only it seems useless (because you may plug any SD-card enabled device to your Mac using USB) but because it kicked out some old features on the Macs that got it. The Express card slot went away on the MacBook 15”, and the Audio in port on the MacBook (now Pro) 13” was replaced by an Audio in/out jack found on the iPhones. Although you can buy an Apple headset to plug there, there’s an obvious question not yet answered, how to record audio from the line in?

The MacBook Air also got some CPU upgrades, and very interesting price cuts. Finally they are not ridiculously overcharging (at least, not as much as they did) the MacBook Air form factor, despite the fact that the machine specs were disappointing. I think they should ship them with 4 GB of RAM instead of 2 (specially because it’s not upgradable), but despite that it’s becoming a really interesting machine to buy if you travel a lot. The only feature I miss (and I was hoping to find it on this new machines) is a 3G modem, which would avoid carrying one more USB dongle. But they may be because of…

… the iPhone. Apple surprised me with the new iPhone 3GS and the 3.0 version of the OS. Despite the ugly name, the 3GS is a really nice improvement to the old model, and the differences are in the details. Among all, we have:

  • (3GS only) Hardware encryption of all your data. That’s really cool on a device that can easily be lost or stolen. This helps keeping your data private, but it’s not all.
  • Find my iPhone. Every mobile phone user went trough this at least once. You look for your iPhone, but it seems to be nowhere. If it’s somewhere around your house, you just grab the landline phone, call it, and follow the ringtone. But sometimes, no ringtone will sound, and that’s the time you start panicking. Did you left it in the car? Or maybe in a restaurant? Or, worse, someone stole it without you even noticing? Now, if you subscribe MobileMe, you can simply access the service, and ask for the current localization of the phone. If it’s turned on, the iPhone will report it’s current position (based on the usual localization facilites, like GPS or WiFi triangulation) that will be presented on a map. But there’s more: you may ask the phone to make some noise, and display a message with your landline phone number and address, and with luck, someone will pick it up and return it to you, or deliver it to a local police station. There’s the nice detail that the phone will make noise even if it’s set to silent. But, even better, if your phone is lost forever, you can still keep your data private. Just beam it an order to wipe all the data on it, and the phone will start erasing your stuff. If it’s encrypted, the wipe is immediate. Later, if you get back your iphone, just plug it to your Mac, and the content will be restored from your backups (which can also be encrypted, for extra protection).
  • Tethering. This one is big, at least for me. iPhone will share it’s 3G connection either trough the USB cable or Bluetooth. This is awesome, allowing you to pay only one 3G subscription instead of two (one for the phone, and one for the laptop). Also, no more crappy 3G modems with questionable quality drivers.

There are also some nice details, like the faster CPU on the 3GS, MMS support, better camera, etc. The iPhone is becoming more and more interesting, and I may find myself finally getting one, if the portuguese operators manage to sell them for decent (or not very indecent) prices.

FireFox 3: the evaluation order bug is back

April 19th, 2009

A few months ago, I wrote about a Javascript evaluation order bug I hit on Firefox 3. I managed to create a workaround and everything was going fine. I assumed the bug had been fixed on the subsequent minor releases of Firefox.

Some time ago, that same page started to be the target of some bug reports stating that users would occasionally get a blank page when accessing it, and the only way to get the page back was to hit reload. This was happening on Firefox 3.0.7 and newer.

As I wrote on the previous post, our page does an RPC call while loading the header scripts, like this:

<script src="/some/path/prototype.js"></script>
<script src="/some/path/effects.js"></script>
<script src="/some/path/wonder.js"></script>
<script src="/some/path/english.js"></script>
<script src="/some/path/combo.js"></script>
<script src="/some/path/feedback.js"></script>
<script src="/some/path/jsonrpc.js"></script>
<script type="text/javascript">
var jason = new JSONRpcClient("proxyUrl");
</script>
<script src="/some/path/comboboxes.js"></script>
...

After poking around with Firebug, I discovered that all the code below the call was being ignored by the Firefox parser. That would naturally result in an empty body, which lead to a blank page.

I started googling around, and I found two interesting Firefox bug reports, 444322 and 478277.

The first of those bugs mentions the original Javascript evaluating order issue I wrote about before (which was not, in fact, a JavaScript evaluating order, but an issue where the parser would not wait for the result of the RPC call to continue parsing). They also mention the Firefox team released a “fix” for it in 3.0.6, but people kept reporting the issue was not yet fixed (some claimed it in fact got worse), which lead to opening the second bug report. Also, an important fact about this bug is that it seems to happen only when all the page resources are already cached locally by the browser. This includes all the resources loaded in the page header (usually, JavaScript and CSS files).

A few interesting comments (#30 and #34) clarify what’s causing this, and mentions this is a piece of “fragile code”. I don’t know enough about the Firefox code base (which is a nice way to say I know nothing at all) to be sure about this, but I believe the “fix” caused an even bigger problem, where, in some conditions, the parser will enter a state where it will simply eat all the input without parsing it. This leads to the blank page problem.

Well, this is all very interesting, but I had a problem that needed to be solved. So, I hacked. On of the things that avoid this bug to be triggered is at least one of the page resources to not exist on the local cache when the page is loaded. So, I forced this situation to happen. I picked up a small JS file that is loaded before the Ajax call, and configured Apache to add all the necessary headers for browsers to not cache it. This is done with something like this:

<Files "somefile.js">
	Header set Cache-Control: "private, pre-check=0,
post-check=0, max-age=0"
	Header set Expires: 0
	Header set Pragma: no-cache
</Files>

This will prevent browsers from caching the file. Remember to to this on a small file, or you’ll be wasting bandwidth and causing the page load time to increase.

Now if only someone would really fix that bug… :)

WebObjects, SSL, Apache 2.2, FreeBSD problems

February 15th, 2009

I still didn’t have time to investigate this deeply, but here goes anyway, as I didn’t find the answer to this anywhere.

I had the problem described in the Apache 2.2 adaptor: SSL fails on FreeBSD amd64 thread in the WebObjects-Deploy mailing list. As the thread suggests, the problem is not related to 64 bits at all, but with a problem related to the SSL client certificate becoming corrupted somewhere between an SSL request entering apache and leaving to the selected WebObjects application instance.

The thread suggests a little hack in the Wonder’s Adaptor code to ignore the SSL client certificate stuff, but I found that to be a little too dirty. So I dug this as much as time allowed.

I found the adaptor will forward all the SSL http headers it has to the application. This allows the application to analyse the SSL information (like the certificates themselves, the certificate information, etc) if, for some reason, that’s needed. However, the SSL client certificate information is becoming corrupted, and screws up the request, making it invalid. As the application will not reply to what it believes to be an invalid http request, the adaptor thinks the application is non-responsive, and considers it invalid for some minutes. That’s why the user starts to get the infamous “No instance available” message.

I still don’t know if this is an Apache, mod_ssl, WO Adaptor or whatever bug. But I know how to work around it, avoiding this error. As the problem is related to providing the SSL information to the adaptor, I chose to simply block it. This can be done in the Apache configuration. Just add this to the right context (usually the SSL virtual host configuration block):


SSLOptions -FakeBasicAuth -ExportCertData -StrictRequire -StdEnvVars

This will hide all the SSL information from the adaptor, avoiding the error. I’ll try to dig this a little more if I have some free time and update this post.

Apple 2009 wish list

January 2nd, 2009

It’s a brand new year. So here’s my wish list for Apple:

  • Please fix the wireless driver that causes my Mac to crash about 10% of the times I turn Airport off.
  • Please fix the trackpad driver, or whatever is causing the trackpad to behave strongly erratic during about 30 seconds after waking the Mac up.
  • Please fix the damn copy/paste bug that makes the paste command paste the previously copied object and not the most recent one. This is specially irritating when you cut a piece of text, paste and you realize you are pasting something else, and that your supposedly cut piece of text is lost forever, unless you can undo and get it back.
  • Please fix the irritating bug that causes an iChat window to keep being the active one even after I click Safari, making its window go in front of iChat’s. That’s specially annoying when I type apple-W to close the Safari window, and the ichat one goes away.
  • Please provide replacement keyboards for people who has pre-unibody MacBook Pros that, you know, actually sense a keystroke every time the key goes all the way down, without the need to almost punch the key.
  • Please fix whatever is causing my father’s MacBook Pro to keep waking up and going back to sleep when the lid is closed and the charger on, despite I had already turned off every god damn thing that could wake it up, including the lid open event.
  • Speaking about the charger, please provide chargers where the charge light doesn’t go off for some unknown reason. It still works, but it doesn’t inspire a lot of confidence in it ans it’s safety.
  • Please provide granular updates to Mac OS X Server. Please please please pretty please.
  • Please care a little more about the entreprise and IT markets, namely your own web application technology (WebObjects, of course).

Thank you, guys! You must hate me but you’re nice people anyway. Sometimes.

Stardom SOHORAID review

December 13th, 2008

Backups are vital for keeping your data safe, but keeping them in the same physical place as the backed up data has some drawbacks. If your house or office catches fire, or some natural disaster occur, you loose all your data anyway. If the place is robbed, there’s a high probability that the burglars take all the hardware they can find, backup disks included (and it happens to many people, unfortunately, including some indie mac developers).

Facing that, and having the possibility of easily keeping a backup media offsite, I started looking for a solution. My requirements were simple: it had to be fully automatic and give me zero work, besides the obviously needed physical transportation. As I already had a backup system in place (using Retrospect and a backup disk) it was easy to conclude that a nice solution would be a RAID system with swappable drives. This way I could have two mirrored drives online, and a third one offsite. Every time I switch drives, it’s just a matter of taking out one of the drives and later inserting the one that was kept away. The RAID system will rebuild the mirror and, most important, I would have to do nothing!

After searching for a while, I was recommended the Startdom SOHORAID line of products. Don’t be fooled by the crappy site, because, as we are about to see, the product actually surprised me for it’s quality.

There are two models, the SR3610 and the SR3620. The SR3610 is actually the best one, including an LCD display for easy configuration and system monitoring. The SR3620 only has one option, USB2 + external SATA interface, while the SR3610 comes in two options, USB2 + external SATA or USB2 + Firewire 800

As the machine that is driving the system is a PowerMac G5, my first idea was to buy the firewire 800 model. But I ended up getting the USB + eSATA SR3610 option due to a mix of reasons. The first one, the price. The Firewire 800 model was much more expensive (about 70 euros). Also, facing the fact that Apple is moving away from Firewire and that the reliability of firewire controllers is not that great, I ended up opting for the USB + eSATA model. This model has an additional fan to help keeping the system cooler.

I decided that, as the RAID would be only used for backups, USB would be enough. But the Stardom came with an eSATA to SATA bracket that allowed me to turn an internal SATA port in an external one. As I would not need the internal backup disk any more, I got a free SATA port on the G5 and used this bracket to plug the RAID directly to the SATA interface. It was a nice way of adding an eSATA port to the Mac without having to buy a PCI eSATA card.

Stardom sells their RAIDs under OEM to many manufactures, including WiebeTech. As there’s already an extensive and incisive review of a WiebeTech SilverSATA II Dual Bay SATA Enclosure online (which is exactly the same product as Stardom’s) I won’t reinvent the wheel. Instead, I’ll add some points to Arthur’s great work:

Power supply

One thing that surprised me in the Stardom system was the quality of the power supply. As you can see in this Arthur’s photo, the power supply is not an external made-in-china low quality brick, but it’s built in the case itself. And those big capacitors are actually making great work there. Remember on the old Macs where you would turn off their switch, and they would take about half a second to actually power down? Well, here is the same thing. After cutting off the power, the system will still work for about the same time. This is great to avoid quick power cuts, and shows the power supply appears to be relatively immune to bad quality mains power.

Interface

The LCD panel + control buttons were actually a deception (the only one). First, the menu system is complicated and non-intuitive to use. A good example is the RAID mode, that can be switched between 0 and 1. When you get to the RAID mode menu, it will display one of the modes… that is actually the mode the system is not in. The idea is that, if you want the RAID mode to be that one, you press the ENT button. Well…

But there’s worse. The LCD display, during normal operation, displays the status of both drives. If you try to do anything else, including monitoring the system temperature of fan speed, the RAID operation will stop. The LCD will display a warning about this, and if you confirm, no disk activity will occur while you are on the menu system. This is pretty bad, because you won’t be able to constantly monitor the system health during operation.

Also, I have noticed that, sometimes during the internal controller initialization, after powering on or resetting, the LCD panel will display random characters. Despite being scary, it has no apparent side effects related to the data consistency and disk operation.

Finally, I also don’t get what the drive leds are supposed to mean. Each drive has an operation led on it. When writing data, the leds on both drives will light up. When reading, sometimes only the upper drive led lights up, and sometimes no led lights up at all. At first I thought the system was only reading from one drive, but according to the speed tests I made, both drives must be in usage, as a single disk cannot sustain the +70 MB/s I got (you can see more speed tests in Arthur’s review). So I suppose this is just a controller bug, again, without any visible harmfull effect on the data reliability or normal RAID operation.

Bottom line, this is something that Stardom needs to improve.

RAID reliability

As I intend to keep removing and inserting drives in this thing, I wanted to be sure how reliable the RAID system was. To test that, I created a RAID mirror using two disks, and copied some big video files to it. To test the consistency during the tests I describe next, I used the command line md5 tool to create a hash of the original file (on the G5′s internal drive) and the files in the RAID. As long as both hashes are the same, the files are not corrupt.

First, I did the obvious: removed a drive. A very loud “beep” started sounding from inside the box, and the status led turned yellow. I pressed the mute button to bring back the peace, and tested consistency. Everything OK. Then I inserted the drive I had just removed. The system started rebuilding the RAID. I did consistency checks during and after the RAID rebuilding process, and everything was OK.

But this is lame. The system did what is supposed to do. Big deal. Next test was a little more agressive. I removed a drive again, and reinserted it. The rebuilding operation started as expected. Then, at about 2% of the rebuilding process, I turned the system off, to simulate a power failure. As this is not exactly a high-end expensive RAID system, I expected a disaster. Well, much to my surprise, not only the system started rebuilding the RAID mirror immediately after being powered on again, as it actually knew where it was before being turned off, and resumed the process from there! Again, consistency checks were done during and after the process, and everything was fine. Thumbs up for the Stardom people!

Noise

This thing has two hard drives, a RAID controller and a power supply inside it, so it really needs to cool itself down. Cooling down means generally fans, and fans mean noise. On of the great things I felt when I upgraded from a PowerMac G4 to a G5 was how silent my office become. The PowerMac G5 has very high-quality fans that turn only as fast as needed, which means they turn very slowly and quietly most of the time. I was afraid the Stardom enclosure would bring the noise back.

To my surprise, it’s much more silent than I expected. Arthur told that in his review, and I do the same: you’ll hear mostly the air flow through the enclosure and not the fans themselves. Of course, it makes noise, and it’s clearly louder than the G5, but it’s not that bad. To get an idea of it, if you play some game on a MacBook Pro and bring its fans up to full speed, the MacBook Pro becomes much more noisier than the Stardom RAID.

Conclusion

The Stardom SOHORAID seems to be a great system, specially being cheaper than most concurrent products. It’s very reliable, and seems to be made out of quality components. It’s also fast (if used through the eSATA interface) and quiet. The only bad thing about it is the user interface, specially the fact that using it will halt the normal RAID operation.

Versions is out

November 23rd, 2008

Versions is finally out! :) João Pavão, together with the Sofa team, released their new Subversion client. It’s a really powerful application made by people who deeply understand how a Mac application should be. In a world full of dubious software, it’s good to see that some people still care a lot about their code quality and the detail. I feel honored for having been one of the few who saw this application being born and getting mature enough to be released in the wild. Congratulations, João! :)

Promise UltraTrak woes

November 7th, 2008

So, we have in your department a Promise UltraTrak SX8000 RAID system that we use for backups. This mother can drive 8 PATA hard drives in several RAID modes, and expose them through a SCSI interface. We currently have a RAID 5 array using 4 500 GB Hitachi hard drives and a fifth hard drive, similar to the other 4, to be used as hot swap if one of the other drives commits suicide during the night. This is plugged to a PowerMac G4 that has the boring task of carrying up all our backups while we are all sleeping like babies.

This is a pretty old product, and it was never tested with drives this big, but the fact is that it has been working flawlessly for months now (since we upgraded the original 120 GB drives). Until last week. As I had some empty bays and unused small drives, I thought about doing a second array to store some archive stuff, as the RAID 5 array is getting pretty full.

I remembered that the case controller reboots itself when the user creates a new array, so I opted for turning off the Mac and the Promise itself, and install the disks with everything shut down. You know, this thing has hot swap, but it’s getting old, and we don’t want to push it too far. So let’s play it safe. Big mistake. Big big mistake.

I pop in the drives, press the power switch. Controller boots itself up and, as Steve Jobs would say, boom! The first two drives had the red led of death glowing. I spent a quite dramatic few minutes looking at the damn thing, and thinking that it happened. The least likely, the most feared of all things that could happen on a RAID 5 system had just happened. Two drives failed. At the same time. All the backups, some of them more than one year old, lost. Forever.

I got rational again and thought, no, this can’t happen, this thing did not boot correctly, there is something with the drives I’ve just inserted that is screwing this up. I powered down the case, removed the drives I had just inserted, and powered on again, this time carefully watching all the lights and bells. The Promise RAID, when booting, scans all the bays to see what’s going on there. You can see that happening by watching the drive lights, all of them blink quickly in a slow sequence. Well, the first two weren’t blinking.

I thought, hum, bigger drives then expected, too much time to spin up, the controller is testing them too soon. I powered off the damn thing, removed the first two drives, and reinserted them on lower bays. Another big mistake. The array disappeared. It was lost forever. Looks like the drive position is crucial for the arrays to be recognized. I had just killed what was left of it.

After some moments of desolation, I went to recreate the array again, assuming that the backups were lost I had to start from the ground up. I started the process of creating the array, and then I saw the light. On the little LCD display, the controller had the best of the words I could see on it’s first line: INITIALIZE. It allowed me to choose Yes and No. I stopped for a while, and though, if the hard drives are OK, and if I can create an array without any kind of initialization… all my data will be there! Right?

Power off, insert the drives on the original positions, power on, create array, RAID 5, default block size, initialization OFF, gigabyte boundary on, and GO. The array was created. No activity on the drives whatsoever. Perfect. Reboot. I fired up the G4 and run to the KVM console. OS took ages to boot (actually it took as long as every other time, but the adrenaline was all around). The desktop appeared and… YES! There was the RAID volume, as if nothing had ever happened. I did some quick tests, but that was it. The RAID was back in all it’s glory. Months of backups, saved.

Knowing this, I decided to push my luck a little further and turn the RAID off again. After powering up, the history repeated, first two drives were “dead”. I simply destroyed the array, created a new one without initialization, and I was back in business. Then I turned it off and quickly on again, not allowing the drives to spin down to a full stop. That time, the controller booted up correctly and the array was online.

I went to Promise site to check on this issue, and I see they had released a new firmware that announced to support some newer drives. I installed it (and it was a terrible experience, it started by having to download an older firmware to get the updater software, as Promise forgot to pack the software together with the new firmware on the ZIP archive, and ended up with an old PC with a serial cable plugged to the RAID, two floppy disks – yes, two floppy disks, and yes, we are in late 2008 -, one with DOS, another with the software, and about 30 tries – power cycles on the Promise RAID and software reloads on the PC – to get the serial communication working). After that, I powered off the RAID, waited for complete spin down, powered up again, and everything worked fine. Although I’m not trusting it fully, it looks like the problem might be solved.

So, lessons to learn: if this happens to you, 1) Do not panic (yet); 2) Do not change the order of the drives; 3) Use the LCD display and the buttons to obtain all the settings of the array (block size, gigabyte boundary status, etc); 4) Delete the array; 5) Create a new array with the same settings and initialization off. You should be off the hook by now, unless the problem WAS in fact two drives dying at the same time. Which, you know, doesn’t happen. It just can’t. Really.