Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#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 haiqu, 9 years ago

Note: This makes subversion useless now.

comment:2 by pulkomandy, 9 years ago

Milestone: UnscheduledR1/beta1
Owner: changed from nobody to pulkomandy
Status: newassigned

comment:3 by pulkomandy, 9 years ago

Resolution: fixed
Status: assignedclosed

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 korli, 9 years ago

Adrien, removing symbols sucks. How are we supposed to maintain any binary compatibility here?

comment:5 by axeld, 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 pulkomandy, 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 axeld, 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:8 by taos, 9 years ago

Would it be possible to update the apr packages for x86_64 and x86, too?

comment:9 by pulkomandy, 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 haiqu, 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 taos, 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:12 by diver, 9 years ago

cmake-2.8.11.2-7-x86_gcc2.hpkg seems to be broken as well now.

comment:13 by pulkomandy, 9 years ago

cmake 2.8 is obsolete, please use the cmake_x86 package for cmake 3.

comment:14 by pulkomandy, 9 years ago

Blocking: 12176 added

comment:15 by diver, 9 years ago

cmake_x86-3.2.2-1-x86_gcc2.hpkg is broken as well :/

comment:16 by diver, 9 years ago

Works fine after rebuild.

Note: See TracTickets for help on using tickets.