Strange Behavior

Discussion in 'Ruby' started by Todd Phillips, Oct 2, 2003.

  1. 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
     
    Todd Phillips, Oct 2, 2003
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sstark
    Replies:
    0
    Views:
    504
    sstark
    Mar 6, 2005
  2. ryang
    Replies:
    1
    Views:
    1,050
    Wes Groleau
    Apr 11, 2005
  3. Apogee

    Strange Behavior with ViewState

    Apogee, Jul 3, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    385
    Apogee
    Jul 3, 2003
  4. PJ

    DropDownList Strange Behavior

    PJ, Jul 8, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    386
  5. Mantorok Redgormor
    Replies:
    70
    Views:
    1,999
    Dan Pop
    Feb 17, 2004
Loading...

Share This Page