Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getaddrinfo() starts failing with EAI_AGAIN (again)



On Jul 7, 2008, at 8:41 AM, Jamus Jegier wrote:
A couple months ago, there was a post by Peter Oberauer about getaddrinfo() failing with EAI_AGAIN by processes under a specific process tree.

I am running into the exact same problem, and was wondering if there was any resolution to the issue.

I installed Nagios, which frequently forks processes to verify the status of network hosts. After about 8 hours, all child processes start failing with EAI_AGAIN.

Under the Nagios parent process, dig works, but ping doesn't. Both DNS and Bonjour lookups begin to fail.

Ping and the Nagios helper executables work fine when started under an unrelated process.

The only other thing I can add is that I see this on 10.5.3 on a G4 system. I'm installing 10.5.4 now, and will post if I still see this.

Typically, getaddrinfo() fails with EAI_AGAIN when there is a failure of malloc of the memory needed to return the linked list of addrinfo structures. This generally happens if:


(1) you have a memory leak (either you fail to call freeaddrinfo() on the returned memory, or have a different leak)

(2) you have fragmented your process address space (sufficiently that it is impossible to allocate a contiguous memory chunk large enough to return the requested information_

(3) the information you are requesting would be so large that it's impossible to return it (misconfigured DNS server, DNS cache poisoning attack, broken DNS server software, etc.)

You should examine how much memory is in use by your process to distinguish #1, you should use vmmap to distinguish #2, and you should use host and similar commands and/or a packet analyzer (or tcpdump) to distinguish #3.

-- Terry

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden
References: 
 >getaddrinfo() starts failing with EAI_AGAIN (again) (From: Jamus Jegier <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.