# Bug? - Resolv.getnames hanging after being interrupted

**URL:** <https://www.ruby-forum.com/t/bug-resolv-getnames-hanging-after-being-interrupted/138461>\
**Category:** Ruby\
**Created:** [May 23, 2008, 9:45am UTC](https://www.ruby-forum.com/t/bug-resolv-getnames-hanging-after-being-interrupted/138461 "2008-05-23T09:45:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tlockney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/5e9695/32.png) [@tlockney](https://www.ruby-forum.com/u/tlockney)\
**Post date:** [May 23, 2008, 9:45am UTC](https://www.ruby-forum.com/t/bug-resolv-getnames-hanging-after-being-interrupted/138461/1 "2008-05-23T09:45:33Z")

</div>

Hi everybody,

I came across some weird behavior and I don’t know if it is a bug or  
not. If you execute the following command it will run okay first, but  
when Resolv.getnames gets interrupted by the timeout, it sometimes  
stops working:

ruby -rresolv -e ‘1.upto(5) {begin; timeout(1) {1.upto(255) {|i| p [i, Resolv.getnames(“72.14.207.99”)] }}; rescue Timeout::Error; p “end”;  
end}’

I have tested this on

- Ubuntu 6.06 with ruby 1.8.4 (2005-12-24) [i486-linux] where it works  
fine
- Ubuntu 6.06 with ruby 1.8.6 (2008-03-03 patchlevel 114) [i686-linux]  
where it sometimes works but more often just hangs and does not  
resolve the ip anymore
- Mac OSX 10.5.2 with ruby 1.8.6 (2007-09-23 patchlevel 110) [i686- darwin8.11.1] where it also hangs nearly every time

Resolv.getnames also sometimes stops working without being  
interrupted, by just calling it a lot…

Maybe someone can shed some light on this?!

– Thomas
