[torqueusers] Torque 2.1.x pbs_server process hogging cpu

Martin Schafföner martin.schaffoener at e-technik.uni-magdeburg.de
Tue Jun 13 04:31:06 MDT 2006

On Tuesday 13 June 2006 11:56, garrick at speculation.org wrote:
> So after a successful bindresvport(), the connect() is failing with errno
> EADDRINUSE or EADDRNOTAVAIL and you are hitting the goto?  tryport is

Right. More precisely, according to the strace, errno==EADDRNOTAVAIL.

> being decremented just before the goto so the loop should exit after a
> maximum of 512 times (though I'm not sure how it would loop at all with
> bindresvport().)
> If you aren't seeing the decrement, it is probably just compiler
> optimization.  Rebuilding with -O0 might help there.  You can also
> change the initial value of tryport to something like 515 to see if the
> loop exits after 3 times so it is quicker to watch.
> Assuming bindresvport() and connect() succeed on their first try, it is
> expected that tryport is never used.  It is only used on OSes that don't
> have bindresvport().

Right, so SLES9 does have bindresvport(). Therefore, tryport only appears 
thrice in the codepath, once on line 175, where it's declared, once on line 
183, where it's initialized, and once on line 305, where it's decremented. 
Since it isn't used in any assignment, comparison or such, the compiler 
(correctly) eliminates the variable. So, shouldn't line 241 (local.sin_port = 
htons(tryport);) be moved to line 226, just above the #ifdef 

Martin Schafföner

Cognitive Systems Group, Institute of Electronics, Signal Processing and 
Communication Technologies, Department of Electrical Engineering, 
Otto-von-Guericke University Magdeburg
Phone: +49 391 6720063

More information about the torqueusers mailing list