[#5219] Segmentation fault in timeout.rb — Michel Pastor <K@...>

Hi,

18 messages 2005/06/16
[#5220] Re: Segmentation fault in timeout.rb — Eric Hodel <drbrain@...7.net> 2005/06/16

[#5221] Re: Segmentation fault in timeout.rb — Michel Pastor <K@...> 2005/06/16

On Fri, 17 Jun 2005 05:03:18 +0900

[#5223] Re: Segmentation fault in timeout.rb — nobu.nokada@... 2005/06/17

Hi,

[#5296] Subversion — Shugo Maeda <shugo@...>

Hi,

64 messages 2005/06/30
[#5297] Re: Subversion — Curt Hibbs <curt@...> 2005/06/30

Shugo Maeda wrote:

[#5298] Re: Subversion — Nikolai Weibull <mailing-lists.ruby-core@...> 2005/06/30

Curt Hibbs wrote:

[#5301] Re: Subversion — Austin Ziegler <halostatue@...> 2005/06/30

On 6/30/05, Nikolai Weibull

[#5304] Re: Subversion — Nikolai Weibull <mailing-lists.ruby-core@...> 2005/06/30

Austin Ziegler wrote:

[#5305] Re: Subversion — Austin Ziegler <halostatue@...> 2005/06/30

On 6/30/05, Nikolai Weibull

[#5307] Re: Subversion — mathew <meta@...> 2005/06/30

Austin Ziegler wrote:

[#5308] Re: Subversion — Austin Ziegler <halostatue@...> 2005/06/30

On 6/30/05, mathew <meta@pobox.com> wrote:

[#5311] Re: Subversion — mathew <meta@...> 2005/07/01

Austin Ziegler wrote:

[#5323] Re: Subversion — Austin Ziegler <halostatue@...> 2005/07/01

On 7/1/05, mathew <meta@pobox.com> wrote:

[#5325] Re: Subversion — Nikolai Weibull <mailing-lists.ruby-core@...> 2005/07/01

Austin Ziegler wrote:

Re: Segmentation fault in timeout.rb

From: Michel Pastor <K@...>
Date: 2005-06-16 23:01:11 UTC
List: ruby-core #5221
On Fri, 17 Jun 2005 05:03:18 +0900
Eric Hodel <drbrain@segment7.net> wrote:

> It is probably not a bug in ruby, because ruby protects itself  
> against deadlock by immediately exitting.

good :)
Why the interpreter says "Segmentation fault" if it is only a deadlock ?

> All the threads were probably told to go to sleep

the debugging output tells us the problem is at
/usr/lib/ruby/1.8/webrick/server.rb:88
88    if svrs = IO.select(@listeners, nil, nil, 2.0)
              svrs[0].each{|svr|
                @tokens.pop          # blocks while no token is there.
                sock = svr.accept
                sock.sync = true
                Utils::set_close_on_exec(sock)
                th = start_thread(sock, &block)
                th[:WEBrickThread] = true
                thgroup.add(th)
             }
        end

/usr/lib/ruby/1.8/timeout.rb:41
      y = Thread.start {
41    sleep sec
        x.raise exception, "execution expired" if x.alive?
      }

I suppose the select timeout is implemented using timeout.rb but that doesn't explain the deadlock in this code.
any idea ?

thx
- Michel

In This Thread