Shell attachment failure?

On the occasion of upgrading to the fabled "Tiger" (OS X 10.4 10.4.1 10.4.2 (8C46), I find that Terminal version 1.5 (build 133) sometimes fails to attach a shell to a newly created term window. To start with it mostly alternated success and failure:

A screenful of freshly-created terminals, alternating normal and 'process completed'.

Those were all freshly created. The alternation was not entirely consistent; sometimes several would succeed or fail in a row. While setting up for this screenshot I had to delete an entire screenful of windows which opened successfully and only began failing when fork() maxed out, but that was anamolous. The situation shown in the screenshot was much more typical.

After several OS updates and various poorly-documented fiddling (most notably with Noam's cute little C script that was supposed to let us monitor which processes were failing when), the failure rate has dropped and is now low enough that I have difficulty tracking the patterns of possible failure triggers. I'm hoping to have a little fun with ktrace soon and nail it down better.

But the fun doesn't stop here! Terminal has trouble closing things properly when they exit, too. If I open a bunch of terminals, then close all but one of them with command-w and run a $(w), I see a bunch of orphaned shells roughly equal in number to the number of windows I opened and closed. Not exactly equivalent, mind you. That would be too easy. The workaround is to remember to exit every shell instance with $(exit) before closing the terminal.

Vruba reports that same issues running zsh in both Terminal and iterm 0.8.0.

I'm including my config files below for completeness. I don't think they're affecting the issue, but I don't want to send anyone into a tizzy over something that's really my problem. As you can see, I'm straddling the fence on the issue of where to store which settings.

# .zshrc: # Fink needs this. source /sw/bin/ # Load personal settings. source .profile # I think these are all in my .profile as well. # I'm messy like that. alias ls='ls -G' PS1='-> ' RPS1='%n@%m:%~'
# .profile: My personal settings. # A perl script to greet my by a random name. ~/code/perl/ /usr/share/dict/propername # Add to path, like it looks like. export PATH=$PATH:/usr/local/bin # SSH aliases, anonymized for your--err, my-- protection. # There are five in this form. alias shortname='ssh mylogin@myserver' # SSH tunnel for outgoing mail. alias mailtun='ssh -L[nnnn]:localhost:[nnn] mymailserver' # Shell shortcuts alias ls='ls -G' alias topp='top -R -ocpu' alias topm='top -o rsize' alias v='vim' alias gR='open /Applications/' PS1='-> ' # Set a simple arrow prompt. RPS1='%n@%m:%~' # user, host and path tucked rightwards.

If anyone knows how I can fix this, please tell me. I'm sending this to Apple, as well. I hope that by the time most of you read this, it's of nothing but historical interest.