- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- HP-UX 11.11, connect() and read() fail with EADDRU...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2007 05:35 AM
тАО03-15-2007 05:35 AM
HP-UX 11.11, connect() and read() fail with EADDRUNAVAIL
load the system appears to run out of some sort of resource that causes
connect() to begin returning -1 with errno == EADDRUNAVAIL.
This would of course suggest that the socket doing the connect()ing has
bound (with bind) to a source address that isn't configured on the machine.
However, in this case, there is no bind on the socket, as shown here in this trace (the host's local lan0 is configured at 147.128.44.88):
socket(AF_INET, SOCK_STREAM, 0) ............... = 4
fcntl(4, F_SETFD, 1) .......................... = 0
connect(4, 0x40031638, 16) .................... ERR#227 EADDRNOTAVAIL
sin_family: AF_INET
sin_port: 27009
sin_addr.s_addr: 147.128.44.88
shutdown(4, SHUT_RDWR) ........................ ERR#22 EINVAL
close(4) ...................................... = 0
This example is using the FLEXnet publisher lmstat tool, but when the system
gets into this state, it seems like *everything* starts to fail with this
error. Another example is telnet:
write(1, 0x4000c8a8, 10) ...................... = 10
T r y i n g . . . \n
socket(AF_INET, SOCK_STREAM, 0) ............... = 3
connect(3, 0x7a000980, 16) .................... ERR#227 EADDRNOTAVAIL
sin_family: AF_INET
sin_port: 23
sin_addr.s_addr: 127.0.0.1
I've tried to determine whether some kernel tuning value was out of whack or
what might otherwise cause this, but while I'm pretty experienced with UNIX,
I'm not the strongest on HP-UX.
Any ideas as to what might cause this?
Thanks,
Troy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2007 05:51 AM
тАО03-15-2007 05:51 AM
Re: HP-UX 11.11, connect() and read() fail with EADDRUNAVAIL
# /usr/bin/ndd /dev/tcp tcp_smallest_anon_port tcp_largest_anon_port
45800
45900
Apparently on this system the ephemeral port range was only 100 ports, which get used very quickly. Resetting these values eliminates the problem.
Troy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2007 05:52 AM
тАО03-15-2007 05:52 AM
Re: HP-UX 11.11, connect() and read() fail with EADDRUNAVAIL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2007 12:36 PM
тАО03-15-2007 12:36 PM
Re: HP-UX 11.11, connect() and read() fail with EADDRUNAVAIL
Certainly resetting the largest_anon_port to its proper value of 65535 is goodness. Better still would be to code the application such that it was not dependent on the system being configured "well" - by making explicit calls to bind() before calling connect() and selecting local port numbers in the range of 5000 to 65535.
That way, your application can churn through roughly 1000 connections per second before again tripping over trying to reuse a connection name (local/remote IP, local/remote port) for which there is still a TCP endpoint in TIME_WAIT.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2007 01:00 PM
тАО03-15-2007 01:00 PM
Re: HP-UX 11.11, connect() and read() fail with EADDRUNAVAIL
I thought about the wisdom of doing this, but decided it was sort of silly. I could potentially fix our software, but it would require identifying a ton of places that we create sockets and fixing all of them. Even then, not only could I not trust any binaries that might be called, I can't even trust library calls (gethostbyname might fail, for example, if the anonymous UDP port space was exhausted).
And I can't imagine the laughter I'd get reporting all those "bugs" to HP and other library vendors... :)
Troy