[#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:

event_hook shows weirdness when invoked on mixed in methods

From: Ryan Davis <ryand-ruby@...>
Date: 2005-06-17 07:54:03 UTC
List: ruby-core #5233
The following attachment, when run, shows the following behavior:

> % ruby -v ./add_event_hook_weirdness.rb
> ruby 1.8.3 (2005-06-17) [powerpc-darwin8.1.0]
> ./add_event_hook_weirdness.rb:620:in `hash': undefined method  
> `hash' for #<MyMod:0x32c0c4> (NoMethodError)
>     from ./add_event_hook_weirdness.rb:620:in `y'
>     from ./add_event_hook_weirdness.rb:626
>     from ./add_event_hook_weirdness.rb:625:in `times'
>     from ./add_event_hook_weirdness.rb:625

MyMod is a module, mixed in to MyClass via include. MyClass has one  
method (y) and it calls the method (x) included from the module. The  
event hook that we define takes the id and the klass, puts them in an  
array, and uses that as a hash key. This, in turn, tries to call hash  
on the instance of MyMod that was created when MyClass included into  
it (via include_class_new?).

We've tried our best to strip everything down to a 1 file repro with  
no dependencies outside of standard ruby. As a result, we had to  
include some of RubyInline, which makes the file bigger. We added  
tags ("HERE") to mark the start of the real code and the line we  
think is the offender.

We added one extra feature to help debugging. If you define an  
environment variable "HASH" it'll print out the process ID and sleep  
instead of just raising NoMethodError.

> % HASH=1 ruby -v ./add_event_hook_weirdness.rb
> ruby 1.8.3 (2005-06-17) [powerpc-darwin8.1.0]
> MyMod#hash invoked from ./add_event_hook_weirdness.rb:620:in `y'
> connect to 10702 now... sleeping
>   C-c C-c./add_event_hook_weirdness.rb:609:in `sleep': Interrupt
>     from ./add_event_hook_weirdness.rb:609:in `hash'
>     from ./add_event_hook_weirdness.rb:620:in `y'
>     from ./add_event_hook_weirdness.rb:626
>     from ./add_event_hook_weirdness.rb:625:in `times'
>     from ./add_event_hook_weirdness.rb:625

We tried very hard to debug this ourselves, but our internals- 
debugging-fu is not strong enough.

Attachments (1)

add_event_hook_weirdness.rb (16.2 KB, application/x-sh)

In This Thread

Prev Next