> Lloyd Zusman <ljz / asfast.com> writes:
> 
> > [ ... ]
> >
> > The error occurs when I run the test.rb program with the final line
> > uncommented, as follows:
> >
> >   #!/usr/bin/ruby
> >                                                             
>                    
> >   require "sys/host"
> >   include Sys
> >
> >   puts Host.hostname
> >   puts Host.ip_addr
> >   Host.ip_addr{|ip| puts ip}
> 
> I just discovered that if I use "each" in the final line, the 
> error goes
> away ...
> 
>   Host.ip_addr.each {|ip| puts ip}
> 
> I'm not sure if the final line in test.rb has a typo, or if 
> this a bona
> fide bug because the ip_addr method is supposed to properly handle
> iterators.

That's interesting.  It *should* work without the each method.  I just
tested it on Solaris using an August build of 1.7.2 and it worked ok.
However, I have not tested it against 1.7.2 on FreeBSD.  I must also admit
that I've never actually tested this on a system with more than 1 IP address
- I simply don't have access to a system that does.

BTW, which compiler?  What version of FreeBSD?  Which version of Sys::Host?

So, there are a few possibilities:

1) This only shows up in recent builds of 1.7.x
2) This only shows up in 1.7.x on FreeBSD
3) Old compiler
4) Some memory isn't being freed that should be (or vice versa)

I'll attempt to test this as soon as I get access to a FreeBSD system again
with 1.7.x.  Even better - someone gives me access to a FreeBSD system with
multiple ethernet cards. :)

Regards,

Daniel Berger