From: Nathaniel Talbott Date: 2003-12-11T01:10:37+09:00 Subject: Re: Segfault in 1.8.1p3 On Dec 10, 2003, at 05:33, ts wrote: >>>>>> "N" == Nathaniel Talbott writes: > > N> to track this down. I have the server stopped in gdb at the SIGSEGV > N> point, so I can give information about the state of data structures > in > N> memory if that would help. > > It will be useless : the best is to give an example to reproduce the > bug OK... didn't realize it would be this easy: server.rb: require 'webrick' include WEBrick s = HTTPServer.new( :Port => 2000, :Logger => BasicLog::new('/dev/null'), :AccessLog => [] ) class HelloServlet < HTTPServlet::AbstractServlet def do_GET(req, res) res.body = "hello, world." res['Content-Type'] = "text/html" end end s.mount("/hello", HelloServlet) trap("INT"){ s.shutdown } s.start killer.rb: require 'thread' require 'net/http' threads = [] 200.times do threads << Thread.new do h = Net::HTTP::new('localhost', 2000) loop do h.get('/hello') end end end threads.each{|t| t.join} Running: ntalbott@proxytest:~/sandbox$ ruby server.rb & [1] 20130 ntalbott@proxytest:~/sandbox$ ruby killer.rb /usr/lib/ruby/1.8/net/http.rb:1699: [BUG] Segmentation fault ruby 1.8.1 (2003-12-05) [i386-linux] Aborted Interestingly enough, it's not the server, but the killer that dies, so I can't guarantee this is the same segfault that my larger program has. It's a good place to start, however. Thanks, Nathaniel <:((><