Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6102189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:35:09+00:00 2026-05-23T13:35:09+00:00

I downloaded the lasted stable ruby source code from the ruby website (1.9.2-p180) and

  • 0

I downloaded the lasted stable ruby source code from the ruby website (1.9.2-p180) and compiled it on Windows with MinGW 4.5.2-TDM and MSYS. To compile I ran sh configure and make. I got msvcrt-ruby191.dll and libmsvcrt-ruby191.dll.a exactly as expected. Then I wrote this code:

#include <ruby.h>
int main() {
  ruby_init();
  rb_funcall2(Qnil, rb_intern("p"), 1, (VALUE[]){INT2FIX(0)});
  ruby_finalize();
}

I compiled with g++, linking to the ruby’s dll. When I ran the executable, I got this error message:

<main>: [BUG] Segmentation fault
ruby 1.9.2p180 (2011-02-18 revision 30909) [i386-mingw32]

-- control frame ----------
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 CFUNC  :p
c:0001 p:0000 s:0002 b:0002 l:00120c d:00120c TOP
---------------------------
-- Ruby level backtrace information ----------------------------------------
ruby:0:in `p'

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html


This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

The problem is: The same code works perfectly when linked with the ruby 1.8.7. What is wrong here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:35:09+00:00Added an answer on May 23, 2026 at 1:35 pm

    Please, try to extend your init to this:

    int main(int argc,char *argv[]) {
      ruby_sysinit(&argc, &argv);
      {
        RUBY_INIT_STACK;
        ruby_init();
        ruby_init_loadpath();
        // ... code
        ruby_finalize();
      }
      return 0; //from main()
    }
    

    The initialization process was changed between 1.8 and 1.9 versions, so adding a separate nested block { .. } and a RUBY_INIT_STACK macro in the block are needed now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently downloaded the source tarball for a GTK application that I'd like to
I downloaded the jquery files and tried to include them in my Site.Master, and
I have just downloaded and installed the 'facebook status' module and 'user feedback' module
I was very surprised when downloaded two imageboard php scripts. There is no connection
ok I downloaded sphinx-0.9.9.tar.gz to my desktop I extracted to a folder called sphinx
I need a light css editor with certain functions. Already downloaded and tried a
I'm learning C++ using Vim as an editor on Windows XP, however I found
Can anyone help with an odd Ruby Gem problem I'm having - note I've
I've been having quite a difficult time extracting ID3 information from an MP3 being
I've installed Google Analytics on my website, and I want to now use '

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.