[#41916] Proposal: Bitmap Marking GC — Narihiro Nakamura <authornari@...>

Hi.

18 messages 2012/01/05

[#41941] [ruby-trunk - Bug #5851][Open] make check fails when compiling with GCC 4.7 - *** longjmp causes uninitialized stack frame *** — Vit Ondruch <v.ondruch@...>

12 messages 2012/01/06

[#41979] [ruby-trunk - Bug #5865][Open] Exception#== should return false if the classes differ — Hiro Asari <asari.ruby@...>

10 messages 2012/01/08

[#42003] [ruby-trunk - Bug #5871][Open] regexp \W matches some word characters when inside a case-insensitive character class — Gareth Adams <gareth@...>

14 messages 2012/01/09

[#42016] [ruby-trunk - Feature #5873][Open] Adopt FFI over DL — Heesob Park <phasis@...>

15 messages 2012/01/10

[#42149] [ruby-trunk - Feature #5899][Open] chaining comparsions. — Ondrej Bilka <neleai@...>

12 messages 2012/01/16

[#42164] [ruby-trunk - Feature #5903][Open] Optimize st_table (take 2) — Yura Sokolov <funny.falcon@...>

18 messages 2012/01/17

[ruby-core:42121] [Ruby 1.8 - Bug #5095] Resolv should call res_init()

From: Daniel Pittman <daniel@...>
Date: 2012-01-13 20:24:32 UTC
List: ruby-core #42121
Issue #5095 has been updated by Daniel Pittman.


Hi.  I only recently noticed this issue had been filed in response to an issue we had in Puppet.

Sadly, the subject is a little misleading, which led to the ticket being closed, when the actual issue is quite real.

We have this problem because we use `Net::HTTP` to make a request, which uses `TCPSocket`, which in turn uses `sock_addrinfo` down in the C code under Ruby 1.8.7 to resolve the name to an address.  I have not actually dug into the implementation of that, but it certainly doesn't look to be using the `Resolv` library.

Unfortunately, just loading `resolv-replace` wouldn't be enough, either: that uses Resolv to do the lookup, which is great, but it uses the class method family `Resolv.get*` to obtain the addresses.  They, in turn, use `Resolv::DefaultResolver`, which is created at load time for the `resolv` code and never replaced - and neither is there a mechanism for us to replace that at runtime without hacking directly into code in that class and, obviously, breaking if a newer version of Ruby changed the structure.

It would, ultimately, be great if the C implementation could support platform things like `res_init()` at the appropriate time, but even a fallback where we could use the Ruby level `Resolv` library without having to rewrite it ourselves or hack into the internals would be OK...


----------------------------------------
Bug #5095: Resolv should call res_init()
https://bugs.ruby-lang.org/issues/5095

Author: Orion Poplawski
Status: Rejected
Priority: Normal
Assignee: 
Category: lib
Target version: 
ruby -v: ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux]


At least on linux, when /etc/resolv.conf changes it is necessary to call res_init() to load the new resolver information.  The Resolv library does not call res_init() and there appears to be no way to call it.

See http://projects.puppetlabs.com/issues/2776 for an example of the problem.


-- 
http://bugs.ruby-lang.org/

In This Thread

Prev Next