I have a situation where a call to getaddrinfo(), with a nodename, works for weeks or months, and then with the same arguments starts failing consistently, returning: EAI_AGAIN (temporary failure in name resolution).
Strangely, when called from an unrelated process, but with the same arguments, getaddrinfo() works - it only fails under a specific process tree.
What can cause EAI_AGAIN (temporary failure in name resolution)?
What should the calling code do about it?
Placing the getaddrinfo() call in a loop, with a sleep(1), continues to fail so the error isn't just 'temporary' as the error message might suggest.
The man pages fail to clarify, so I'd like to step inside getaddrinfo() itself using gdb.
What is the best way to get the debug symbols on Mac OS X 10.5.2 for this?
make in Libinfo-278 fails with:
cd /warez/Libinfo-278/info.build/derived_src/membership.subproj && /usr/bin/mig /warez/Libinfo-278/membership.subproj/DSmemberdMIG.defs
/warez/Libinfo-278/membership.subproj/DSmemberdMIG.defs:1:40: error: ../include/DSmemberdMIG.defs: No such file or directory
mig: fatal: "/warez/Libinfo-278/membership.subproj/DSmemberdMIG.defs", line 1: no SubSystem declaration
What is the next step? To get debug symbols for getaddrinfo(), should I be trying to build the source for getaddrinfo()?
If so, I've read in the following post "It's in the libinfo project. Isn't that obvious? :-}"
uname -a
Darwin ... 9.2.2 Darwin Kernel Version 9.2.2: Tue Mar 4 21:23:43 PST 2008; root:xnu-1228.4.31~1/RELEASE_PPC Power Macintosh
So I've downloaded the following source to match Mac OS X 10.5.2/Darwin 9.2 (hopefully, is the difference between 9.2 and 9.2.2 significant?)
I haven't found any instructions on what to do with the source - are there any?
Is "make" just supposed to work?
Are any other sources required?
If I successfully build a libinfo.dylib, can i just use it in place of the symbolic link from libinfo.dylib to libSystem.dylib?
Do I need to do something to make a debug build?
/Libinfo-278/membership.subproj/DSmemberdMIG.defs
consists of the single line:
#include <../include/DSmemberdMIG.defs>
Where is ../include/DSmemberdMIG.defs supposed to be obtained from, as it does not exist in Libinfo?
In Libinfo-222.3.6, a file named memberd.defs, had its own contents, but I can't find the module in CVS to see log comments on why this changed.
More info on the getaddrinfo() call enviroment:
I have also isolated this with a test program using the example code (first one) from the man page, which fails in the same way.
'ping' also fails and succeeds to resolve the hostname in the same ways. nslookup always succeeds.
The long running process under which the failure eventually occurs is actually a Buildbot buildslave, which periodically starts a child bash shell, which runs a subversion checkout of our source and automated build process. After weeks of working, the svn checkout fails with:
From the point that the call starts failing, it (svn, ping and my test program) always fails when called from a child process of that same long-running Buildbot process, *but* the same program/call works when called from an unrelated process on the same machine...
nodename = the unqualified hostname of another host as a NUL terminated ASCII string.
servname is NULL.
hints contains
hints.ai_socktype = SOCK_STREAM;
hints.ai_family = AF_UNSPEC;
Thank you
Peter