rubyforgood / human-essentials

Human Essentials is an inventory management system for diaper, incontinence, and period-supply banks. It supports them in distributing to partners, tracking inventory, and reporting stats and analytics.
https://humanessentials.app
MIT License
436 stars 450 forks source link

fix: remove mini_racer to prevent segfaults (and because we don't use it) #4478

Open elasticspoon opened 5 days ago

elasticspoon commented 5 days ago

Currently when I run rails assets:precompile the application segfaults.

$ > rails assets:precompile
/home/bandito/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/mini_racer-0.12.0/lib/mini_racer.rb:228: [BUG] Segmentation fault at 0x00007ff911d85008
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0064 p:---- s:0428 e:000427 CFUNC  :eval_unsafe
c:0063 p:0009 s:0422 e:000421 BLOCK  /home/bandito/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/mini_racer-0.12.0/lib/mini_racer.rb:228
c:0062 p:0010 s:0419 e:000418 METHOD /home/bandito/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/mini_racer-0.12.0/lib/mini_racer.rb:348
c:0061 p:0008 s:0408 e:000407 BLOCK  /home/bandito/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/mini_racer-0.12.0/lib/mini_racer.rb:227 [FINISH]
c:0060 p:---- s:0405 e:000404 CFUNC  :synchronize
c:0059 p:0045 s:0401 e:000400 METHOD /home/bandito/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/mini_racer-0.12.0/lib/mini_racer.rb:225
c:0058 p:0007 s:0394 e:000393 BLOCK  /home/bandito/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/execjs-2.9.1/lib/execjs/mini_racer_runtime.rb:11
c:0057 p:0003 s:0391 e:000389 METHOD /home/bandito/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/execjs-2.9.1/lib/execjs/mini_racer_runtime.rb:67
c:0056 p:0035 s:0383 e:000382 METHOD /home/bandito/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/execjs-2.9.1/lib/execjs/mini_racer_runtime.rb:10 [FINISH]
c:0055 p:---- s:0376 e:000375 CFUNC  :new
c:0054 p:0038 s:0369 e:000368 METHOD /home/bandito/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/execjs-2.9.1/lib/execjs/runtime.rb:68
c:0053 p:0013 s:0363 e:000362 METHOD /home/bandito/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/execjs-2.9.1/lib/execjs/module.rb:27

This seems to be related to mini_racer. The easiest solution is to downgrade to a version of mini_racer without these issues. Just kidding, we aren't using it so we might as well remove it!

See https://github.com/rubyjs/mini_racer/issues/300 for more info.

dorner commented 2 days ago

@elasticspoon I don't think we need mini_racer in the Gemfile at all. I don't think it's used anywhere. Try removing it and see if anything breaks. :)

elasticspoon commented 2 days ago

@dorner you are right. I did not expect that.