-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RB_GC_GUARD_PTR on non-GCC compilers fails to link #489
Comments
This is a pretty old section of the code. Do you know how long |
I was /guessing/ only since ruby-2.2 since I hit this trying to up our builds from ruby-2.1 to 2.2 It looks like you define RB_GC_GUARD to be a no-op if it doesn't exist (I was assuming backcompat there with pre-2.2 GCs) |
nope it exists in 2.1.8 as well, which confuses the hell out of me now... |
ah i see in 2.1.8 there used to be a rb_gc_guarded_ptr in this codepath so that RB_GC_GUARD_PTR would evaluate. it looks like in 2.2 they accepted a fix for RB_GC_GUARD that broke RB_GC_GUARD_PTR for AIX (possibly because it never worked?).
|
ruby/ruby@08252d1 is the commit that looks like it fixed RB_GC_GUARD and broke RB_GC_GUARD_PTR |
Yeah, fixed a segfault on the solaris compiler: https://bugs.ruby-lang.org/issues/7805 |
Since 2.0.0 has reached end of life, we should be okay with simply switching to |
I think the fix in the PR should be backcompat as well. Switching to a ruby array should allow RB_GC_GUARD to protect the array for as far back as that's needed, and the hack you've got to no-op RB_GC_GUARD if its not defined should go back even further. |
@tduehr |
I have no idea if this is an ffi bug or a ruby bug or both...
You use RB_GC_GUARD_PTR in at least a couple of places, e.g.:
ffi/ext/ffi_c/MethodHandle.c
Line 233 in 36c9248
ffi/ext/ffi_c/Function.c
Line 838 in eb12050
The ruby sources in in ruby.h have a comment which sort of implies maybe you shouldn't?
The ruby.h file then defines the various macros in this kinda nasty #ifdef mess here:
I'm compiling on AIX with XLC and not GCC so for me this becomes:
Now the cool thing here is that the symbol rb_gc_guarded_ptr is only defined in that GNUC block, so this is guaranteed to blow up on any non-GCC/non-MSC install if anyone ever uses RB_GC_GUARD_PTR directly.
So can you just s/RB_GC_GUARD_PTR/RB_GC_GUARD/g and it'll work correctly, or is there a reason why you're trying to access that macro directly?
The text was updated successfully, but these errors were encountered: