|
|||||
|
|
#1 |
|
|
Could someone confirm the following segfault for the one-c**** 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 test.rb test.rb:2: [BUG] Segmentation fault ruby 1.8.1 (2003-12-25) [i386-mswin32] ----------------------------------- # extconf.rb: require 'mkmf' create_makefile("mycl***") ----------------------------------- # test.rb require './mycl***.so' loop { MyCl***.new } ----------------------------------- // mycl***.c #include "ruby.h" struct MyStruct_ { int n ; } ; typedef struct MyStruct_ MyStruct ; void mycl***_free(MyStruct* data) { free(data) ; } VALUE rb_mycl***_initialize( VALUE self ) { return Qnil ; } static VALUE rb_mycl***_s_allocate(VALUE kl***) { MyStruct* data ; VALUE obj = Data_Make_Struct(kl***, MyStruct, 0, mycl***_free, data) ; return obj ; } VALUE cMyCl*** ; void Init_mycl***() { cMyCl*** = rb_define_cl***("MyCl***", rb_cObject) ; rb_define_alloc_func(cMyCl***, rb_mycl***_s_allocate) ; rb_define_method(cMyCl***, "initialize", rb_mycl***_initialize, 0) ; } __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail |
|
|
#2 |
|
|
(1) Confirmed the bug by compiling the extension with VC++ 6.0 SP5? (2) ditto with mingw32? (3) what happened when you compiled the extension with VS.NET? (4) Try (1)-(3) using ruby compiled with VS.NET without runtime 7.1 Without a VS.NET compiler, I can only confirm (1) and (2), and that the bug is not present when the interpreter is built with mingw32 or with VC++ 6.0. But whether or not this bug is related to the 7.1 runtime (it probably is), using a different runtime can't be a good thing. Ruby-win32 has deliberately chosen the msvcrt.dll runtime -- both the VC++ and mingw32 builds use it -- in order to make extensions compatible. But the one-c**** installer is not using it, and (surprise) extensions are not compatible. Could you just use msvcrt.dll, please? If you must use VS.NET, it can be configured to create executables which do not depend on msvcrt71.dll. Jeff ---original message--- Jeff Mitchell <quixoticsycophant@yahoo.com> wrote in message news:<20040618104140.62332.qmail@web60909.mail.yah oo.com>... Could someone confirm the following segfault for the one-c**** 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 test.rb test.rb:2: [BUG] Segmentation fault ruby 1.8.1 (2003-12-25) [i386-mswin32] ----------------------------------- # extconf.rb: require 'mkmf' create_makefile("mycl***") ----------------------------------- # test.rb require './mycl***.so' loop { MyCl***.new } ----------------------------------- // mycl***.c #include "ruby.h" struct MyStruct_ { int n ; } ; typedef struct MyStruct_ MyStruct ; void mycl***_free(MyStruct* data) { free(data) ; } VALUE rb_mycl***_initialize( VALUE self ) { return Qnil ; } static VALUE rb_mycl***_s_allocate(VALUE kl***) { MyStruct* data ; VALUE obj = Data_Make_Struct(kl***, MyStruct, 0, mycl***_free, data) ; return obj ; } VALUE cMyCl*** ; void Init_mycl***() { cMyCl*** = rb_define_cl***("MyCl***", rb_cObject) ; rb_define_alloc_func(cMyCl***, rb_mycl***_s_allocate) ; rb_define_method(cMyCl***, "initialize", rb_mycl***_initialize, 0) ; } |