-
Notifications
You must be signed in to change notification settings - Fork 63
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
Issue when "Array" is returned from an extension with "keepAlive" applied #193
Comments
I wonder if there's something going on between the interplay of |
Hi, @jasonroelofs Let me explain a background. I am trying to stabilize expressir gem. It has native extension is C++ generated by antlr4-native gem that uses Rice gem to wrap code generated by antlr4 parser generator. I have AnimalProxy in the sample because it resembles the structure of production code. There Animal is a virtual base class with its own hierarchy on top and AnimalProxy is a decorator that adds some functionality. If I remove AnimalProxy and return Animal itself it still crashes. |
If I can make a suggestion regarding the crash, here it follows:
The function above calls
However, in my sample |
I've played around with your example here and looked more into what you're doing and the intended use of Granted, it probably shouldn't crash at all, but I would need to look further into the nitty gritty of what's being stored here to figure out what's getting messed up (I'm guessing a value isn't getting marked for GC and is getting prematurely freed). Possibly something else is going on with the |
Thank you, @jasonroelofs
|
Fixed with #194 |
Hello, Rice developers.
Thank you very much for making a great library. It has always worked like charm after reading documentation but now I am facing an issue that I cannot explain.
This example is a minimized version of data structure generated by /~https://github.com/camertron/antlr4-native-rb[antlr4-native] gem
This code implements method(s) that return arrays of items created by and inside C++ extension like getPets and getPets2 functions. In my example getPets returns Rice::Array and getPets2 returns wrapped std::vector.
Both functions work until I apply Return.keepAlive(). With keepAlive the function that returns Rice::Array crashes
Any help will be much appreciated
Extension:
Spec:
Crash dump
Output withous GC.stress = true
The text was updated successfully, but these errors were encountered: