June 96 - KON & BAL's Puzzle Page: New World Order
KON & BAL's Puzzle Page: New World Order
CAMERON ESFAHANI and ALEX ROSENBERG
See if you can solve this programming puzzle, presented in the
form of a dialog between Cameron Esfahani (cam) and Alex
Rosenberg. The dialog gives clues to help you. Keep guessing until
you're done; your score is the number to the left of the clue that
gave you the correct answer. Even if you never run into the
particular problems being solved here, you'll learn some valuable
debugging techniques that will help you solve your own
programming conundrums. And you'll also learn interesting
Macintosh trivia.
Alex Hey cam, Marathon crashed in a weird manner when I tried to play it
under an early version of Mac OS 8.
cam Working hard, eh? I suppose you'll tell me this was compatibility testing.
Alex Yeah, well, it makes a good demo.
cam Hey, wait a minute! If it's an early version of Mac OS 8, Puzzle Page
readers won't ever find this bug, and they'll write nasty letters to the editor about it.
Alex Well, they should know that they'll learn some valuable debugging
techniques that they can apply to their own programming conundrums. Don't they read
the intro to the Puzzle Page?
cam I guess not. Anyway, back to your problem. So, in what way does it fail?
Alex Just after launch, the machine freezes. This happens every time; it's
100% reproducible. I can't seem to get into MacsBug.
cam Philistine! We use the one true debugger, the Macintosh Debugger for
PowerPC. Mac OS 8 debugging is generally done from a second machine over a serial
cable. You're probably frozen because the program has crashed and the debugger has
halted the machine, waiting to start a debugging session.
Alex What? I thought I gave that up with my Lisa. This is a Macintosh, after
all.
cam Kernel-based operating systems are typically developed with
two-machine debuggers. Besides, think of the wonderful third-party opportunity!
Alex Um, yeah. Anyway, you've hooked up the serial cable and are running the
debugger on the second machine. After watching a progress bar for a while, you see a
dialog that says "Access Fault.
cam An access fault is caused by an attempt to access an illegal address. The PC
is at the instruction that caused the fault.
Alex There's a Show PC command in the debugger's Extras menu. It puts me at
0x626FDE50.