emberb icon indicating copy to clipboard operation
emberb copied to clipboard

Embedding Ruby 3.4 now definitely requires `RUBY_INIT_STACK`

Open jasonroelofs opened this issue 1 year ago • 0 comments

Hey. I'm a maintainer of Rice (https://github.com/ruby-rice/rice) and we ran into some weird segfaults with Ruby 3.4 in our test suite that embeds ruby. Over the years I've definitely struggled to find the docs that say exactly what needs to happen to make sure Ruby is set up and running properly in an embedded context, so thanks for all the work you've done to make that easier to find!

But back to Ruby 3.4, after a lot of head scratching I finally noticed that Ruby's main calls RUBY_INIT_STACK, and when I looked at the documentation of that macro, turns out it is really important! And nothing in libruby calls it.

I would love for someone to confirm so here's a gist showing a minimal reproducible example: https://gist.github.com/jasonroelofs/6453cc270ab8c60fca72029b47e6f7d7

Thanks!

jasonroelofs avatar Jan 28 '25 01:01 jasonroelofs