Bug #4029

Stack consistency error (sp: 7, bp: 8) using external libs

Added by Andrew Senior over 3 years ago. Updated almost 3 years ago.

[ruby-core:33077]
Status:Rejected
Priority:Normal
Assignee:Koichi Sasada
Category:ext
Target version:1.9.3
ruby -v:ruby 1.9.2p0 (2010-08-18) [armv7l-linux-eabi] Backport:

Description

=begin
cat example_ext.c

#include "ruby.h"
VALUE cMyClass;

static VALUE
myfunc( VALUE receiver, VALUE args )
{
int offset;
for (offset = 0; offset < 6; offset ++)
{
switch (TYPE(RARRAY
PTR(args)[offset])) {
case TSTRING:
printf("Arg reads %s\n", RSTRING
PTR(RARRAYPTR(args)[offset]));
break ;
case T
DATA:
printf("Data \n");
break ;
case TSYMBOL:
printf("Symbol \n");
break ;
case T
ARRAY:
printf("Array \n");
break ;
case THASH:
printf("Hash \n");
break ;
case T
OBJECT:
printf("Object \n");
break ;
case TNIL:
printf("Nil \n");
break ;
case T
FIXNUM:
printf("Fnum \n");
break ;
case TBIGNUM:
printf("Bnum \n");
break ;
case T
CLASS:
printf("Class \n");
break ;/* */
default:
rbp(TYPE(RARRAYPTR(args)[offset]));
printf("index %d\n", offset);
}
}
} static VALUE my_init( VALUE self )
{
return self;
}

VALUE cMyClass;
void Initexampleext(void)
{

cMyClass = rbdefineclass("MyClass", rbcObject);
rb
definemethod(cMyClass, "initialize", myinit, 0);
rbdefinemethod(cMyClass, "mymeth", myfunc, -2);
}

cat probe.rb
require 'exampleext'
x = MyClass.new
WT = 0
win = File.new('test/proto.rb')
x.my
meth( nil, win, [], "sept", WT, x ) <<<<<<<< OK
x.my_meth( nil, win, [], "sept", x, WT ) <<<<<<<< BUT
probe.rb:6: [BUG] Stack consistency error (sp: 7, bp: 8)
ruby 1.9.2p0 (2010-08-18) [armv7l-linux-eabi]

-- control frame ----------
c:0003 p:0113 s:0007 b:0008 l:000244 d:001214 EVAL probe.rb:6
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:000244 d:000244 TOP


-- Ruby level backtrace information ----------------------------------------
probe.rb:6:in `'

-- C level backtrace information -------------------------------------------

Not had time to test this in x86 systems. Tried with ruby 1.9.2p0 (2010-08-18) and latest
stable tarball.
=end

History

#1 Updated by Nobuyoshi Nakada over 3 years ago

  • Status changed from Open to Feedback

=begin
I can't reproduce it with 1.9.2p430 and trunk on x86 darwin and linux, regardless fix of a bug that my_func() returns indefinite value.
=end

#2 Updated by Yui NARUSE almost 3 years ago

  • Status changed from Feedback to Assigned
  • Assignee set to Koichi Sasada

Do you have any information?

#3 Updated by Hiroshi Nakamura almost 3 years ago

  • Target version changed from 1.9.2 to 1.9.3

#4 Updated by Koichi Sasada almost 3 years ago

  • Status changed from Assigned to Rejected

Is it reproducible? If so, we'll reopen it.

Also available in: Atom PDF