Skip to the Main Content

Note:These pages make extensive use of the latest XHTML and CSS Standards. They ought to look great in any standards-compliant modern browser. Unfortunately, they will probably look horrible in older browsers, like Netscape 4.x and IE 4.x. Moreover, many posts use MathML, which is, currently only supported in Mozilla. My best suggestion (and you will thank me when surfing an ever-increasing number of sites on the web which have been crafted to use the new standards) is to upgrade to the latest version of your browser. If that's not possible, consider moving to the Standards-compliant and open-source Mozilla browser.

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.
perl: warning: Please check that your locale settings:
        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:   https://golem.ph.utexas.edu/cgi-bin/MT-3.0/dxy-tb.fcgi/48

1 Comment & 0 Trackbacks

Found this page through Macintouch (I think). Great hint about the environment variables! Thanks for posting the efforts of your research.

And I agree with you about the Apple-required reboots for kext changes.

Posted by: swansong on December 18, 2002 2:42 PM | Permalink | Reply to this

Post a New Comment