2008/07/24

Terminal.app hangs at startup

I just got bit by this bug, under OS X 10.5.4. The symptoms are that sudo hangs, and Terminal.app hangs when opening a new tab or when starting up. Console.app shows messages of the form

7/24/08 7:04:44 AM kernel devfs: ttys001: name slot allocation failed (Errno=17)


rprr posted a workaround in the above thread which worked for me. I don't know how to link to specific messages in the discussion thread (or whether that's even allowed under the terms of use, egad), so here's a recap:
1. Started Terminal. It hung up. Did Force Quit and Sent Crash report to Apple.

2. Since I had a working X11 application, I used it to open about 10 xterms using the Applications->Terminal Menu of X11.app

3. I started Terminal again. Now it works.

2 comments:

Marti Bolivar said...
This comment has been removed by the author.
Marti Bolivar said...

I'm posting here because you're the first link I found when googling around about the problem.

I tried the workaround. You actually only need to try to open one xterm. But you'll notice that that xterm process still eats up CPU -- and if you kill it, you'll be unable to open other Terminal windows.

The good news is that there's a workaround to the workaround:

1) Download cputhrottle
http://www.willnolan.com/cputhrottle/cputhrottle.html
2) Get the PID of the offending xterm process
3) Open a Terminal window
$ sudo nohup cputhrottle PID 0
4) Background the nohup-ed process, then run
$ logout
4) Close the Terminal window

That throttles that process's CPU time to 0%. It leaves the throttled xterm running in the background. You will of course have to do this every time you log in/boot.

I don't know if Apple has already fixed this bug, as the machine I'm on is still on 10.5.4, but this at least works for me.