rutie icon indicating copy to clipboard operation
rutie copied to clipboard

Anything that involves accessing RbConfig fails with EXC BAD ACCESS

Open lockieluke opened this issue 1 year ago • 1 comments

Minimal reproducible:

use rutie::{Module, VM};

fn main() {
    VM::init();

    let rbconfig = Module::from_existing("RbConfig");
    println!("{:?}", rbconfig);

    VM::exit(0);
}

Logs: image

Anything from require 'rbconfig' would fail with the same error, it did work at some point.

I have been using the macOS default Ruby from the very beginning and it does support SHARED

lockieluke avatar Apr 12 '24 14:04 lockieluke

Can confirm if you load rbconfig with its absolute path, it'll work:

VM::require("/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin23/rbconfig.rb");
let bin_dir = unsafe { Module::from_existing("RbConfig").const_get("CONFIG").send("[]", &[RString::from("bindir").into()]).try_convert_to::<RString>().unwrap().to_string() };
println!("{}", bin_dir);

Output:

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin

lockieluke avatar Apr 12 '24 14:04 lockieluke