Forum: Ruby Strange Proc#call problems with profile

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2c7c807a1df0c76a8fc823c709b501a9?d=identicon&s=25 Victor Shepelev (Guest)
on 2006-05-06 06:01
(Received via mailing list)
Hello all.

I've striked with some strange problem.
After transition from ruby1.8.2 => ruby1.9 I have the following problem:

--
require 'profile'

l = lambda{|x| x}
l.call([1,2,3])  #<== error goes here
--

test_profile.rb:4:in `Proc#call': wrong argument type nil (expected
Data)
(TypeError)

If I comment out "require profile", all works without errors.

What does it mean?

Thanks.

Victor.
Dd76a12d66f843de5c5f8782668e7127?d=identicon&s=25 Mauricio Fernandez (Guest)
on 2006-05-06 12:34
(Received via mailing list)
On Sat, May 06, 2006 at 01:01:03PM +0900, Victor Shepelev wrote:
> (TypeError)
>
> If I comment out "require profile", all works without errors.

Looks like a bug in 1.9; I'm forwarding that to ruby-core:

$ cat bug2.rb
set_trace_func proc{}
l = lambda{}
l.call
$ ruby19 bug2.rb
bug2.rb:3: [BUG] Segmentation fault
ruby 1.9.0 (2006-05-01) [i686-linux]

Aborted
2c7c807a1df0c76a8fc823c709b501a9?d=identicon&s=25 Victor Shepelev (Guest)
on 2006-05-07 07:49
(Received via mailing list)
> > --
> set_trace_func proc{}
> l = lambda{}
> l.call
> $ ruby19 bug2.rb
> bug2.rb:3: [BUG] Segmentation fault
> ruby 1.9.0 (2006-05-01) [i686-linux]
>
> Aborted

Aha. Thanks.
Can someone advice me on temporary workaround?

> Mauricio Fernandez  -   http://eigenclass.org   -  singular Ruby

Victor.
0ec4920185b657a03edf01fff96b4e9b?d=identicon&s=25 Yukihiro Matsumoto (Guest)
on 2006-05-07 09:10
(Received via mailing list)
In message "Re: Strange Proc#call problems with profile"
    on Sun, 7 May 2006 14:47:22 +0900, "Victor Shepelev"
<vshepelev@imho.com.ua> writes:

|> Looks like a bug in 1.9; I'm forwarding that to ruby-core:

|Aha. Thanks.
|Can someone advice me on temporary workaround?

[ruby-core:07835]

--- eval.c	23 Feb 2006 04:24:39 -0000	1.890
+++ eval.c	6 May 2006 14:41:49 -0000
@@ -8266,3 +8243,3 @@ proc_invoke(VALUE proc, VALUE args /* OK
     struct BLOCK _block;
-    struct BLOCK *data;
+    struct BLOCK *data, *old_block;
     volatile VALUE result = Qundef;
@@ -8304,2 +8277,3 @@ proc_invoke(VALUE proc, VALUE args /* OK
     /* modify current frame */
+    old_block = ruby_frame->block;
     ruby_frame->block = &_block;
@@ -8316,2 +8290,3 @@ proc_invoke(VALUE proc, VALUE args /* OK
     POP_TAG();
+    ruby_frame->block = old_block;
     ruby_wrapper = old_wrapper;
2c7c807a1df0c76a8fc823c709b501a9?d=identicon&s=25 Victor Shepelev (Guest)
on 2006-05-07 09:16
(Received via mailing list)
>
> |> Looks like a bug in 1.9; I'm forwarding that to ruby-core:
>
> |Aha. Thanks.
> |Can someone advice me on temporary workaround?
>
> [ruby-core:07835]
>
> --- eval.c	23 Feb 2006 04:24:39 -0000	1.890
> +++ eval.c	6 May 2006 14:41:49 -0000

Thanks matz! Big thanks!

Victor.
This topic is locked and can not be replied to.