Skip to content
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

warning: undefining the allocator of T_DATA class FFI_Yajl::Ext::Encoder::YajlGen #123

Open
conathan opened this issue Mar 13, 2024 · 1 comment
Labels
Status: Untriaged An issue that has yet to be triaged.

Comments

@conathan
Copy link

Version 2.6.0

AlmaLinux 8/9, Ruby 3.2.3 installed via RVM

When we upgraded from using cinc-client 18.3.0 from Ruby 3.1.4 to Ruby 3.2.3, we started getting the following warning:

/usr/lib/rvm/gems/ruby-3.2.3@cinc/gems/ffi-yajl-2.6.0/lib/ffi_yajl/encoder.rb:42: warning: undefining the allocator of T_DATA class FFI_Yajl::Ext::Encoder::YajlGen

I suspect it has to do with https://bugs.ruby-lang.org/issues/18007, added to Ruby 3.2 branch.

@conathan conathan added the Status: Untriaged An issue that has yet to be triaged. label Mar 13, 2024
@conathan
Copy link
Author

conathan commented Aug 4, 2024

Believe this would resolve it

diff -Naurp ffi-yajl-2.6.0.orig/ext/ffi_yajl/ext/encoder/encoder.c ffi-yajl-2.6.0/ext/ffi_yajl/ext/encoder/encoder.c
--- ffi-yajl-2.6.0.orig/ext/ffi_yajl/ext/encoder/encoder.c      2023-07-19 11:39:18.000000000 -0700
+++ ffi-yajl-2.6.0/ext/ffi_yajl/ext/encoder/encoder.c   2024-08-03 18:25:08.174714852 -0700
@@ -360,6 +360,9 @@ void Init_encoder() {
   mExt = rb_define_module_under(mFFI_Yajl, "Ext");
   mEncoder = rb_define_module_under(mExt, "Encoder");
   cYajl_Gen = rb_define_class_under(mEncoder, "YajlGen", rb_cObject);
+  // BN Begin - Fixes undefining the allocator of T_DATA class FFI_Yajl::Ext::Encoder::YajlGen
+  rb_undef_alloc_func(cYajl_Gen);
+  // BN End - Fixes undefining the allocator of T_DATA class FFI_Yajl::Ext::Encoder::YajlGen
   rb_define_method(mEncoder, "do_yajl_encode", mEncoder_do_yajl_encode, 3);

   /* use rb_const_get instead of rb_define_class so that we don't get superclass mismatches */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Untriaged An issue that has yet to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant