Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Strange Behavior

Reply
Thread Tools

Strange Behavior

 
 
Todd Phillips
Guest
Posts: n/a
 
      10-02-2003
The problem seems to be in c code calling ruby calling c code.

======== start test.rb
puts "about to require curses"
require "curses"
puts "curses loaded"
======== end test.rb
======== start simple.c
#include "ruby.h"

int main()
{
ruby_init();
ruby_init_loadpath();
rb_require("test.rb");
return 0;
}
======== end simple.c

$ ruby test.rb
about to require curses
curses loaded

$ gcc -o simple -I/usr/lib/ruby/1.6/i386-linux/ simple.c
-L/usr/lib/ruby/1.6/i386-linux/ -lruby -ldl -lcrypt -lm

$ ./simple
about to require curses
../test.rb:2: [BUG] Segmentation fault
ruby 1.6.7 (2002-03-19) [i386-linux]
Aborted



There is nothing special about the curses extension, this happens for any
extensions. I don't know what to do about this, and I'd appreciate any
help beyond the level of "re-install a new version of ruby" since I don't
have control over this distribution.

I've made this work on a Darwin6.6 machine, so I suspect there is some
disagreement between these guys:
$ gcc --version
2.96
$ ruby --version
ruby 1.6.7 (2002-03-19) [i386-linux]

Any ideas would be appreciated.
Thanks,
Todd
 
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
Thunderbird strange behavior... Jim Firefox 5 11-17-2005 03:09 PM
Firefox 1.04 and Strange Find Behavior Thomas Firefox 5 06-28-2005 08:40 PM
utf8 pragma - strange behavior ryang Perl 1 04-11-2005 05:38 AM
strange behavior when using 'read' sstark Perl 0 03-06-2005 02:27 AM
undefined behavior or not undefined behavior? That is the question Mantorok Redgormor C Programming 70 02-17-2004 02:46 PM



Advertisments