[MacRuby] #831: Received request header with Webrick HTTPD is broken after GC is executed.
#831: Received request header with Webrick HTTPD is broken after GC is executed. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Test Script: {{{ #!ruby $ cat test.rb require 'open-uri' require 'webrick' NullLog = Object.new def NullLog.<<(arg) end def with_http Dir.mktmpdir {|dr| srv = WEBrick::HTTPServer.new({ :DocumentRoot => dr, :ServerType => Thread, :Logger => WEBrick::Log.new(NullLog), :AccessLog => [[NullLog, ""]], :BindAddress => '127.0.0.1', :Port => 8080}) _, port, _, host = srv.listeners[0].addr begin th = srv.start yield srv, dr, "http://#{host}:#{port}" ensure srv.shutdown end } end myheader1 = 'hello world' myheader2 = nil with_http {|srv, dr, url| srv.mount_proc("/h/") {|req, res| myheader2 = req['myheader']; p "recv [1] : before GC : #{myheader2}" GC.start p "recv [2] : after GC : #{myheader2}" res.body = "foo" } open("#{url}/h/", 'MyHeader'=>myheader1) {|f| } } }}} GC Eabled: {{{ $ macruby test.rb "recv [1] : before GC : hello world" "recv [2] : after GC : \xA1i\x00\x00\x00\x00\x00\x00\xE0n)" }}} GC Disabled: {{{ $ GC_DISABLE=true macruby test.rb "recv [1] : before GC : hello world" "recv [2] : after GC : hello world" }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/831> MacRuby <http://macruby.org/>
#831: Received request header with Webrick HTTPD is broken after GC is executed. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by lsansonetti@…): It seems to work on my environment: {{{ $ /usr/local/bin/macruby t.rb "recv [1] : before GC : hello world" "recv [2] : after GC : hello world" }}} But I will test on other environments. -- Ticket URL: <http://www.macruby.org/trac/ticket/831#comment:1> MacRuby <http://macruby.org/>
#831: Received request header with Webrick HTTPD is broken after GC is executed. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by watson1978@…): I tried on another iMac with MacRuby Nightly Latest Build, and reproduced.[[BR]] And sometimes, segfault occurs with this issue.[[BR]] I hope that this issue reproduces in your environment. :-) -- Ticket URL: <http://www.macruby.org/trac/ticket/831#comment:2> MacRuby <http://macruby.org/>
#831: Received request header with Webrick HTTPD is broken after GC is executed. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by lsansonetti@…): I'm now able to repro this crash on my Mac Pro with 10.6.4. It seems to disappear when I disable compiler optimizations, but it may not be related. It definitely looks like a missing write barrier. -- Ticket URL: <http://www.macruby.org/trac/ticket/831#comment:3> MacRuby <http://macruby.org/>
#831: Received request header with Webrick HTTPD is broken after GC is executed. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by lsansonetti@…): After looking more, the issue seems related to the thread local collector pass. Setting the AUTO_USE_TLC env variable to 0 or removing the "myheader2 = nil" expression make the bug disappear. -- Ticket URL: <http://www.macruby.org/trac/ticket/831#comment:4> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby