The Downward Spiral

In a previous post, I mentioned I had to finish the last chat on another platform, because of a bunch of wonky bugs I was having to deal with in Mac OS 10.4, many of them involving text. Some of you screamed for details, so we'll go through the evening which led me to sit down and write A Community of Quality.

I've been running 10.4 with a clean install (several times), and nothing that could be blamed for the problems, like APE or even mouse drivers. I've said this several times, but some just keep coming back to it. Bugs don't work that way, and its not something I've added.
At this point, it's not just that interview, or the ones I'm working on right now. If I didn't have access to a Linux or Windows machine right now, it would be difficult for me to do much for the site, let alone my other stuff.

Today we'll follow the downward spiral that made me give up and finish it on another computer -- the whole deal -- warts and caveats and all. Now, I'm well aware my experience isn't everyone's experience, but I'm also well aware that what led to my issue is real, as the movies and such will show.

1-2-3-4, Get your glyphs on the floor

If you've read the site for awhile, you can probably guess that I go through keyboards like a Hilton goes through contraceptives; my words per minute bounces around depending on the amount of coffee in my system, but it's up there. Even when it's not my text, I'm often having to work with quite a bit, because the interviews I do are known for being chewable, and have a decent amount of formatting and markup.

I'm not going to spend any time on this, but if you're curious about the gist, there is an old Daring Fireball interview with Maarten Hekkelman which has good passages relating to this.
This can be a problem for Mac OS X, because um, text is slow in Mac OS X. I'm not bashing it for this, because it's slow for a reason -- a lot takes place to get every glyph onto the screen. People can get confused here about where the slowdowns are, but lets just say it isn't because the text is anti-aliased.

I'm sure a lot of it has to do with the fact that a lot of Carbon apps were originally using older APIs and didn't get the pretty text for free, and hey WindowsXP has actually had better text quality than Mac OS X. The differences are more about how the text gets laid out onto the screen before its brushed smooth, as the text system in Mac OS X gives developers a ton of things for free that you don't have on other platforms, and the algorithms to make it all smooth are just a bonus.

Still, any way you slice it, the standard Cocoa NSTextView is not optimized for working with a large set of text, let alone editing it. This is a known thing, and its why the guys over at TextMate are doing some of what they're doing, and anyone making a Cocoa text editor has to deal with it. Carbon apps weren't any better, and were generally worse.

I remember estimating I could type 3-4 times faster than the first native versions of Golive or Dreamweaver could keep up with), but this was less a construct of the technology as much as optimization, as Bare Bones's BBEdit is Carbon, yet is hands down the fastest text editor on the market for the Mac.

1-2-3-4, Get your glyphs out the door

Like I said, I'm not bashing OS X for its drawing speed, but it has had a direct and adverse effect on the things I do, as when you are trying to add links and formatting to say, 10-20,000+ words, it can get really annoying to be hanging out waiting for your what you typed to show up or for what you're displacing to re-wrap.

When it came to 10.4, I was eagerly awaiting the improvements to some of the internals, like the easing of kernel congestion and the improvements in drawing speed. Out of everything else that was in it, it's easily what I was looking forward to the most because it would have the most dramatic effect on everything I do across the board.

Quartz 2D Extreme (Gag) had been shown to developers as coming in 10.4, which would move the drawing off to the GPU, meaning drawing text to the screen would not only be faster, but CPU cycles would be freed up for other things. When you have 7,000 mail messages in a folder you're trying to scroll in a table, you care about this sort of thing, because the system has to draw every subject/to/date line before it can display it, then scroll it. I was pumped, because this would make my system much more usable, as performance is one of the more important factors in usability.

Apple ended up shipping Tiger with Quartz 2D Extreme (Gag) turned off, because it just wasn't ready for prime time (buggy) and because a lot of current apps will need some tooling for it to be a win, but I was still pumped because I knew Apple had been pouring a ton of work into this area of Quartz. Q2DE notwithstanding we were still in for some major drawing improvements, even if it was still being done on the CPU, as well as things like the System being smart about what it needs to redraw.

With Teeth

After installing 10.4, I wasn't disappointed, as while it may not be OS9 speeds, and not fast enough so that I never notice the computer not keeping up, but drawing was improved dramatically for me while typing in Cocoa apps.

Text was faster in every single app I used, and it was glorious.

Like I said, unless you're trying to edit some typos or some formatting in a 10,000+ word post within MarsEdit or Ecto, or trying to open a huge chunk of source in Xcode, you may not care so much about this, but it was an absolute godsend to me and easily my favorite thing about 10.4.

Unfortunately, I started noticing a problem: Text in Tiger has a tendency to go wonky for me, which was disturbing because fundamentals like text are like foundations: If they have problems, you need to be worried about the stuff above them. As an example of this wonkiness, we'll look at top in the Terminal.app of Mac OS X.

Whenever I launch terminal, it comes up with my standard sized window I've set it at, and when I run top it'll look like this:

os x terminal

It looks just as you'd expect it to look, but if I want to see more, I'll hit the green 'Maximize' button, and things immediately go wonky:

terminal bug

If I hit the green thingy to minimize it back to its original size, the text stays just as wonky:

still wonky

Basically, it's all over the place. The only way to get the text to display correctly again is to kill top, clear the window and run it again. It may not seem like that big of a deal, but I'm often running top on different machines, or programs that display things in a similar way, and having to constantly stop and start throughout the day really slows me down.

Of course, this is just a tip of the downward spiral that made me not be able to get anything done on my Mac, and to further delve we need a quick bit of context for the rest of the situation.

Pretty Little Hate Machine

I'd scattered throughout my posts that my PowerBook's hard drive had started making that lovely intermittent clacking noise, which was its way of saying it was going to start eating my data sooner rather than later. After a really bad experience, I'm entirely paranoid about this noise now, so I'd been running off a Firewire hard drive for several days, which didn't stop the drive from clacking but let me know whatever I was working on at the time would be safe.

I'm mentioning this because my drive dying was a little exasperating, as it wasn't being worked that hard, and the computer was kept as cool as I could keep it (AC, fan blowing on it), and it came when a lot of other stuff was building up in my head. A lot of my friends have Macs, sometimes because they know I like Macs, which means they ask me lots of stuff when something goes wonky.

Whenever one has to be sent in, my brain keeps a little running tally in the back of it remembering what the model was and what broke, as while it's not scientific, when 5 out of the 6 people I know with an iBook need to have it sent in for gutting multiple times it lets me know there may be another problem with them. When you've just gotten gone talking to another friend whose iBook drive died 2 months after having it (and the logic board) replaced, and yours starts to die the next morning, it can wear on you.

The other thing you'll notice is the last interview was posted at 4 AM, which isn't unusual, and needs to be taken into account because it can certainly affect my mood and what I'm willing to deal with. In that case there was some time-sensitive stuff that was going to be disclosed, but it's generally the way DrunkenBlog stuff works: I'm fitting it in where I can, and sometimes that is late at night or very early in the morning, and in this case I needed to get it out ASAP.

So, I'd been working on that interview solid from 7pm till 4am, adding links and images and formatting and creating a little icon for the PDF book because it was special enough to deserve something special...

The Tiger Text Bug from Hell

I gave an example of one of the weird things I was seeing regarding text above, but there are more:

  1. If I have a body of text I'm editing, I'll do something to cause all the text below the insertion point (where I'm typing) to start overlapping itself. It doesn't go away, the display is just completely messed up. This can be caused by hitting return, pasting in text, cutting text, deleting text, or just typing and having the line wrap.

  2. Same as above, except I'll get doubled lines instead of everything below the insertion point going crazy.

(2) is much more common than the first, but in both cases the data itself is just fine, its just the display is completely screwed up. It can only be fixed by selecting the text in its entirety, forcing it to redraw, minimizing to the Dock.app and then bringing it back up, or paging up and paging down to where you were again...

Basically, imagine copying a URL to the clipboard, then pasting it into your document, and having the text go wonky. It may not seem like a big deal, but you've just pasted in the URL but don't really know what the text is afterwards, or if there is really a return, so you have to stop and refresh the display before you continue. This is the first time I've written one of these while counting, and its already happened 33 times up to this point in the document.

Now, because the explanation above can be hard to grok without seeing it, and because it happens so frequently to me, I just stopped and made a few movies with Snapz Pro the other day while I was working in MarsEdit.

Scroll down for the movies, but if you don't have QuickTime 7, .mp4 versions are available if you click the .zip. MPlayer and QT show them fine, but they're a little blurry in VLC for OS X, perhaps because of the non-standard dimensions I didn't bother to fix.



< EMBED SRC="/drunkenblog-archives/i/tigertext01.mov" WIDTH = 400 HEIGHT = 316 pluginspage="http://www.apple.com/quicktime/download">

Anyways, if you watch what I do below, and how the display changes, you'll see the problem, and it is only gets more annoying when I'm not just typing, but pasting things in and having to be careful about whitespace or formatting.



< EMBED SRC="/drunkenblog-archives/i/tigertext02.mov" WIDTH = 400 HEIGHT = 316 pluginspage="http://www.apple.com/quicktime/download">

The first thing your mind will go to is perhaps its a problem with the application, but it wasn't. I was using MarsEdit while I was doing this, but MarsEdit isn't the culprit. I've seen this in XCode, SubEthaEdit, etc. The common denominator seems to be Cocoa apps.

The next thing your will probably wonder is whether it is something wrong with my System -- an isolated bug due to my hardware -- and nope. Let me put it this way, it was Evan over at AdiumX who pointed me towards it not just being me, and some of the authors of the apps I've mentioned it over the last few days have seen it. A somewhat-common denominator seems to be Powerbooks, but it isn't that large of a sample pool, so who knows.

It's a real live bug, and a maddening one, and it's basically in Apple's court because there's little more that can be done from the outside. Normally when you hit a bug like this, you'll need to stop and create a 'proof', which is basically boiling down the problem into a test case so it can be reproduced.

That way, an engineer in a cubicle somewhere can reproduce it while watching what is going on, and then hopefully find the problem, and then hopefully fix it. This type of bug just doesn't work that way.

Oh the little we know

I know its frequency often increases the longer one has been editing, and the larger the amount of text is. I know Apple has been told about it, but it isn't as though developers who even report the bug can see what is going on with it, as their bug system gives very little information to anyone not actually inside Apple beyond whether it is closed or open.

I've tried to look into a little bit to have a better idea of what's going on, and basically just found more weirdness. I was able to find examples of:

  • A programmer is seeing eerily similar behavior in Tiger with his app involving scrollPoint within NSTextViews.

  • The developer of Ulysses had an extremely similar problem back in 2004, which he received an amusing amount of help on.

  • Someone else encountered something similar also, but he was able to solve part of the problem while working on his app, and it may have possibly involved sharing data between different TextViews, but he's seeing similar things with other Cocoa text apps like TextEdit.app (I.E., think of an app where you have your data in one window, then click preview, which loads and renders it via WebKit).

Normally when I'm this annoyed by something my impulse is to start digging, but I only spent a little bit of time looking into this that night. I'd been working on the chat in my free time for two days, and was going to be pulling an all-nighter, and needed to be working on that because there was a timing issue with getting it out.

Since this is showing up across so many apps, my gut says this is just weirdness introduced by the massive overhauls in Core Graphics Apple was trying to get into Tiger, much of which focused on the System being smarter about what was dirty on the screen and really needed to be updated. The fact that people were seeing this in 10.4 and reporting it back in March, and that Q2DE was pulled, didn't bode well for it being an easy problem to fix. I dutifully sent feedback to it awhile ago anyways, but never heard back from that black hole.

Now, obviously not everyone is seeing this, as if it was happening to someone who mattered it would have been by now, come hell or high water. All I know it's real, and I know a bunch who have seen it, and that something in the way I work triggers this bug like crazy. I was fed up for that night, and done working with text in any Cocoa app until I was pasting it into MarsEdit to post.

Further down the spiral

I've upgraded Microsoft Office 2004, which comes with Word, because I have a friend who works at Microsoft and can get stuff fairly cheap through their employee store. OfficeX did me fine, but $50 is as good a time to upgrade as any. I don't work a lot in it, but I have to have it to view some protected .doc's and Excel files I get in the way it came, as well as comments, etc.

I generally try to avoid typing up anything in Word that requires any formatting -- especially html -- but this bug had worn me down and I was willing to brave Word deciding everything I typed should be a bulleted list. Unfortunately, on launch I got this...

microsoft word

The above occurred right after it said it was trying to optimize the font menu, which (I believe) is where it combs through the fonts so it can cache previews for its WYSIWYG menu when you are selecting a font.

I was actually a little freaked at this point, because when my hard drive gave a few clacks the first thing I did was stop working, run DiskWarrior, then backup what I was working on and then booted from something safe. Still, you never know, perhaps something had gotten corrupted, and perhaps it was a font.

So I killed Word, and yanked the font, and then got...

microsoft word

I was really worried by this point. I swallowed my aversion to Cocoa text editors and fired up SubEthaEdit, then started to click 'Ok' several times while marking down the names of the fonts that might be screwed up. After clicking 'Ok' 20 times, I realized it was just going through the list alphabetically.

My best guess was that something wonky must have happened with one of Mac OS X's caches -- which do seem to trip over themselves every once in awhile -- and since I knew there was a font cache it was time to shut everything I was working on, go delete them, and reboot.

No dice, and at this point I was just being taunted. I could have stopped and rebooted from my alternate backup, and then deleted the fonts and copied fresh ones from my CD backup over, but I wasn't really interested. I didn't think it would work, and I had been spending way too much time on this stuff. We were reaching the wee hours of the morning and I had to have this chat out.

The Fragile

Of course, Word isn't the only Carbon text editor out there, so I fired up GoLive and pasted in the entirety of the chat, which promptly caused it to quit fast. I was actually impressed, as I'm unused to Golive being fast at anything. I wasn't going to even try with Dreamweaver. That still left Bare Bones, and their super-fast BBEdit.

BBEdit wasn't really an option in my head, because while I used to own an older version, and I love the software, I'll be damned if I'm going to pay $200 to be able to edit text properly. However, I'd played with their free TextWrangler and liked it, and if there ended up being some kind of weirdness with it, perhaps BBEdit had a demo on their site or something...

I'd been wrestling with the dreaded DNS/DHCP bugginess in Mac OS X in 10.4, but this was completely new. Normally I can try the address a few times and it'll get through, but this was saying there was no connection... I'd yet to see anything like the error message nor this diagnostic tool, but it was either click or beat my head on the desk.

This was so weird, it was basically saying it could see the router but couldn't get onto the internets, and I was so frustrated at this point that if my connection had actually gone down I'd have known $deity was trying to tell me this chat was not supposed to be.so I was off to check the router and make sure nothing had gone insane.

A quick jaunt to the room with the router showed that the connection should be up, but just to be sure I went to my lovely 533 MHz Linux box (Named Peep) and checked, and yes it was up, but for some reason the OS X machine wasn't able to see out. At this point I could have tried messing with the connection settings and such, but I was done.

Obviously the chat got out that morning, but it's because I copied everything I needed over to the PC and ended up editing it there and posted it online via the web interface. There could well have been other things I could have tried or done, but at this point I didn't even care anymore.

If someone had asked me right then if I was going to dump the Mac I'd probably have said probably wasn't going to be getting my PowerBook fixed anytime soon.

The Hand that Feeds

Since then, I dug into the network problem and found out its just my turn to fry, and my networking is just wonky. This could well be just my turn, because when all these people had problems with DNS and such in Panther, I got along swimmingly, because that's how bugs work.

When it comes to my Office 2004 font problems, I was able to find that I wasn't the only one experiencing this, and after a bunch more surfing was able to find a workaround that said booting into safe mode might work, and it did! For awhile, at least. Every week and a half or so I have to do it again, as the problem comes back.

When I have to edit or write text longer than a few paragraphs on Tiger, I now use TextWrangler, and then throw it into MarsEdit for posting to the site. I'm not even really blaming Apple for Office 2004's problems, but it sure didn't add to the evening.

Now, of course my experience isn't indicative of everyones, but it was mine, and while this was a complete user experience clusterfuck brought about by a bunch of bugs converging at an extremely inconvenient time, the bugs mentioned (and not) are no less real.

yummy alcohol posted button Posted by drunkenbatman
    August 04, 2005, at 10:01 AM


Comments (67)




Post a comment



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

And do endeavor to appear sane.









Remember personal info?