(Cross-posted from Bottled Text.)
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)
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.