[haiku-development] /bin/ps and semaphores

I've been seeing a lot of hung Terminals and shells lately,
so I took a look at 'ps', and the shells (/bin/sh --login) seem
to be waiting on all kinds of semaphores. This is due to an
error in ps where the previous semaphore name falls through.

http://svn.berlios.de/viewcvs/haiku/haiku/trunk/src/bin/ps.c?rev=11909&view=markup

Rev 24008:
http://www.kirilla.com/haiku/screen1.png
http://www.kirilla.com/haiku/screen2.png
http://www.kirilla.com/haiku/screen3.png
http://www.kirilla.com/haiku/screen4.png
http://www.kirilla.com/haiku/screen5.png

Adding some error checking to ps.c ...
http://www.kirilla.com/haiku/ps.c.diff
(feel free to apply a better patch)

... shows a few "Bad semaphore ID" in the ps output
http://www.kirilla.com/haiku/screen7.png
http://www.kirilla.com/haiku/screen8.png

What are those bad semaphores about? 
An error in ps or something deeper?

/Jonas.


Other related posts: