Segmentation fault at raise exception.

Discussion in 'Ruby' started by O01eg Oleg, Apr 24, 2010.

  1. O01eg Oleg

    O01eg Oleg Guest

    I get segfault at any Ruby exception with C API:

    (gdb) bt
    #0 0x00007ffff58ebd78 in siglongjmp () from /lib/libc.so.6
    #1 0x00007ffff719d3e7 in rb_longjmp (tag=6, mesg=6652280) at eval.c:442
    #2 0x00007ffff719d422 in rb_exc_raise (mesg=6652280) at eval.c:453
    #3 0x00007ffff719a380 in rb_raise (exc=6723760,
    fmt=0x7ffff72dc28c "no such file to load -- %s") at error.c:1172

    It's caused because GET_THREAD()->tag equal to 0x0.
    --
    Posted via http://www.ruby-forum.com/.
     
    O01eg Oleg, Apr 24, 2010
    #1
    1. Advertising

  2. O01eg Oleg

    O01eg Oleg Guest

    It's a initialization code:

    int ruby_argc = 1;
    char* ruby_argv[ruby_argc];
    ruby_argv[0] = "";
    char** r_argv = ruby_argv;
    Logger::Instance().Log(L"Ruby starting");
    ruby_sysinit(&ruby_argc, &r_argv);
    Logger::Instance().Log(L"Ruby: Call RUBY_INIT_STACK");
    RUBY_INIT_STACK;
    Logger::Instance().Log(L"Ruby: Call ruby_init");
    ruby_init();
    Logger::Instance().Log(L"Ruby: Call ruby_init_loadpath");
    ruby_init_loadpath();
    Logger::Instance().Log(L"Ruby started");


    --
    Posted via http://www.ruby-forum.com/.
     
    O01eg Oleg, Apr 24, 2010
    #2
    1. Advertising

  3. O01eg Oleg

    O01eg Oleg Guest

    O01eg Oleg, Apr 24, 2010
    #3
  4. O01eg Oleg

    O01eg Oleg Guest

    O01eg Oleg, Apr 24, 2010
    #4
  5. O01eg Oleg

    O01eg Oleg Guest

    O01eg Oleg, Apr 24, 2010
    #5
  6. O01eg Oleg

    O01eg Oleg Guest

    Yukihiro Matsumoto wrote:
    > You have to wrap every call for Ruby related (possibly exception
    > raising) functions, e.g. rb_require, rb_eval_string, etc.


    Can I use

    PUSH_TAG;
    rb_requir(...)
    rb_eval_string(...)
    POP_TAG;

    instead

    PUSH_TAG;
    rb_require(...)
    POP_TAG;
    PUSH_TAG;
    rb_eval_string(...)
    POP_TAG;
    --
    Posted via http://www.ruby-forum.com/.
     
    O01eg Oleg, Apr 24, 2010
    #6
  7. O01eg Oleg

    O01eg Oleg Guest

    O01eg Oleg, Apr 24, 2010
    #7
    1. Advertising

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. Ivan Vecerina
    Replies:
    0
    Views:
    489
    Ivan Vecerina
    Jun 29, 2003
  2. Jacol

    raise or not to raise [Newbie]

    Jacol, Feb 3, 2007, in forum: Python
    Replies:
    5
    Views:
    410
    Gabriel Genellina
    Feb 5, 2007
  3. ernest
    Replies:
    2
    Views:
    295
    Roy Smith
    Nov 14, 2010
  4. Jack Bates
    Replies:
    0
    Views:
    282
    Jack Bates
    May 2, 2011
  5. bvdp

    Raise X or Raise X()?

    bvdp, Mar 11, 2012, in forum: Python
    Replies:
    10
    Views:
    374
    Stefan Behnel
    Mar 12, 2012
Loading...

Share This Page