You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running crystal code spawns a lot of crystal processes which looks like fork bomb and within few second I'm out of RAM. I didn't have time to try to troubleshoot nor analyze crystalruby code.
spawned more than 40 processes (ps -ax | grep crystal):
after exiting ruby process and killing crystal processes ruby stack:
from /home/olek/.rvm/gems/ruby-3.1.2/gems/crystalruby-0.2.0/lib/crystalruby/compilation.rb:17:in `compile!'
from /home/olek/.rvm/gems/ruby-3.1.2/gems/crystalruby-0.2.0/lib/crystalruby/library.rb:157:in `block in build!'
from /home/olek/.rvm/gems/ruby-3.1.2/gems/crystalruby-0.2.0/lib/crystalruby/library.rb:150:in `synchronize'
from /home/olek/.rvm/gems/ruby-3.1.2/gems/crystalruby-0.2.0/lib/crystalruby/library.rb:150:in `build!'
from /home/olek/.rvm/gems/ruby-3.1.2/gems/crystalruby-0.2.0/lib/crystalruby/function.rb:34:in `block (2 levels) in define_crystalized_methods!'
from /home/olek/.rvm/gems/ruby-3.1.2/gems/crystalruby-0.2.0/lib/crystalruby/function.rb:35:in `block (2 levels) in define_crystalized_methods!'
from /home/olek/.rvm/gems/ruby-3.1.2/gems/crystalruby-0.2.0/lib/crystalruby/function.rb:35:in `block (2 levels) in define_crystalized_methods!'
from /home/olek/.rvm/gems/ruby-3.1.2/gems/crystalruby-0.2.0/lib/crystalruby/function.rb:35:in `block (2 levels) in define_crystalized_methods!'
from /home/olek/.rvm/gems/ruby-3.1.2/gems/crystalruby-0.2.0/lib/crystalruby/function.rb:35:in `block (2 levels) in define_crystalized_methods!'
from /home/olek/.rvm/gems/ruby-3.1.2/gems/crystalruby-0.2.0/lib/crystalruby/function.rb:35:in `block (2 levels) in define_crystalized_methods!'
...
sample code which leads to error:
require 'crystalruby'
module MyTestModule
# The below method will be replaced by a compiled Crystal version
# linked using FFI.
crystalize [a: :int, b: :int] => :int
def add(a, b)
a + b
end
end
# This method is run in Crystal, not Ruby!
MyTestModule.add(1, 2) # => 3
Used on ruby 3.3 and 3.1.2, crystal 1.12.1 on gnu/debian.
The text was updated successfully, but these errors were encountered:
Thank you for your report @akwiatkowski, I was able to reproduce the behaviour on a system running Debian 12, and have pushed version 0.2.3 which appears to address the issue (seems mishandling of compilation process output was causing the Ruby code to progress prematurely before the compiled assets were ready, causing infinite recursion).
hello.
Running crystal code spawns a lot of crystal processes which looks like fork bomb and within few second I'm out of RAM. I didn't have time to try to troubleshoot nor analyze crystalruby code.
spawned more than 40 processes (
ps -ax | grep crystal
):after exiting ruby process and killing crystal processes ruby stack:
sample code which leads to error:
Used on ruby 3.3 and 3.1.2, crystal 1.12.1 on gnu/debian.
The text was updated successfully, but these errors were encountered: