Archive forJanuary, 2004

All in Unison now (well, maybe not quite yet)

Panic announced Unison tonight. I’m absolutely astonished — it’s 2004, and yet here’s a new Usenet news reader. Wow.

I paid for Unison less than five minutes after I downloaded it. I didn’t do that because I think it’s the best Usenet client ever. I’ve been waiting so long for a terrific Usenet client on Mac OS X that I view my $25 as a way to encourage Panic to make Unison as good of a Usenet client as Transmit is an FTP client.

And while it’s OK, it isn’t Transmit-caliber yet. I’ve run into a crash, a variety of minor bugs, and a large number of missing features. The UI is a bit overloaded for someone like me to just wants to read a series of newsgroups without downloads, images, or music; it’s very slow to display each message; it doesn’t seem to have any way to refresh the articles in a newsgroup on a timer; and it doesn’t support custom headers or per-group reply addresses. That’s just a quick list.

On the other hand, for a 1.0 release, it’s quite good. It’s a shame that it can’t sync newsgroup or read-article information with MT-NewsWatcher, since if I could I wouldn’t have a dilemma on my hands about switching to it. And with Simon Fraser working on a new release of MT-NW, maybe I should stick with MT-NW in anticipation of its 3.4 release. It’s a tough call. I’ll be sending a lot of bug reports and feature requests to Panic; if they take care of the important ones in a reasonable time frame, I won’t have to debate this any more.

Comments off

Could NetNewsWire use a smiley face?

It looks like Brent Simmons spent most of today writing about strictness in parsing in NetNewsWire. From my rather-out-of-the-loop perspective, pretty much everything he says is right on target.

Some of his comments imply that improving the validity of the various RSS feeds out there is hopeless. While that might be right, Brent and the other newsreader authors could do something that might make a difference here. About five years ago, a small company in Germany introduced a web browser called iCab. It has never quite caught on as much as many people hoped, but it includes one feature that I haven’t seen in any other web browser — a built-in HTML validator. When you browse the Web with iCab, you get a smiley face at the top right of your browser window if the page validates, a cautious face if the page has warnings, and a frowny face if the page has errors. Better yet, you can click on the cautious and frowny faces and find out exactly what’s wrong with the current page.

I’m not sure how a feature like that would fit in to NetNewsWire or any other RSS reader, but it’d certainly be interesting to see someone try it. It might even decrease support queries from users who wonder why a particular feed isn’t displaying correctly.

Comments (5)

Debugging without line numbers

A few days ago, someone asked me for some help tracking down a problem. While the problem itself isn’t interesting here, the techniques might be interesting to the Mac programmers out there.

With function names sanitized, here’s the question:

I have a crash log that looks like:

Thread 4 Crashed:
 #0   0x00000000 in 0x0
 #1   0x003eecf8 in FunctionOne (FunctionOne + 268)
 #2   0x003eeddc in FunctionTwo (FunctionTwo + 88)
 #3   0x003eb714 in 0x003eb714
 #4   0x90a3a168 in forkThreadForFunction (forkThreadForFunction + 108)
 #5   0x900247e8 in _pthread_body (_pthread_body + 40)

I have the source code that was used to build the binary. How can I translate the 268 offset in FunctionOne() above into an actual line number so I can tell where the exact crash is?

Rather than translate the offset into a line number, I tracked down the bug in the code. While having line numbers can make tracking down bugs a lot easier, they’re not always necessary if you know what to do.

I started by finding the binary in question and running otool -tV on it, piping the output to less. I searched for the definition of FunctionOne in the output and saw this:

...
_FunctionOne:
00013bec        cmpwi   cr7,r3,0x0
00013bf0        mfspr   r0,lr
...

We’re looking for offset 268, so I added 268 to 0×00013bec to get 0×00013cf8. Frame 1 in the backtrace is somewhere around there (plus or minus an instruction, depending on how addresses in backtraces are reported). Looking at the otool output again, I scrolled forward to 0×00013cf8 and saw this:

...
00013cf0        li      r6,0x0
00013cf4        bl      0xc860  ; symbol stub for: _LibraryFunction
00013cf8        or      r3,r30,r30
00013cfc        bl      0xc580  ; symbol stub for: _CFRelease
00013d00        or      r3,r29,r29
...

Since the backtrace included one stack frame past FunctionOne, I figured we must be inside a function call from FunctionOne. Chances are that the real location of a function is one instruction before its first actual instruction, so we’re actually at 0×00013cf4 instead of 0×00013cf8. That means we crashed inside LibraryFunction.

Fortunately, I had the code for that library handy. I took a look at the code for LibraryFunction and saw this:

void LibraryFunction(void *arg1, int arg2,
	             MyCallbackFn callback, void *arg4) {
	int status = DoSomething(arg1, arg2, arg4);
	if (status != noErr) {
		(callback)(arg1, arg4);
	}
}

Think about what happens if callback is NULL. If we’re unlucky and DoSomething fails, we end up calling through a NULL function pointer, and we’d actually end up with a crash looking very similar to the one in the backtrace with NULL as the last frame on the stack.

So far, so good…but why was callback NULL? I took a look at the original binary and saw this line at about the right place in FunctionOne:

	LibraryFunction(foo, 0, NULL, NULL);

And there’s the bug. Once the third argument was changed to be a real callback function, everything worked.

That’s my quick lesson for the day on tracking down bugs from crash logs for binaries that don’t include full debugging information. Hopefully it’ll be useful for somebody.

Comments (1)

ecto

Practically everyone has been raving about ecto lately. ecto is the next version of Kung-Log, which is a widely used weblog posting tool. Inspired by Chuq and Judi’s praise, I downloaded ecto and gave it a shot.

Unfortunately, I can’t stand it. The first thing I noticed was that it uses metal windows. I don’t have a problem with metal windows in general, but they rarely seem to stand out as much to me as they did in ecto. It uses metal sheets! Safari and the Finder don’t do that. ecto uses lots of drawers, too. I don’t find those easy to interact with. I found myself trying to resize one of its drawers wider to see the contents of a text field. Unfortunately, the drawer was at the bottom of the window, so I couldn’t make it wider.

I was also confused by the multitude of windows. My weblogging needs are simple — I have one weblog, no categories, and no special features. I don’t even customize my HTML except under extreme duress. (It’s 2004 and I still don’t know how to write a style sheet.) I’d like to type in my weblog settings once and never see them again. With ecto, though, I started off with something like six different windows on the screen…including a confusing error message because I guessed at the RPC URL for my weblog and got it wrong at first. I then flipped through its preferences briefly and got lost in the plethora of options there. I quit it and deleted the app.

I think ecto is aimed at power bloggers. Actually, it has to be aimed at power bloggers, since that’d be the only market for a weblogging tool trying to compete with Blogger, LiveJournal, and other free tools. There’s nothing wrong with aiming for that market, and in fact I think it’ll be a great tool for those folks. I’m just not one of them. NetNewsWire’s weblog editor is good enough for almost all of my needs, so I’ll stick with it for a while longer.

Comments (7)

Congrats, Adrienne!

Huge congrats to Adrienne Roeder, a good friend of mine from Stanford (and current Ph.D. student at UCSD) who just had her primary undergrad research project published in this week’s issue of Cell. It’s been more than four years since she finished her work on the project so it’s terrific that it was published at all. Having it in Cell is simply fantastic. Way to go, Adrienne!

Comments off

Congrats, Nick!

Congratulations to Nick Fang, who as of today can finally tell people what he’s working on. Nick is a good friend of mine from Stanford and was one of my roommates when I worked for Microsoft. Though I knew he was working on something related to Media Center, I didn’t know what his project was. Now we know.

It must very nice for him to be able to tell people what he’s doing after such a long wait, though it sounds like he’ll still have to wait another six months or more before he can point to his stuff in stores. I’m quite jealous either way, since I still can’t tell folks what I’m doing. For the time being, I’ll just keep pointing to Alexei’s comments.

Comments off

Hybrid Accords!

I don’t know how this managed to get buried in the news today, but Honda announced today that they’re planning to ship hybrid Accords in the U.S. this fall. I’ve been waiting for this for a very long time. Honda says that the new Accord will have the power of an Accord V6 with the fuel mileage of a four-cylinder Civic. That’s not astonishing mileage — it’s maybe 50% better than the current Accords — but it’s still better than I get today, and I’d have a more powerful car, too. Tempting. So very tempting.

I can’t wait to see what Honda ends up shipping and how much the hybrid Accord costs. If the cost isn’t totally ridiculous, maybe I can convince myself to get a new car when my current Accord turns five next February. That’s a stretch, but it’s possible. I’ve wanted a hybrid for long enough that I just might have to be a little bit financially irresponsible for once.

Comments (4)

NASA TV

For those who don’t get NASA TV from their cable company, go here for a variety of RealMedia feeds. It’s showing some rather cool stuff at the moment — the first pictures from Spirit, to be exact.

Comments off

Mars comes to Mountain View

I rarely read Robert Scoble’s weblog, mostly because he posts too often. But yesterday Joseph Heck pointed to him, so I followed the link and read a few of Scoble’s posts from the past week.

I’m glad I did that, because otherwise I wouldn’t have seen this post about the NASA Ames Research Center’s nifty new Mars Center. It just opened a few days ago, and it’ll be around for the next six months while Spirit and (hopefully) Opportunity explore the Martian surface.

My parents and I stopped by the Mars Center today and had a great time. It isn’t big, but it has a lot of interesting information about the current Mars missions, a cute demo rover that you can direct in a similar way to how the actual Mars rovers are operated, and some nifty space rocks. (Oh, and a whole bunch of Macs.)

We timed our visit perfectly, since a JPL press conference started just after we showed up and the Mars Center was showing it live. We got to hear all about Spirit’s landing process from the folks in charge of the project, all of whom seemed both very excited and very nervous about the mission’s then uncertain fate. Ten hours later, it appears to be a huge success. I’m very, very excited. Go NASA!

Comments (1)

Sometimes you’re lucky….

I was driving to my apartment this morning after picking up my parents at their hotel in downtown San Jose. In the left lane of Almaden Expressway near Koch, someone came driving at me at what seemed like 45 miles an hour. That’s the same speed I was going. I swerved to the right and barely missed him. Fortunately, nobody was on my right at the time; I didn’t have a chance to look beforehand.

I’ve seen cars turn into the wrong side of a two-way street before, but I’ve never had someone going full speed the wrong way on a road that’s nearly a freeway. And coming right at me. I’m glad I’m here posting about it rather than depending on my car’s airbags to protect my parents and me.

Comments off