Repository navigation
Closed
Labels
bug/crashBugs specific to crashes, segfaults, etc. Gem can be installed though.
Description
Hello the team
Thank you for the update to libv8-node 21.7.2.0 yesterday.
I wanted to report an error.
Setup:
- mini_racer 0.12.0
- libv8-node 21.7.2.0
- ruby 3.2.3
- OS: Ubuntu 22.04.3 LTS (from CircleCI cimg/ruby:3.2.3-node)
- Rails: 6.1.7.7
- Sprockets: 4.2.1
- The command:
RAILS_ENV=production SECRET_KEY_BASE=1 bin/rails assets:clobber assets:precompile
/home/circleci/ec/vendor/ruby/3.2.0/gems/mini_racer-0.12.0/lib/mini_racer.rb:228: [BUG] Segmentation fault at 0x00007f3f10a31008
ruby 3.2.3 (2024-01-18 revision 52bb2ac0a6) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0048 p:---- s:0301 e:000300 CFUNC :eval_unsafe
c:0047 p:0009 s:0295 e:000294 BLOCK /home/circleci/repo/vendor/ruby/3.2.0/gems/mini_racer-0.12.0/lib/mini_racer.rb:228
c:0046 p:0010 s:0292 e:000291 METHOD /home/circleci/repo/vendor/ruby/3.2.0/gems/mini_racer-0.12.0/lib/mini_racer.rb:348
c:0045 p:0008 s:0281 e:000280 BLOCK /home/circleci/repo/vendor/ruby/3.2.0/gems/mini_racer-0.12.0/lib/mini_racer.rb:227 [FINISH]
c:0044 p:---- s:0278 e:000277 CFUNC :synchronize
c:0043 p:0045 s:0274 e:000273 METHOD /home/circleci/repo/vendor/ruby/3.2.0/gems/mini_racer-0.12.0/lib/mini_racer.rb:225
c:0042 p:0007 s:0267 e:000266 BLOCK /home/circleci/repo/vendor/ruby/3.2.0/gems/execjs-2.9.1/lib/execjs/mini_racer_runtime.rb:11
c:0041 p:0003 s:0264 e:000262 METHOD /home/circleci/repo/vendor/ruby/3.2.0/gems/execjs-2.9.1/lib/execjs/mini_racer_runtime.rb:67
c:0040 p:0035 s:0256 e:000255 METHOD /home/circleci/repo/vendor/ruby/3.2.0/gems/execjs-2.9.1/lib/execjs/mini_racer_runtime.rb:10 [FINISH]
c:0039 p:---- s:0249 e:000248 CFUNC :new
c:0038 p:0038 s:0242 e:000241 METHOD /home/circleci/repo/vendor/ruby/3.2.0/gems/execjs-2.9.1/lib/execjs/runtime.rb:68
c:0037 p:0013 s:0236 e:000235 METHOD /home/circleci/repo/vendor/ruby/3.2.0/gems/execjs-2.9.1/lib/execjs/module.rb:27
c:0036 p:0020 s:0230 e:000229 METHOD /home/circleci/repo/vendor/ruby/3.2.0/gems/terser-1.2.2/lib/terser.rb:189
c:0035 p:0065 s:0223 e:000221 METHOD /home/circleci/repo/vendor/ruby/3.2.0/gems/terser-1.2.2/lib/terser.rb:229
SEGV received in SEGV handler
c:0034 p:0014 s:0212 e:000211 METHOD /home/circleci/repo/vendor/ruby/3.2.0/gems/terser-1.2.2/lib/terser.rb:181
c:0033 p:0029 s:0206 e:000205 METHOD /home/circleci/repo/vendor/ruby/3.2.0/gems/terser-1.2.2/lib/terser/compressor.rb:36
c:0032 p:0007 s:0198 e:000197 METHOD /home/circleci/repo/vendor/ruby/3.2.0/gems/terser-1.2.2/lib/terser/compressor.rb:23
c:0031 p:0047 s:0193 e:000192 METHOD /home/circleci/repo/vendor/ruby/3.2.0/gems/sprockets-4.2.1/lib/sprockets/processor_utils.rb:84
c:0030 p:0013 s:0185 e:000184 BLOCK /home/circleci/repo/vendor/ruby/3.2.0/gems/sprockets-4.2.1/lib/sprockets/processor_utils.rb:66 [FINISH]
c:0029 p:---- s:0180 e:000179 CFUNC :reverse_each
c:0028 p:0035
Received "aborted" signal
It does work on Darwin Kernel Version 23.2.0 arm64 (Mac on arm) that compile from source.
The error is from eval -> eval_unsafe, so I suspect it is an issue with the libv8-node
Line 228 in 5b2a25c
| eval_unsafe(str, filename) |
Reacted by Josh Priollaud, Anton, Justin Léger, Emil Ong, Wyatt Ades, Denis Jean, Dmitry Polushkin, Bèr Kessels and Jorge Giunta
Metadata
Metadata
Assignees
Labels
bug/crashBugs specific to crashes, segfaults, etc. Gem can be installed though.
Activity
tisba commentedon Apr 23, 2024
Hey @D-system. A couple of question hopefully helping to narrow the issue down
Can you reproduce it with a freshly created rails application? On
aarch64-linuxmy basic checks works, as well asrails new foo && cd foo && bundle install && RAILS_ENV=production SECRET_KEY_BASE=1 bin/rails assets:clobber assets:precompileusingcimg/ruby:3.2.3-node.Can you reproduce the issue with Ruby 3.3.0?
Can you confirm if you're using jemalloc or not? Looks like the image is at least installing libjemalloc, I haven't checked if they build Ruby against it, or using
LD_PRELOAD, or using this up to the user. There have been various issues with jemalloc and mini_racer/v8. In case jemalloc is used, can you try without?D-system commentedon Apr 23, 2024
I don't think jemalloc is enabled:
$ ruby -r rbconfig -e "puts RbConfig::CONFIG['MAINLIBS']" -lz -lrt -lrt -ldl -lcrypt -lm -lpthreadEven by using the
LD_PRELOAD, it does not seems to work:Let me see if I can make a new app and get the same error.
I didn't realized there was a more debug output:
Details
```-- Ruby level backtrace information ----------------------------------------
/home/circleci/repo/vendor/ruby/3.2.0/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:340:in
block in create_worker' /home/circleci/repo/vendor/ruby/3.2.0/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:340:incatch'/home/circleci/repo/vendor/ruby/3.2.0/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:341:in
block (2 levels) in create_worker' /home/circleci/repo/vendor/ruby/3.2.0/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:341:inloop'/home/circleci/repo/vendor/ruby/3.2.0/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:350:in
block (3 levels) in create_worker' /home/circleci/repo/vendor/ruby/3.2.0/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:359:inrun_task'/home/circleci/repo/vendor/ruby/3.2.0/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/promise.rb:564:in
block in realize' /home/circleci/repo/vendor/ruby/3.2.0/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:22:inexecute'/home/circleci/repo/vendor/ruby/3.2.0/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:48:in
synchronize' /home/circleci/repo/vendor/ruby/3.2.0/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:48:insynchronize'/home/circleci/repo/vendor/ruby/3.2.0/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:48:in
block in synchronize' /home/circleci/repo/vendor/ruby/3.2.0/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:24:inblock in execute'/home/circleci/repo/vendor/ruby/3.2.0/gems/sprockets-4.2.1/lib/sprockets/manifest.rb:125:in
block (2 levels) in find' /home/circleci/repo/vendor/ruby/3.2.0/gems/sprockets-4.2.1/lib/sprockets/manifest.rb:125:into_a'/home/circleci/repo/vendor/ruby/3.2.0/gems/sprockets-4.2.1/lib/sprockets/manifest.rb:125:in
each' /home/circleci/repo/vendor/ruby/3.2.0/gems/sprockets-4.2.1/lib/sprockets/base.rb:88:infind_all_linked_assets'/home/circleci/repo/vendor/ruby/3.2.0/gems/sprockets-4.2.1/lib/sprockets/base.rb:81:in
find_asset' /home/circleci/repo/vendor/ruby/3.2.0/gems/sprockets-4.2.1/lib/sprockets/cached_environment.rb:44:inload'/home/circleci/repo/vendor/ruby/3.2.0/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/map.rb:206:in
fetch_or_store' /home/circleci/repo/vendor/ruby/3.2.0/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/map.rb:187:infetch'/home/circleci/repo/vendor/ruby/3.2.0/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/map.rb:207:in
block in fetch_or_store' /home/circleci/repo/vendor/ruby/3.2.0/gems/sprockets-4.2.1/lib/sprockets/cached_environment.rb:44:inblock in load'/home/circleci/repo/vendor/ruby/3.2.0/gems/sprockets-4.2.1/lib/sprockets/loader.rb:43:in
load' /home/circleci/repo/vendor/ruby/3.2.0/gems/sprockets-4.2.1/lib/sprockets/loader.rb:339:infetch_asset_from_dependency_cache'/home/circleci/repo/vendor/ruby/3.2.0/gems/sprockets-4.2.1/lib/sprockets/loader.rb:59:in
block in load' /home/circleci/repo/vendor/ruby/3.2.0/gems/sprockets-4.2.1/lib/sprockets/loader.rb:184:inload_from_unloaded'/home/circleci/repo/vendor/ruby/3.2.0/gems/sprockets-4.2.1/lib/sprockets/processor_utils.rb:65:in
call_processors' /home/circleci/repo/vendor/ruby/3.2.0/gems/sprockets-4.2.1/lib/sprockets/processor_utils.rb:65:inreverse_each'/home/circleci/repo/vendor/ruby/3.2.0/gems/sprockets-4.2.1/lib/sprockets/processor_utils.rb:66:in
block in call_processors' /home/circleci/repo/vendor/ruby/3.2.0/gems/sprockets-4.2.1/lib/sprockets/processor_utils.rb:84:incall_processor'/home/circleci/repo/vendor/ruby/3.2.0/gems/terser-1.2.2/lib/terser/compressor.rb:23:in
call' /home/circleci/repo/vendor/ruby/3.2.0/gems/terser-1.2.2/lib/terser/compressor.rb:36:incall'/home/circleci/repo/vendor/ruby/3.2.0/gems/terser-1.2.2/lib/terser.rb:181:in
compile_with_map' /home/circleci/repo/vendor/ruby/3.2.0/gems/terser-1.2.2/lib/terser.rb:229:inrun_terserjs'/home/circleci/repo/vendor/ruby/3.2.0/gems/terser-1.2.2/lib/terser.rb:189:in
context' /home/circleci/repo/vendor/ruby/3.2.0/gems/execjs-2.9.1/lib/execjs/module.rb:27:incompile'/home/circleci/repo/vendor/ruby/3.2.0/gems/execjs-2.9.1/lib/execjs/runtime.rb:68:in
compile' /home/circleci/repo/vendor/ruby/3.2.0/gems/execjs-2.9.1/lib/execjs/runtime.rb:68:innew'/home/circleci/repo/vendor/ruby/3.2.0/gems/execjs-2.9.1/lib/execjs/mini_racer_runtime.rb:10:in
initialize' /home/circleci/repo/vendor/ruby/3.2.0/gems/execjs-2.9.1/lib/execjs/mini_racer_runtime.rb:67:intranslate'/home/circleci/repo/vendor/ruby/3.2.0/gems/execjs-2.9.1/lib/execjs/mini_racer_runtime.rb:11:in
block in initialize' /home/circleci/repo/vendor/ruby/3.2.0/gems/mini_racer-0.12.0/lib/mini_racer.rb:225:ineval'/home/circleci/repo/vendor/ruby/3.2.0/gems/mini_racer-0.12.0/lib/mini_racer.rb:225:in
synchronize' /home/circleci/repo/vendor/ruby/3.2.0/gems/mini_racer-0.12.0/lib/mini_racer.rb:227:inblock in eval'/home/circleci/repo/vendor/ruby/3.2.0/gems/mini_racer-0.12.0/lib/mini_racer.rb:348:in
timeout' /home/circleci/repo/vendor/ruby/3.2.0/gems/mini_racer-0.12.0/lib/mini_racer.rb:228:inblock (2 levels) in eval'/home/circleci/repo/vendor/ruby/3.2.0/gems/mini_racer-0.12.0/lib/mini_racer.rb:228:in `eval_unsafe'
-- Machine register context ------------------------------------------------
RIP: 0x00007f97ea8d24e7 RBP: 0x00007f977fefa220 RSP: 0x00007f977fefa1e0
RAX: 0x00007f97edbd1000 RBX: 0x00007f96ec003000 RCX: 0x0000000000001000
RDX: 0x0000000000002127 RDI: 0x00007f96ec003000 RSI: 0x000000000003c000
R8: 0x0000000000040000 R9: 0x00007f977831dd10 R10: 0x00007f977831fc20
R11: 0x8bdbe29ebe0b09bc R12: 0x0000000000002000 R13: 0x00007f97edbb8000
R14: 0x000000000003c000 R15: 0x00005597131dd5a0 EFL: 0x0000000000010202
-- C level backtrace information -------------------------------------------
SEGV received in SEGV handler
D-system commentedon Apr 23, 2024
I made a brand new Rails 6.1.7.7 app I got the same error with those changes:
Note: it does precompile the files then seg fault.
Details
``` $ bundle ; ./bin/rails assets:clobber assets:precompile Bundle complete! 18 Gemfile dependencies, 84 gems now installed. Use `bundle info [gemname]` to see where a bundled gem is installed. I, [2024-04-23T18:59:24.147478 #10018] INFO -- : Removed /home/circleci/new_rails_app/public/assets yarn install v1.22.19 [1/4] Resolving packages... success Already up-to-date. Done in 0.42s. I, [2024-04-23T18:59:25.739888 #10018] INFO -- : Writing /home/circleci/new_rails_app/public/assets/manifest-b4bf6e57a53c2bdb55b8998cc94cd00883793c1c37c5e5aea3ef6749b4f6d92b.js I, [2024-04-23T18:59:25.740896 #10018] INFO -- : Writing /home/circleci/new_rails_app/public/assets/manifest-b4bf6e57a53c2bdb55b8998cc94cd00883793c1c37c5e5aea3ef6749b4f6d92b.js.gz I, [2024-04-23T18:59:25.741133 #10018] INFO -- : Writing /home/circleci/new_rails_app/public/assets/application-04024382391bb910584145d8113cf35ef376b55d125bb4516cebeb14ce788597.css I, [2024-04-23T18:59:25.742186 #10018] INFO -- : Writing /home/circleci/new_rails_app/public/assets/application-04024382391bb910584145d8113cf35ef376b55d125bb4516cebeb14ce788597.css.gz ./bin/rails: [BUG] Segmentation fault at 0x00007fb3f7901008 ruby 3.2.3 (2024-01-18 revision 52bb2ac0a6) [x86_64-linux]-- Control frame information -----------------------------------------------
c:0001 p:0000 s:0003 E:0011f0 DUMMY [FINISH]
-- Machine register context ------------------------------------------------
RIP: 0x00007fb3f4602745 RBP: 0x00007ffea2fe8d10 RSP: 0x00007ffea2fe8c80
RAX: 0x00007fb3f7901000 RBX: 0x00007fb374bc0000 RCX: 0x000000000003cfff
RDX: 0x000000000003bfff RDI: 0x00007fb374bc3000 RSI: 0x000000000003c000
R8: 0x00007fb3ec07e680 R9: 0x0000000000000000 R10: 0x00007fb3fe254f70
R11: 0x69454a582143dfed R12: 0x00007fb3ec03dd08 R13: 0x00007fb374bc3000
R14: 0x0000555dc5c6e350 R15: 0x000000000003c000 EFL: 0x0000000000010202
-- C level backtrace information -------------------------------------------
/usr/local/lib/libruby.so.3.2(rb_print_backtrace+0xd) [0x7fb3fe90494f] /home/circleci/ruby/vm_dump.c:785
/usr/local/lib/libruby.so.3.2(rb_vm_bugreport) /home/circleci/ruby/vm_dump.c:1080
/usr/local/lib/libruby.so.3.2(rb_bug_for_fatal_signal+0xf4) [0x7fb3fe6fb664] /home/circleci/ruby/error.c:813
/usr/local/lib/libruby.so.3.2(sigsegv+0x4d) [0x7fb3fe853f5d] /home/circleci/ruby/signal.c:964
/lib/x86_64-linux-gnu/libc.so.6(0x7fb3fe285520) [0x7fb3fe285520]
/home/circleci/.rubygems/extensions/x86_64-linux/3.2.0/mini_racer-0.12.0/mini_racer_extension.so(0x7fb3f4602745) [0x7fb3f4602745]
/home/circleci/.rubygems/extensions/x86_64-linux/3.2.0/mini_racer-0.12.0/mini_racer_extension.so(0x7fb3f4e18bbd) [0x7fb3f4e18bbd]
/home/circleci/.rubygems/extensions/x86_64-linux/3.2.0/mini_racer-0.12.0/mini_racer_extension.so(0x7fb3f4e18c16) [0x7fb3f4e18c16]
/home/circleci/.rubygems/extensions/x86_64-linux/3.2.0/mini_racer-0.12.0/mini_racer_extension.so(0x7fb3f4e60288) [0x7fb3f4e60288]
/home/circleci/.rubygems/extensions/x86_64-linux/3.2.0/mini_racer-0.12.0/mini_racer_extension.so(0x7fb3f4e08210) [0x7fb3f4e08210]
/home/circleci/.rubygems/extensions/x86_64-linux/3.2.0/mini_racer-0.12.0/mini_racer_extension.so(0x7fb3f4e07ffe) [0x7fb3f4e07ffe]
/home/circleci/.rubygems/extensions/x86_64-linux/3.2.0/mini_racer-0.12.0/mini_racer_extension.so(0x7fb3f4dffe15) [0x7fb3f4dffe15]
/home/circleci/.rubygems/extensions/x86_64-linux/3.2.0/mini_racer-0.12.0/mini_racer_extension.so(0x7fb3f491cba1) [0x7fb3f491cba1]
/home/circleci/.rubygems/extensions/x86_64-linux/3.2.0/mini_racer-0.12.0/mini_racer_extension.so(0x7fb3f491c619) [0x7fb3f491c619]
/home/circleci/.rubygems/extensions/x86_64-linux/3.2.0/mini_racer-0.12.0/mini_racer_extension.so(0x7fb3f44abaa0) [0x7fb3f44abaa0]
/home/circleci/.rubygems/extensions/x86_64-linux/3.2.0/mini_racer-0.12.0/mini_racer_extension.so(0x7fb3f44ae2c2) [0x7fb3f44ae2c2]
/home/circleci/.rubygems/extensions/x86_64-linux/3.2.0/mini_racer-0.12.0/mini_racer_extension.so(free_context_raw+0x137) [0x7fb3f44abc4f] /home/circleci/.rubygems/gems/mini_racer-0.12.0/ext/mini_racer_extension/mini_racer_extension.cc:1461
/home/circleci/.rubygems/extensions/x86_64-linux/3.2.0/mini_racer-0.12.0/mini_racer_extension.so(free_context+0xec) [0x7fb3f44abde5] /home/circleci/.rubygems/gems/mini_racer-0.12.0/ext/mini_racer_extension/mini_racer_extension.cc:1489
/home/circleci/.rubygems/extensions/x86_64-linux/3.2.0/mini_racer-0.12.0/mini_racer_extension.so(deallocate+0x24) [0x7fb3f44abea0] /home/circleci/.rubygems/gems/mini_racer-0.12.0/ext/mini_racer_extension/mini_racer_extension.cc:1516
/usr/local/lib/libruby.so.3.2(run_final+0xf) [0x7fb3fe71dea2] /home/circleci/ruby/gc.c:4399
/usr/local/lib/libruby.so.3.2(finalize_list) /home/circleci/ruby/gc.c:4418
/usr/local/lib/libruby.so.3.2(finalize_deferred_heap_pages) /home/circleci/ruby/gc.c:4447
/usr/local/lib/libruby.so.3.2(rb_objspace_call_finalizer+0x350) [0x7fb3fe72a4c0] /home/circleci/ruby/gc.c:4584
/usr/local/lib/libruby.so.3.2(rb_ec_finalize+0x2a) [0x7fb3fe706c31] /home/circleci/ruby/eval.c:168
/usr/local/lib/libruby.so.3.2(rb_ec_cleanup) /home/circleci/ruby/eval.c:262
/usr/local/lib/libruby.so.3.2(ruby_run_node+0x9d) [0x7fb3fe706e7d] /home/circleci/ruby/eval.c:330
/usr/local/bin/ruby(rb_main+0x21) [0x555dc3f48187] ./main.c:38
/usr/local/bin/ruby(main) ./main.c:57
/lib/x86_64-linux-gnu/libc.so.6(0x7fb3fe26cd90) [0x7fb3fe26cd90]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7fb3fe26ce40]
[0x555dc3f481d5]
-- Other runtime information -----------------------------------------------
Loaded script: ./bin/rails
Loaded features:
0 enumerator.so
1 thread.rb
2 fiber.so
3 rational.so
4 complex.so
5 ruby2_keywords.rb
6 /usr/local/lib/ruby/3.2.0/x86_64-linux/enc/encdb.so
7 /usr/local/lib/ruby/3.2.0/x86_64-linux/enc/trans/transdb.so
8 /usr/local/lib/ruby/3.2.0/x86_64-linux/rbconfig.rb
9 /usr/local/lib/ruby/site_ruby/3.2.0/rubygems/compatibility.rb
10 /usr/local/lib/ruby/site_ruby/3.2.0/rubygems/defaults.rb
11 /usr/local/lib/ruby/site_ruby/3.2.0/rubygems/deprecate.rb
12 /usr/local/lib/ruby/site_ruby/3.2.0/rubygems/errors.rb
13 /usr/local/lib/ruby/site_ruby/3.2.0/rubygems/unknown_command_spell_checker.rb
[...]
D-system commentedon Apr 23, 2024
I also tried the same project with mini_racer 0.9. It works.
D-system commentedon Apr 23, 2024
It seems sprocket is used by default if no other assets pipeline exists.
The Gemfile without the comments
SamSaffron commentedon Apr 23, 2024
@lloeki this looks urgent , should we roll out a release that puts us back at an earlier version while we work this out ?
SamSaffron commentedon Apr 23, 2024
@D-system does this repro in Linux as well
D-system commentedon Apr 23, 2024
@SamSaffron it's all tested inside the CircleCI image linked above. So, it's an Ubuntu based linux on x86_64.
lloeki commentedon Apr 23, 2024
So the idea would be to have 0.12.1 be 0.9.0? That would be odd.
lloeki commentedon Apr 23, 2024
I'll try a repro.
D-system commentedon Apr 23, 2024
The official
ruby:3.2.3Docker image does not have that problem.Trying with
cimg/ruby:3.2.3-nodeon my local machine (instead of their data centers)tisba commentedon Apr 23, 2024
I'm not able to reproduce yet, can't spend much time on it right now though.
The product I'm working on in my day job is using docker images based on the
ruby:3.3.0and we have an extensive test suite with lots of JavaScript that is evaluated by mini_racer. It works with 0.12.0 on x86 and aarch64 (both linux) just fine, I also have no issues on macOS 14.4.1 (arm). Running directly on x86 without Docker in Github Actions is also fine.🤔
D-system commentedon Apr 23, 2024
I tried with
cimg/ruby:3.2.3-nodeas base image with--platform=x86_64, I was not able to reproduce the problem.eg:
FROM --platform=x86_64 cimg/ruby:3.2.3-nodeI'm not able to reproduce the issue in a local docker either.
lloeki commentedon Apr 23, 2024
LD_PRELOADwouldn't changeRbConfig::CONFIG['MAINLIBS']output, it'd just forcefully inject jemalloc symbols into it.In any case it appears that
RbConfig::CONFIG['MAINLIBS']doesn't contain anything about jemalloc anyway, even when statically built against jemalloc.I couldn't reproduce it either inside that
x86_64image: test suite passes, even when artificially stressing libv8 by throwing copious amounts of quickly hacked JS code processing to it (granted it was a real quick test).Stick to mini_racer 0.9.0 for now
86 remaining items
lloeki commentedon Aug 6, 2024
Thanks folks for the unrelenting work in trying to reproduce! ❤️
By and large this doesn't matter, we could be building libv8 on a Rubyless image for all it cares. I plan to actually do that and move to something that makes having reproducible builds with better libc coverage (something like manylinux or even Nix).
libexec/build_libv8theBUILDTYPEenv var defaults toRelease, IIRC it can be set toDebuginstead:env BUILDTYPE=Debug ./libexec/build-libv8.stripstep inlibexec/inject-libv8because even inReleasemode the obj files resulting frombuild-libv8are insanely huge (as in, gigabytes, and IIRC even more so inDebug). Instead of stripping viainject-libv8, one would instead simply manually copy (or symlink to save space)src/libv8-{version}/..../out/{Debug or Release}/libv8_monolith.atovendor/v8/{platform}/libv8/obj.Super sorry I cannot help as it absolutely refuses to crash on any of my machines, whatever I throw at it :(
By the way the latest linux-gnu builds have been done with GCC.
Huh, I didn't see that one, been running tests locally before pushing and they all passed (except the "libv8 now optimises the hell out of things" ones which are red herrings)
At least this way:
lloeki commentedon Aug 6, 2024
Note:
rrhas the ability torecordexecution and allowsreplaying execution even on totally foreign machines. Once someone gets debug symbols and records a crash, maybe that could help for me to get a hand on a replayable record.SamSaffron commentedon Aug 7, 2024
@lloeki do you get segfaults on local from test_forking?
Still struggling through this, I know how amazing it will be to have a nice standalone test that segfaults, it is just very hard to pin down.
SamSaffron commentedon Aug 8, 2024
Well, I just built
12.7.224.15from Source using the Google build toolchain.Had to make some minor change to mini_racer:
And now the test that was crashing with the forking is working perfectly.
I enabled pointer compression and c++20 which is now required.
I am not sure I am trusting this node build anymore for our purpose. Will see if I can double test this on build as well. I had some trouble building though cause finding the right toolchain for older builds is a bit more tricky... will see what I can do.
We need to get
test/test_forking.rbworking as a #1 priority. This appears to be the canary in the coalmine.SamSaffron commentedon Aug 8, 2024
@lloeki my branch here builds v8 from source
mini_racer/Rakefile
Lines 31 to 39 in f134478
This build works just fine both with localization AND with the test_forking that was failing before.
So I suspect something about the way this node build is working is ending up with a corrupt ICU setup which is leading to the various faults.
SamSaffron commentedon Aug 8, 2024
OK another repro of the crash is a blank install of Discourse then:
something about multithreading is causing segfaults and this is also happening on my builds
Fix segfault, disable V8's thread-isolated allocator
Fix segfault, disable V8's thread-isolated allocator
Disable use of Linux memory protection keys
Fix segfault, disable V8's thread-isolated allocator
SamSaffron commentedon Sep 5, 2024
This is resolved, we disabled memory protection keys in v8
Underlying issue is tracked at:
https://issues.chromium.org/issues/360909072
New version of mini_racer is now based on latest version of v8 that is shipped with node.js
tisba commentedon Sep 5, 2024
That's great to hear! The build on aarch alpine is broken and mini_racer won't compile there, but that's probably unrelated. Will investigate a little and open a new issue.
SamSaffron commentedon Sep 5, 2024
We are now seeing different and new issues:
It is going to take us a bit longer to get this v8 upgrade completed
D-system commentedon Sep 6, 2024
Sorry for the extreme late reply.
I tried 0.17.0.pre with my project and it works.
Note that Rails went up to v7.0.8.4.
Interesting to see the Chromium issue ticket mentioning this page.