## December 12, 2002

### Crash Test Dummy

I haven’t been blogging much recently. There are several things that have been keeping me otherwise occupied, but one reason is that my iBook (from which I do most of my blogging) has been consistently crashing these past few weeks.

I keep my iBook running all the time, putting it to sleep when I need to transport it, or during periods of inactivity. Usually, it only gets rebooted for System Updates. [I don’t understand why Apple insists on a reboot when a simple kextunload/kextload or restarting a daemon would do, but that’s another story …].

Or that was the case until a few weeks ago. Then, the iBook started crashing every time I woke it up from sleep. The symptom was always the same. It would awake from sleep OK, but then, a few seconds to a minute later, the disk would start churning … cha, cha, cha, chung, … cha, cha, cha, chung, …cha, cha, cha, chung …, the machine would become unresponsive, and I would eventually be forced to reboot it.

Grrrr… Must be something to do with one of the recent Software Updates, but what? Then I noticed an — at first apparently unrelated — oddity. When I ran perl scripts from the commandline, I got a warning message I had never seen before:

% somescript.pl
perl: warning: Setting locale failed.
LC_ALL = (unset),
LANG = "en_US"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
...

Hmmm… The LANG environment variable didn’t used to be set. And it isn’t set on Golem, which is nominally running the same system software (MacOX 10.2.2 and Perl 5.8.0). It was easy to fix this problem, though.

% setenv LC_ALL C

overrides the LANG setting, and Perl scripts executed from the commandline now performed normally.

Then I noticed that ProcessWizard wasn’t displaying its list of running processes, as it was supposed to. Looked inside the App-wrapper and, aha! ProcessWizard relies on a bunch of perl scripts to gather and parse the information about running processes. Clearly, it was getting the same warning message, which was confusing it.

So how to set the environment variable LC_ALL so that an Application like ProcessWizard will see it? Much unsuccessful mucking about until I found this explanation. Okey Dokey! So I created a ~/.MacOSX/environment.plist file to set the environment variable LC_ALL. After logging out and back in, ProcessWizard worked again and commandline perl scripts executed correctly.

But now for the kicker! I had cured my “Wake-From-Sleep” problem too! My iBook hasn’t crashed since.

My best surmise is that the wakeup routine executes some perl script (or other locale-dependent code) which was getting screwed up by the same bug that was screwing up ProcessWizard. Setting the environment variable fixed the problem.

Bottom line: My iBook is back in service! So maybe I’ll start blogging again.

Posted by distler at December 12, 2002 9:58 AM

TrackBack URL for this Entry:   http://golem.ph.utexas.edu/cgi-bin/MT-3.0/dxy-tb.fcgi/48