[haiku-bugs] Re: [Haiku] #12195: [Network] silently quits upon selecting DNS settings

  • From: "jua" <trac@xxxxxxxxxxxx>
  • Date: Mon, 06 Jul 2015 21:19:43 -0000

#12195: [Network] silently quits upon selecting DNS settings
-----------------------------------+----------------------------
Reporter: diver | Owner: pulkomandy
Type: bug | Status: new
Priority: normal | Milestone: R1/beta1
Component: Preferences/Network | Version: R1/Development
Resolution: | Keywords:
Blocked By: | Blocking:
Has a Patch: 0 | Platform: All
-----------------------------------+----------------------------

Comment (by jua):

The DNS network settings use the `__res` API which, according to NetBSD
[0], has been out of favour for a long time. In hrev49371 I switched our
netresolv to use the thread-safe version of the res functions, which are
also used internally by getaddrinfo() and others (for further explanation
see the commit message). It was necessary because the thread-unsafe
version broke name resolution in the Services Kit (as soon as more than
one request happened at the same time).

However, the thread-safe implementation doesn't support the old
`__res_state()` API at all anymore, hence this bug. On the NetBSD problem
report in [0] it is recommended to use a local `_res_state` via
`res_ninit()` and `res_nclose()` instead. I'm not familiar with these APIs
- maybe Axel can comment if that would be feasible?

Other options would be extending netresolv ourselves to allow using this
(basically, providing a mix of NetBSD's thread-safe and thread-unsafe
functions, not a good choice I think), or switching to a different
implementation altogether.

[0] http://gnats.netbsd.org/46661

--
Ticket URL: <https://dev.haiku-os.org/ticket/12195#comment:1>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: