Actions
Bug #1205
closedSET_STACK_END crashes due to uninitialized ruby_current_thread
Bug #1205:
SET_STACK_END crashes due to uninitialized ruby_current_thread
Description
=begin
I ported ruby-1.9.1-p0 to Android. It built fine with a few patches and a custom Android.mk with a target of "miniruby."
The executable crashed at an early stage. I succeeded in tracing the crash to a null pointer reference to ruby_current_thread in SET_STACK_END (through GET_THREAD()) called in ruby_get_stack_grow_direction() called in STACK_UPPER() called in ruby_init_stack() called in Init_stack().
Reversing the calling order of Init_BareVM() and Init_stack in eval.c:ruby_init() seems to fix the problem.
Am I right?
Thanks,
hiro
ruby-1.9.1-p0/eval.c ====
*** 56,63 ****
rb_origenviron = environ;
Init_stack((void *)&state);
! Init_BareVM();
Init_heap();
PUSH_TAG();
--- 56,64 ----
rb_origenviron = environ;
-
Init_BareVM(); Init_stack((void *)&state);
! //Init_BareVM();
Init_heap();
PUSH_TAG();
=end
Actions