"Simon Strandgaard" <0bz63fz3m1qt3001 / sneakemail.com>
>
> Can you post the whole program, then I will see what I can do ?

Try commenting out the line marked by <===== below.
Thanks again.
-- shanko
//----------------------------------------------------------------

#include <ruby.h>

int main(int Argc, char **Argv) {

  int argc;
  VALUE argv[2];
  VALUE klass;
  VALUE instance;

  ruby_init();
  Init_stack(&argc); // tell GC the machine stack limit.


  argv[0] = INT2FIX(5);
  argc    = 2;


  klass    = rb_path2class("Array");
  argv[1]  = rb_str_new2("hello");
  instance = rb_class_new_instance(argc, argv, klass);
  rb_p(instance);

 // Uncommenting the next line will cause the program to crash
 // klass = rb_const_get(rb_cObject, rb_intern("Array")); <=====
 argv[1] = rb_str_new2("world");
 instance= rb_funcall2(klass, rb_intern("new"), argc, argv);

 //No need, see [ruby-talk 74400]
 //rb_gc_register_address(&instance);

 rb_p(instance);

 ruby_finalize();
 return 0;

}
//-------------------------------------------------------------------