Opened 9 years ago
Last modified 9 years ago
#12195 closed bug
[Network] silently quits upon selecting DNS settings — at Version 2
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.
Note:
See TracTickets
for help on using tickets.
The DNS network settings use the global
__res
API which, according to [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 (thanks to Diver for providing the link)