[torqueusers] Torque 2.1.x pbs_server process hogging cpu

garrick at speculation.org garrick at speculation.org
Tue Jun 13 16:58:41 MDT 2006

On Tue, Jun 13, 2006 at 12:31:06PM +0200, Martin Schafföner alleged:
> 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 

Yes, you are right.  That is an infinite loop.  But why is connect()
failing with EADDRNOTAVAIL?   "The specified address is not available on
the remote machine."  I don't know what that means.  Why would to
attempt a connection to any machine other than one with the specified

Something wonky in your route table?  Are you routing a network to
yourself without actually configuring the IP to your interface?

Can you try another build without BIND_RESVPORT?

> (correctly) eliminates the variable. So, shouldn't line 241 (local.sin_port = 
> htons(tryport);) be moved to line 226, just above the #ifdef 

No, sin_port should be 0 for bindresvport() to work correctly.

More information about the torqueusers mailing list