Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > extension problem with the one-click installer

Reply
Thread Tools

extension problem with the one-click installer

 
 
Jeff Mitchell
Guest
Posts: n/a
 
      06-18-2004

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 test.rb

test.rb:2: [BUG] Segmentation fault
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


 
Reply With Quote
 
 
 
 
Jeff Mitchell
Guest
Posts: n/a
 
      06-21-2004
To the one-click installer team (or anyone else), have you

(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-click 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 <(E-Mail Removed)> wrote in message news:<(E-Mail Removed) oo.com>...

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 test.rb

test.rb:2: [BUG] Segmentation fault
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) ;
}
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
gem native extension installer failure on winxp pro 64 system David Southwell Ruby 4 08-11-2008 10:12 PM
pywin32 vista installer fix & general distutils installer name bug Ville Vainio Python 0 04-09-2008 07:16 PM
Creating installer with external extension modules mhearne808[insert-at-sign-here]gmail[insert-dot-here]com Python 1 11-10-2007 12:16 AM
can distutils windows installer invoke another distutils windows installer timw.google Python 1 05-11-2006 10:07 PM
New extension? saw extension .emf is it safe to open Jer Computer Support 5 10-08-2005 04:43 PM



Advertisments