From: michael libby Date: 2002-10-29T23:11:34+09:00 Subject: net/http segfault -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Wanted to have some airplane reading for the trip to RubyConf and whipped up the following script to download comic strips from an online comic source: #!/usr/bin/ruby -w require 'net/http' domain = "www.comicprovider.com" path = "/comic-strip/2001/" '01'.upto('12') do |month| start = '01' finish = '31' puts "Fetching #{path} from #{domain} starting at #{start} and going to \ #{finish} for month #{month}" h = Net::HTTP.new(domain, 80) start.upto(finish) do |g| begin s = "#{path}#{month}#{g}.gif" puts "Fetching #{s}..." resp, data = h.get(s) puts "Writing #{g}..." File.open("stripname_2001#{month}#{g}.gif", "w+"){|b| b.puts data} rescue puts "error fetching or writing #{s}, continuing" end end end But I get segfaults all the time, which means I have to adjust the boundaries and start over. It's not predictable. /usr/lib/ruby/1.6/net/protocol.rb:785: [BUG] Segmentation fault ruby 1.6.7 (2002-03-01) [i686-linux-gnu] Aborted What the heck? -michael Michael C. Libby x@ichimunki.com http://www.ichimunki.com/ http://www.ichimunki.com/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9vpbO4ClW9KMwqnMRAotsAJ0ZOUpiuJG/v9758lGfC2ZG7rw0qACfTlm4 NLC7QL1axSDr97L+7Yp8ap4= =AYyS -----END PGP SIGNATURE-----