Opened 4 years ago

Closed 4 years ago

Last modified 4 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
Has a Patch: no Platform: All


Just upgraded from 49271 to 49301 and get this error:

Updating embedded/flashrom runtime_loader: /boot/system/lib/ Could not resolve symbol 'gethostbyaddr_r' resolve symbol "gethostbyaddr_r" returned: -2147478780 runtime_loader: /boot/system/lib/ Troubles relocating: Symbol not found

Change History (16)

comment:1 Changed 4 years ago by haiqu

Note: This makes subversion useless now.

comment:2 Changed 4 years ago by pulkomandy

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

comment:3 Changed 4 years ago by pulkomandy

Resolution: fixed
Status: assignedclosed

This function is non-standard and was not in BeOS (according to 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 Changed 4 years ago by korli

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

comment:5 Changed 4 years ago by axeld

Even if it's deprecated, I would just leave it in for now -- just like on other platforms, and Haiku before.

comment:6 Changed 4 years ago by pulkomandy

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 Changed 4 years ago by axeld

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 Changed 4 years ago by taos

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

comment:9 Changed 4 years ago by pulkomandy

Yes, APR can use getaddrinfo when available (see find_addresses at 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 Changed 4 years ago by haiqu

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 Changed 4 years ago by taos

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 Changed 4 years ago by diver

cmake- seems to be broken as well now.

comment:13 Changed 4 years ago by pulkomandy

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

comment:14 Changed 4 years ago by pulkomandy

Blocking: 12176 added

comment:15 Changed 4 years ago by diver

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

comment:16 Changed 4 years ago by diver

Works fine after rebuild.

Note: See TracTickets for help on using tickets.