#12195 closed bug (fixed)
[Network] silently quits upon selecting DNS settings
Reported by: | diver | Owned by: | pulkomandy |
---|---|---|---|
Priority: | normal | Milestone: | R1/beta1 |
Component: | Preferences/Network | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description (last modified by )
Clicking DNS settings in Network preflet quits with _res is not supported for multi-threaded programs.
message.
Change History (6)
comment:2 by , 9 years ago
Description: | modified (diff) |
---|
comment:3 by , 9 years ago
Actually, Adrien wrote that code; I have no idea. However, following the advise in the link you provided sounds like it may work:
Instead start using the thread-safe versions of the functions (it is as simple as changing res_send() to res_nsend() for example and managing your own _res_state with res_ninit()/res_nclose()). They've been there for almost a decade now, and there is no excuse for dicking with _res directly anymore!
Note:
See TracTickets
for help on using tickets.
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
viares_ninit()
andres_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