#12166 closed bug (fixed)
gethostbyaddr_r missing in revised network code
Reported by: | haiqu | Owned by: | pulkomandy |
---|---|---|---|
Priority: | normal | Milestone: | R1/beta1 |
Component: | - General | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | #12176 | |
Platform: | All |
Description
Just upgraded from 49271 to 49301 and get this error:
Updating embedded/flashrom runtime_loader: /boot/system/lib/libapr-1.so.0.5.0: Could not resolve symbol 'gethostbyaddr_r' resolve symbol "gethostbyaddr_r" returned: -2147478780 runtime_loader: /boot/system/lib/libapr-1.so.0.5.0: Troubles relocating: Symbol not found
Change History (16)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
Milestone: | Unscheduled → R1/beta1 |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:3 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
This function is non-standard and was not in BeOS (according to https://www.gnu.org/software/gnulib/manual/html_node/gethostbyaddr_005fr.html). They are also deprecated in other systems: getaddrinfo should be used instead as it supports IPv6 and is designed to be thread-safe.
in hrev49306 I have updated APR to not use the functions anymore, this makes svn work again.
comment:4 by , 9 years ago
Adrien, removing symbols sucks. How are we supposed to maintain any binary compatibility here?
comment:5 by , 9 years ago
Even if it's deprecated, I would just leave it in for now -- just like on other platforms, and Haiku before.
comment:6 by , 9 years ago
I thought we were binary compatible only with BeOS, so we don't have to maintain compatibility with older versions of Haiku.
As gnulib says: "This function is missing on some platforms: Mac OS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, HP-UX 11, IRIX 5.3, Cygwin, mingw, MSVC 9, Interix 3.5, BeOS.". So, by "other platforms", you actually mean "Linux".
In netresolv the function is not implemented at all. It could be rewritten as a wrapper around gethostbyaddr (with a mutex, but that would be slow) or around getaddrinfo.
comment:7 by , 9 years ago
Sorry, I assumed it was more widely in use; looks like the only other system that contains it is Solaris (besides the old libbind). In this case, I agree with you that removing it is okay (even if it sucks as korli put so well :-)).
I hope APR now uses getaddrinfo() as it should, and not the thread unsafe gethostbyaddr() function?
comment:9 by , 9 years ago
Yes, APR can use getaddrinfo when available (see find_addresses at http://svn.apache.org/viewvc/apr/apr/trunk/network_io/unix/sockaddr.c?revision=1683521&view=markup). While checking this I also saw that the gethostbyname_r on Solaris has a different prototype than the one in Linux. There are versions with 3, 5 or 6 arguments, depending on the system you look at. So this doesn't help much with portability.
comment:10 by , 9 years ago
Thanks, svn working again. Although I can't say the same for several other packages, but at least the patch for apr will provide a model to repair them.
comment:11 by , 9 years ago
svn is still not working on x86_64 (and probably x86) because the updated apr packages were not added to /build/jam/repositories/HaikuPorts/x86_64 and /build/jam/repositories/HaikuPorts/x86 respectively.
comment:14 by , 9 years ago
Blocking: | 12176 added |
---|
Note: This makes subversion useless now.