J
Jeff Mitchell
Could someone confirm the following segfault for the one-click Windows
installer (ruby181-13.exe). It occurs for the extension compiled with
mingw32-gcc and with VC++ 6.0 SP5.
There is no problem for a homebuilt ruby from the 1.8.1 standard
tarball with either mingw32-gcc or VC++.
ruby 1.8.1 (2003-12-25) [i386-mswin32]
-----------------------------------
# extconf.rb:
require 'mkmf'
create_makefile("myclass")
-----------------------------------
# test.rb
require './myclass.so'
loop { MyClass.new }
-----------------------------------
// myclass.c
#include "ruby.h"
struct MyStruct_
{
int n ;
} ;
typedef struct MyStruct_ MyStruct ;
void myclass_free(MyStruct* data)
{
free(data) ;
}
VALUE rb_myclass_initialize( VALUE self )
{
return Qnil ;
}
static VALUE rb_myclass_s_allocate(VALUE klass)
{
MyStruct* data ;
VALUE obj = Data_Make_Struct(klass,
MyStruct,
0,
myclass_free,
data) ;
return obj ;
}
VALUE cMyClass ;
void Init_myclass()
{
cMyClass = rb_define_class("MyClass", rb_cObject) ;
rb_define_alloc_func(cMyClass, rb_myclass_s_allocate) ;
rb_define_method(cMyClass, "initialize", rb_myclass_initialize, 0) ;
}
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail
installer (ruby181-13.exe). It occurs for the extension compiled with
mingw32-gcc and with VC++ 6.0 SP5.
There is no problem for a homebuilt ruby from the 1.8.1 standard
tarball with either mingw32-gcc or VC++.
test.rb:2: [BUG] Segmentation faultruby test.rb
ruby 1.8.1 (2003-12-25) [i386-mswin32]
-----------------------------------
# extconf.rb:
require 'mkmf'
create_makefile("myclass")
-----------------------------------
# test.rb
require './myclass.so'
loop { MyClass.new }
-----------------------------------
// myclass.c
#include "ruby.h"
struct MyStruct_
{
int n ;
} ;
typedef struct MyStruct_ MyStruct ;
void myclass_free(MyStruct* data)
{
free(data) ;
}
VALUE rb_myclass_initialize( VALUE self )
{
return Qnil ;
}
static VALUE rb_myclass_s_allocate(VALUE klass)
{
MyStruct* data ;
VALUE obj = Data_Make_Struct(klass,
MyStruct,
0,
myclass_free,
data) ;
return obj ;
}
VALUE cMyClass ;
void Init_myclass()
{
cMyClass = rb_define_class("MyClass", rb_cObject) ;
rb_define_alloc_func(cMyClass, rb_myclass_s_allocate) ;
rb_define_method(cMyClass, "initialize", rb_myclass_initialize, 0) ;
}
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail