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

Add Linux ARM targets #8

Open
lloeki opened this issue Oct 31, 2020 · 16 comments
Open

Add Linux ARM targets #8

lloeki opened this issue Oct 31, 2020 · 16 comments

Comments

@lloeki
Copy link
Collaborator

lloeki commented Oct 31, 2020

Possible on GHA via qemu and/or xbuild. Also available on Travis.

Considered targets:

  • aarch64
  • armv7
  • armv8
@lloeki
Copy link
Collaborator Author

lloeki commented Jun 21, 2021

Currently built manually inside an aarch64 Linux VM on a M1 Mac Mini. Appears to run fine on Linux on ARM hardware (Graviton) but has trouble at runtime on emulated machines (via qemu on x86 and/or docker's hyperkit on M1)

@lloeki
Copy link
Collaborator Author

lloeki commented Jun 21, 2021

Cross-compiling builds correctly, but I hit a missing symbol error.

root@5e26cbbca17e:/mini_racer# bundle exec rake test
/usr/local/bin/ruby: symbol lookup error: /mini_racer/lib/mini_racer_extension.so: undefined symbol: _ZN2v82V818SetFlagsFromStringEPKcm
rake aborted!
root@5e26cbbca17e:/mini_racer# echo _ZN2v82V818SetFlagsFromStringEPKcm | c++filt 
v8::V8::SetFlagsFromString(char const*, unsigned long)

@lloeki
Copy link
Collaborator Author

lloeki commented Jun 21, 2021

It seems compilation was partial, the intermediate libv8_monolith.a target might have been insufficient for cross-compilation to fully proceed (e.g api.o from v8_base_without_compiler was only present in obj.host and absent from obj.target), but running a full make produced all the required .o in obj.target.

@tisba
Copy link

tisba commented Jun 21, 2021

Currently built manually inside an aarch64 Linux VM on a M1 Mac Mini. Appears to run fine on Linux on ARM hardware (Graviton) but has trouble at runtime on emulated machines (via qemu on x86 and/or docker's hyperkit on M1)

Just a tiny remark: Docker for Desktop does also have experimental support for Big Sur/MacOS virtualization.framework. The same problem exists there though. Docker's hyperkit VM was/is based on hypervisor.framework.

@lloeki
Copy link
Collaborator Author

lloeki commented Jun 21, 2021

Got a build and a gem working! Not publishing yet because things are not ready automation-side but testers are welcome to make themselves known.

@lloeki
Copy link
Collaborator Author

lloeki commented Jul 12, 2021

@tisba I have Linux cross compilation to ARM on x64 CI working, see this run (there are some failures but they're on Darwin and Alpine, gnu/ARM passes!)

Before I pull the trigger and publish these, can you download the gem-16.3.0.0-aarch64-linux down the summary page and try it out as you did over there?

@tisba
Copy link

tisba commented Jul 12, 2021

For some reason I'm getting an error when I try to process the gem (gem generate_index). I'll take a closer look later.

$ gem generate_index
ERROR:  Unable to process /app/repo/gems/libv8-node-16.3.0.0-aarch64-linux.gem
"\xF7\xA0\aw\xB7\x83\xBBs" is not an octal string (ArgumentError)
        /usr/local/lib/ruby/3.0.0/rubygems/package/tar_header.rb:129:in `strict_oct'
        /usr/local/lib/ruby/3.0.0/rubygems/package/tar_header.rb:107:in `from'
        /usr/local/lib/ruby/3.0.0/rubygems/package/tar_reader.rb:59:in `each'
        /usr/local/lib/ruby/3.0.0/rubygems/package/tar_reader.rb:112:in `find'
        /usr/local/lib/ruby/3.0.0/rubygems/package/tar_reader.rb:112:in `seek'
        /usr/local/lib/ruby/3.0.0/rubygems/package.rb:544:in `read_checksums'
        /usr/local/lib/ruby/3.0.0/rubygems/package.rb:604:in `block (2 levels) in verify'
        /usr/local/lib/ruby/3.0.0/rubygems/package/tar_reader.rb:27:in `new'
        /usr/local/lib/ruby/3.0.0/rubygems/package.rb:603:in `block in verify'
[…]

@lloeki
Copy link
Collaborator Author

lloeki commented Jul 13, 2021

There's another build based on 16.4.2 over there: https://github.com/sqreen/ruby-libv8-node/actions/runs/1023202498

@tisba
Copy link

tisba commented Jul 13, 2021

I'm not sure what I'm doing "wrong" 😞

I downloaded https://github.com/sqreen/ruby-libv8-node/suites/3216862858/artifacts/74504625 as gems/gem-16.4.2.0-aarch64-linux.gem and run gem generate_index (both natively on M1 and x86 Ruby 3.0.2 or via docker run -it --rm -v "$(pwd)":/app -w /app ruby:3.0.2) and still getting the same error...

ERROR:  Unable to process /app/gems/gem-16.4.2.0-aarch64-linux.gem
"f:bff<\xA2#" is not an octal string (ArgumentError)
        /usr/local/lib/ruby/3.0.0/rubygems/package/tar_header.rb:129:in `strict_oct'
        /usr/local/lib/ruby/3.0.0/rubygems/package/tar_header.rb:107:in `from'
        /usr/local/lib/ruby/3.0.0/rubygems/package/tar_reader.rb:59:in `each'
        /usr/local/lib/ruby/3.0.0/rubygems/package/tar_reader.rb:112:in `find'
        /usr/local/lib/ruby/3.0.0/rubygems/package/tar_reader.rb:112:in `seek'
        /usr/local/lib/ruby/3.0.0/rubygems/package.rb:544:in `read_checksums'

To sanity check, I downloaded https://rubygems.org/downloads/rails-6.1.4.gem and gem generate_index (and gem unpack) works. Does this work for you, @lloeki? What am I missing?

  • ruby --version 3.0.2p107
  • gem --version 3.2.23

@tisba
Copy link

tisba commented Jul 31, 2021

Any ideas, @lloeki?

@lloeki
Copy link
Collaborator Author

lloeki commented Oct 13, 2021

Sorry for the delay @tisba, I did not have a moment to look at this but I'm not forgetting about it!

@lloeki
Copy link
Collaborator Author

lloeki commented Oct 18, 2021

@tisba I pushed some 16.10.0 gems and updated the mini_racer PR.

@tisba
Copy link

tisba commented Oct 20, 2021

System info:

RUBY_VERSION : 3.0.2
RUBY_PLATFORM: aarch64-linux
MiniRacer::LIBV8_NODE_VERSION: ~> 16.10.0.0
Libv8::Node::VERSION: 16.10.0.0
Libv8::Node::NODE_VERSION: 16.10.0
Libv8::Node::LIBV8_VERSION: 9.3.345.19

I'm running this on Big Sur 11.6, Mac mini (M1, 2020).

Running the following script with docker run -it --rm -v "$(pwd)":/app -w /app ruby:3.0.2 ruby /app/fork.rb produces a segfault.

fork.rb
# frozen_string_literal: true

# Run with:
#   ruby fork.rb
#   -or via docker-
#   docker run -it --rm -v "$(pwd)":/app -w /app ruby:3.0.2 ruby /app/fork.rb

require "bundler/inline"

gemfile do
  source "https://rubygems.org"

  gem "mini_racer", git: "https://github.com/rubyjs/mini_racer", branch: "libv8-node-16"
  gem "libv8-node", source: "file:///app/repo"
end

puts "RUBY_VERSION : #{RUBY_VERSION}"
puts "RUBY_PLATFORM: #{RUBY_PLATFORM}"
puts "MiniRacer::LIBV8_NODE_VERSION: #{MiniRacer::LIBV8_NODE_VERSION}"
puts "Libv8::Node::VERSION: #{Libv8::Node::VERSION}"
puts "Libv8::Node::NODE_VERSION: #{Libv8::Node::NODE_VERSION}"
puts "Libv8::Node::LIBV8_VERSION: #{Libv8::Node::LIBV8_VERSION}"

puts "parent pid   : #{Process.pid}"

MiniRacer::Context.new.dispose

fork do
  puts "child pid    : #{Process.pid}"
end

puts "DONE!"
puts
Full Output
RUBY_VERSION : 3.0.2
RUBY_PLATFORM: aarch64-linux
MiniRacer::LIBV8_NODE_VERSION: ~> 16.10.0.0
Libv8::Node::VERSION: 16.10.0.0
Libv8::Node::NODE_VERSION: 16.10.0
Libv8::Node::LIBV8_VERSION: 9.3.345.19
parent pid   : 8
DONE!

child pid    : 124
root@33b268e5a15a:/app# fork.rb:28: [BUG] Segmentation fault at 0x0000ffff84a1e2a0
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [aarch64-linux]

-- Machine register context ------------------------------------------------
 "x0: 0x0000000000000000 "x1: 0x0000000000000000 "x2: 0x0000000000000000
 "x3: 0x0000000000000000 "x4: 0x0000000000000001 "x5: 0x0000ffff8ac69640
 "x6: 0x0000000000000007 "x7: 0x0000aaab2066d0e0 "x1: 0x0000000000000000
 "x1: 0x0000ffff84a1e1d0 "x2: 0x0000aaab1d527b80 "x2: 0x0000aaab1d527b88
 "x2: 0x0000aaab2038db10 "x2: 0x0000ffff5569aec0 "x2: 0x0000aaab1d527b70
 "x2: 0x0000aaab2038db20 "x2: 0x0000ffff8ac69638 "x2: 0x0000ffff8a8506b8
 "x2: 0x000000000000000a "x2: 0x0000ffffe93b1000 "sp: 0x0000ffffe93b1000
 "fa: 0x0000ffff84a1e2a0

-- C level backtrace information -------------------------------------------
/usr/local/lib/libruby.so.3.0(rb_vm_bugreport+0x5ac) [0xffff8aafca6c] vm_dump.c:758
/usr/local/lib/libruby.so.3.0(rb_bug_for_fatal_signal+0xd8) [0xffff8a9188c8] error.c:786
/usr/local/lib/libruby.so.3.0(sigsegv+0x58) [0xffff8aa55f3c] signal.c:960
linux-vdso.so.1(__kernel_rt_sigreturn+0x0) [0xffff8ac6879c]
[0xffff8a68e72c]
[0xffff5569aeac]
[0xffff5569b028]
[0xffff55699ee8]
[0xffff5569a154]
[0xffff54caea74]
[0xffff54cae59c]
[0xffff8a719b8c]
[0xffff8a719d1c]
/usr/local/lib/libruby.so.3.0(ruby_stop+0x10) [0xffff8a923554] eval.c:329
/usr/local/lib/libruby.so.3.0(ruby_run_node) (null):0
/usr/local/lib/libruby.so.3.0(rb_f_fork+0x1c) [0xffff8aa05e60] process.c:4348
/usr/local/lib/libruby.so.3.0(rb_f_fork) process.c:4338
/usr/local/lib/libruby.so.3.0(vm_call_cfunc_with_frame+0xf8) [0xffff8aad32f8] vm_insnhelper.c:2926
/usr/local/lib/libruby.so.3.0(vm_sendish+0x318) [0xffff8aade01c] vm_insnhelper.c:4527
/usr/local/lib/libruby.so.3.0(vm_exec_core+0x2f94) [0xffff8aae3b54] insns.def:770
/usr/local/lib/libruby.so.3.0(rb_vm_exec+0x8b8) [0xffff8aae6848] vm.c:2172
/usr/local/lib/libruby.so.3.0(rb_ec_exec_node+0xd4) [0xffff8a91d844] eval.c:317
/usr/local/lib/libruby.so.3.0(ruby_run_node+0x68) [0xffff8a9235bc] eval.c:375
/usr/local/bin/ruby(main+0x5c) [0xaaaae96b0b3c] ./main.c:50

-- Other runtime information -----------------------------------------------

* Process memory map:

aaaae96b0000-aaaae96b1000 r-xp 00000000 fe:01 672009                     /usr/local/bin/ruby
aaaae96c1000-aaaae96c2000 r--p 00001000 fe:01 672009                     /usr/local/bin/ruby
aaaae96c2000-aaaae96c3000 rw-p 00002000 fe:01 672009                     /usr/local/bin/ruby
aaab03a1e000-aaab24ac5000 rw-p 00000000 00:00 0                          [heap]
ffff50000000-ffff50021000 rw-p 00000000 00:00 0 
ffff50021000-ffff54000000 ---p 00000000 00:00 0 
ffff54486000-ffff57ed5000 r-xp 00000000 fe:01 1984004                    /usr/local/bundle/bundler/gems/extensions/aarch64-linux/3.0.0/mini_racer-9ac5e7aec671/mini_racer_extension.so
ffff57ed5000-ffff57ee5000 ---p 03a4f000 fe:01 1984004                    /usr/local/bundle/bundler/gems/extensions/aarch64-linux/3.0.0/mini_racer-9ac5e7aec671/mini_racer_extension.so
ffff57ee5000-ffff57f4c000 r--p 03a4f000 fe:01 1984004                    /usr/local/bundle/bundler/gems/extensions/aarch64-linux/3.0.0/mini_racer-9ac5e7aec671/mini_racer_extension.so
ffff57f4c000-ffff57f9c000 rw-p 03ab6000 fe:01 1984004                    /usr/local/bundle/bundler/gems/extensions/aarch64-linux/3.0.0/mini_racer-9ac5e7aec671/mini_racer_extension.so
ffff57f9c000-ffff5f378000 rw-p 00000000 00:00 0 
ffff5f378000-ffff671ed000 rw-p 00000000 00:00 0 
ffff68000000-ffff6b4d4000 rw-p 00000000 00:00 0 
ffff6b4d4000-ffff6c000000 ---p 00000000 00:00 0 
ffff6c000000-ffff6c021000 rw-p 00000000 00:00 0 
ffff6c021000-ffff70000000 ---p 00000000 00:00 0 
ffff70000000-ffff70021000 rw-p 00000000 00:00 0 
ffff70021000-ffff74000000 ---p 00000000 00:00 0 
ffff77411000-ffff78000000 r--s 00000000 fe:01 672211                     /usr/local/lib/libruby.so.3.0.2
ffff78000000-ffff7c000000 rw-p 00000000 00:00 0 
ffff7c000000-ffff7c021000 rw-p 00000000 00:00 0 
ffff7c021000-ffff80000000 ---p 00000000 00:00 0 
ffff80000000-ffff8006b000 rw-p 00000000 00:00 0 
ffff8006b000-ffff84000000 ---p 00000000 00:00 0 
ffff84a1f000-ffff84a20000 ---p 00000000 00:00 0 
ffff84a20000-ffff85220000 rw-p 00000000 00:00 0 
ffff85220000-ffff85221000 ---p 00000000 00:00 0 
ffff85221000-ffff85a21000 rw-p 00000000 00:00 0 
ffff85a21000-ffff85bd8000 r-xp 00000000 fe:01 532214                     /usr/lib/aarch64-linux-gnu/libstdc++.so.6.0.28
ffff85bd8000-ffff85be8000 ---p 001b7000 fe:01 532214                     /usr/lib/aarch64-linux-gnu/libstdc++.so.6.0.28
ffff85be8000-ffff85bf3000 r--p 001b7000 fe:01 532214                     /usr/lib/aarch64-linux-gnu/libstdc++.so.6.0.28
ffff85bf3000-ffff85bf6000 rw-p 001c2000 fe:01 532214                     /usr/lib/aarch64-linux-gnu/libstdc++.so.6.0.28
ffff85bf6000-ffff85bf9000 rw-p 00000000 00:00 0 
ffff861fc000-ffff8620f000 r-xp 00000000 fe:01 531464                     /lib/aarch64-linux-gnu/libresolv-2.31.so
ffff8620f000-ffff8621f000 ---p 00013000 fe:01 531464                     /lib/aarch64-linux-gnu/libresolv-2.31.so
ffff8621f000-ffff86220000 r--p 00013000 fe:01 531464                     /lib/aarch64-linux-gnu/libresolv-2.31.so
ffff86220000-ffff86221000 rw-p 00014000 fe:01 531464                     /lib/aarch64-linux-gnu/libresolv-2.31.so
ffff86221000-ffff86223000 rw-p 00000000 00:00 0 
ffff86223000-ffff86228000 r-xp 00000000 fe:01 531447                     /lib/aarch64-linux-gnu/libnss_dns-2.31.so
ffff86228000-ffff86237000 ---p 00005000 fe:01 531447                     /lib/aarch64-linux-gnu/libnss_dns-2.31.so
ffff86237000-ffff86238000 r--p 00004000 fe:01 531447                     /lib/aarch64-linux-gnu/libnss_dns-2.31.so
ffff86238000-ffff86239000 rw-p 00005000 fe:01 531447                     /lib/aarch64-linux-gnu/libnss_dns-2.31.so
ffff86239000-ffff86244000 r-xp 00000000 fe:01 531449                     /lib/aarch64-linux-gnu/libnss_files-2.31.so
ffff86244000-ffff86254000 ---p 0000b000 fe:01 531449                     /lib/aarch64-linux-gnu/libnss_files-2.31.so
ffff86254000-ffff86255000 r--p 0000b000 fe:01 531449                     /lib/aarch64-linux-gnu/libnss_files-2.31.so
ffff86255000-ffff86256000 rw-p 0000c000 fe:01 531449                     /lib/aarch64-linux-gnu/libnss_files-2.31.so
ffff86256000-ffff8625c000 rw-p 00000000 00:00 0 
ffff8625c000-ffff8625e000 r-xp 00000000 fe:01 803784                     /usr/local/lib/ruby/3.0.0/aarch64-linux/digest/md5.so
ffff8625e000-ffff8626d000 ---p 00002000 fe:01 803784                     /usr/local/lib/ruby/3.0.0/aarch64-linux/digest/md5.so
ffff8626d000-ffff8626e000 r--p 00001000 fe:01 803784                     /usr/local/lib/ruby/3.0.0/aarch64-linux/digest/md5.so
ffff8626e000-ffff8626f000 rw-p 00002000 fe:01 803784                     /usr/local/lib/ruby/3.0.0/aarch64-linux/digest/md5.so
ffff8626f000-ffff86270000 r-xp 00000000 fe:01 803840                     /usr/local/lib/ruby/3.0.0/aarch64-linux/enc/utf_16be.so
ffff86270000-ffff86280000 ---p 00001000 fe:01 803840                     /usr/local/lib/ruby/3.0.0/aarch64-linux/enc/utf_16be.so
ffff86280000-ffff86281000 r--p 00001000 fe:01 803840                     /usr/local/lib/ruby/3.0.0/aarch64-linux/enc/utf_16be.so
ffff86281000-ffff86282000 rw-p 00002000 fe:01 803840                     /usr/local/lib/ruby/3.0.0/aarch64-linux/enc/utf_16be.so
ffff86282000-ffff86283000 r-xp 00000000 fe:01 803841                     /usr/local/lib/ruby/3.0.0/aarch64-linux/enc/utf_16le.so
ffff86283000-ffff86293000 ---p 00001000 fe:01 803841                     /usr/local/lib/ruby/3.0.0/aarch64-linux/enc/utf_16le.so
ffff86293000-ffff86294000 r--p 00001000 fe:01 803841                     /usr/local/lib/ruby/3.0.0/aarch64-linux/enc/utf_16le.so
ffff86294000-ffff86295000 rw-p 00002000 fe:01 803841                     /usr/local/lib/ruby/3.0.0/aarch64-linux/enc/utf_16le.so
ffff86295000-ffff8629b000 r-xp 00000000 fe:01 672224                     /usr/local/lib/ruby/3.0.0/aarch64-linux/etc.so
ffff8629b000-ffff862aa000 ---p 00006000 fe:01 672224                     /usr/local/lib/ruby/3.0.0/aarch64-linux/etc.so
ffff862aa000-ffff862ab000 r--p 00005000 fe:01 672224                     /usr/local/lib/ruby/3.0.0/aarch64-linux/etc.so
ffff862ab000-ffff862ac000 rw-p 00006000 fe:01 672224                     /usr/local/lib/ruby/3.0.0/aarch64-linux/etc.so
ffff862ac000-ffff862c7000 r-xp 00000000 fe:01 1723571                    /usr/lib/aarch64-linux-gnu/libyaml-0.so.2.0.6
ffff862c7000-ffff862d6000 ---p 0001b000 fe:01 1723571                    /usr/lib/aarch64-linux-gnu/libyaml-0.so.2.0.6
ffff862d6000-ffff862d7000 r--p 0001a000 fe:01 1723571                    /usr/lib/aarch64-linux-gnu/libyaml-0.so.2.0.6
ffff862d7000-ffff862d8000 rw-p 0001b000 fe:01 1723571                    /usr/lib/aarch64-linux-gnu/libyaml-0.so.2.0.6
ffff868ff000-ffff86933000 r--s 00000000 fe:01 672009                     /usr/local/bin/ruby
ffff86933000-ffff8693d000 r-xp 00000000 fe:01 803857                     /usr/local/lib/ruby/3.0.0/aarch64-linux/json/ext/generator.so
ffff8693d000-ffff8694c000 ---p 0000a000 fe:01 803857                     /usr/local/lib/ruby/3.0.0/aarch64-linux/json/ext/generator.so
ffff8694c000-ffff8694d000 r--p 00009000 fe:01 803857                     /usr/local/lib/ruby/3.0.0/aarch64-linux/json/ext/generator.so
ffff8694d000-ffff8694e000 rw-p 0000a000 fe:01 803857                     /usr/local/lib/ruby/3.0.0/aarch64-linux/json/ext/generator.so
ffff8694e000-ffff86954000 r-xp 00000000 fe:01 803858                     /usr/local/lib/ruby/3.0.0/aarch64-linux/json/ext/parser.so
ffff86954000-ffff86963000 ---p 00006000 fe:01 803858                     /usr/local/lib/ruby/3.0.0/aarch64-linux/json/ext/parser.so
ffff86963000-ffff86964000 r--p 00005000 fe:01 803858                     /usr/local/lib/ruby/3.0.0/aarch64-linux/json/ext/parser.so
ffff86964000-ffff86965000 rw-p 00006000 fe:01 803858                     /usr/local/lib/ruby/3.0.0/aarch64-linux/json/ext/parser.so
ffff86965000-ffff86978000 r-xp 00000000 fe:01 531433                     /lib/aarch64-linux-gnu/libgcc_s.so.1
ffff86978000-ffff86987000 ---p 00013000 fe:01 531433                     /lib/aarch64-linux-gnu/libgcc_s.so.1
ffff86987000-ffff86988000 r--p 00012000 fe:01 531433                     /lib/aarch64-linux-gnu/libgcc_s.so.1
ffff86988000-ffff86989000 rw-p 00013000 fe:01 531433                     /lib/aarch64-linux-gnu/libgcc_s.so.1
ffff86989000-ffff8698a000 r-xp 00000000 fe:01 1858331                    /usr/local/bundle/bundler/gems/mini_racer-9ac5e7aec671/lib/mini_racer_loader.so
ffff8698a000-ffff8699a000 ---p 00001000 fe:01 1858331                    /usr/local/bundle/bundler/gems/mini_racer-9ac5e7aec671/lib/mini_racer_loader.so
ffff8699a000-ffff8699b000 r--p 00001000 fe:01 1858331                    /usr/local/bundle/bundler/gems/mini_racer-9ac5e7aec671/lib/mini_racer_loader.so
ffff8699b000-ffff8699c000 rw-p 00002000 fe:01 1858331                    /usr/local/bundle/bundler/gems/mini_racer-9ac5e7aec671/lib/mini_racer_loader.so
ffff8699c000-ffff869ae000 r-xp 00000000 fe:01 672243                     /usr/local/lib/ruby/3.0.0/aarch64-linux/zlib.so
ffff869ae000-ffff869bd000 ---p 00012000 fe:01 672243                     /usr/local/lib/ruby/3.0.0/aarch64-linux/zlib.so
ffff869bd000-ffff869be000 r--p 00011000 fe:01 672243                     /usr/local/lib/ruby/3.0.0/aarch64-linux/zlib.so
ffff869be000-ffff869bf000 rw-p 00012000 fe:01 672243                     /usr/local/lib/ruby/3.0.0/aarch64-linux/zlib.so
ffff869bf000-ffff86a20000 rw-p 00000000 00:00 0 
ffff86a20000-ffff86a22000 r-xp 00000000 fe:01 803854                     /usr/local/lib/ruby/3.0.0/aarch64-linux/io/wait.so
ffff86a22000-ffff86a31000 ---p 00002000 fe:01 803854                     /usr/local/lib/ruby/3.0.0/aarch64-linux/io/wait.so
ffff86a31000-ffff86a32000 r--p 00001000 fe:01 803854                     /usr/local/lib/ruby/3.0.0/aarch64-linux/io/wait.so
ffff86a32000-ffff86a33000 rw-p 00002000 fe:01 803854                     /usr/local/lib/ruby/3.0.0/aarch64-linux/io/wait.so
ffff86a33000-ffff86a60000 r-xp 00000000 fe:01 672239                     /usr/local/lib/ruby/3.0.0/aarch64-linux/socket.so
ffff86a60000-ffff86a6f000 ---p 0002d000 fe:01 672239                     /usr/local/lib/ruby/3.0.0/aarch64-linux/socket.so
ffff86a6f000-ffff86a70000 r--p 0002c000 fe:01 672239                     /usr/local/lib/ruby/3.0.0/aarch64-linux/socket.so
ffff86a70000-ffff86a71000 rw-p 0002d000 fe:01 672239                     /usr/local/lib/ruby/3.0.0/aarch64-linux/socket.so
ffff86a71000-ffff86a72000 r-xp 00000000 fe:01 803853                     /usr/local/lib/ruby/3.0.0/aarch64-linux/io/nonblock.so
ffff86a72000-ffff86a81000 ---p 00001000 fe:01 803853                     /usr/local/lib/ruby/3.0.0/aarch64-linux/io/nonblock.so
ffff86a81000-ffff86a82000 r--p 00000000 fe:01 803853                     /usr/local/lib/ruby/3.0.0/aarch64-linux/io/nonblock.so
ffff86a82000-ffff86a83000 rw-p 00001000 fe:01 803853                     /usr/local/lib/ruby/3.0.0/aarch64-linux/io/nonblock.so
ffff86a83000-ffff86a8b000 r-xp 00000000 fe:01 672240                     /usr/local/lib/ruby/3.0.0/aarch64-linux/stringio.so
ffff86a8b000-ffff86a9a000 ---p 00008000 fe:01 672240                     /usr/local/lib/ruby/3.0.0/aarch64-linux/stringio.so
ffff86a9a000-ffff86a9b000 r--p 00007000 fe:01 672240                     /usr/local/lib/ruby/3.0.0/aarch64-linux/stringio.so
ffff86a9b000-ffff86a9c000 rw-p 00008000 fe:01 672240                     /usr/local/lib/ruby/3.0.0/aarch64-linux/stringio.so
ffff86a9c000-ffff86d08000 r-xp 00000000 fe:01 532169                     /usr/lib/aarch64-linux-gnu/libcrypto.so.1.1
ffff86d08000-ffff86d17000 ---p 0026c000 fe:01 532169                     /usr/lib/aarch64-linux-gnu/libcrypto.so.1.1
ffff86d17000-ffff86d45000 r--p 0026b000 fe:01 532169                     /usr/lib/aarch64-linux-gnu/libcrypto.so.1.1
ffff86d45000-ffff86d47000 rw-p 00299000 fe:01 532169                     /usr/lib/aarch64-linux-gnu/libcrypto.so.1.1
ffff86d47000-ffff86d4b000 rw-p 00000000 00:00 0 
ffff86d4b000-ffff86dca000 r-xp 00000000 fe:01 532212                     /usr/lib/aarch64-linux-gnu/libssl.so.1.1
ffff86dca000-ffff86dda000 ---p 0007f000 fe:01 532212                     /usr/lib/aarch64-linux-gnu/libssl.so.1.1
ffff86dda000-ffff86de3000 r--p 0007f000 fe:01 532212                     /usr/lib/aarch64-linux-gnu/libssl.so.1.1
ffff86de3000-ffff86de7000 rw-p 00088000 fe:01 532212                     /usr/lib/aarch64-linux-gnu/libssl.so.1.1
ffff86def000-ffff86e4c000 r-xp 00000000 fe:01 672232                     /usr/local/lib/ruby/3.0.0/aarch64-linux/openssl.so
ffff86e4c000-ffff86e5b000 ---p 0005d000 fe:01 672232                     /usr/local/lib/ruby/3.0.0/aarch64-linux/openssl.so
ffff86e5b000-ffff86e5d000 r--p 0005c000 fe:01 672232                     /usr/local/lib/ruby/3.0.0/aarch64-linux/openssl.so
ffff86e5d000-ffff86e5f000 rw-p 0005e000 fe:01 672232                     /usr/local/lib/ruby/3.0.0/aarch64-linux/openssl.so
ffff86e5f000-ffff86e60000 rw-p 00000000 00:00 0 
ffff86e60000-ffff86e62000 r-xp 00000000 fe:01 803786                     /usr/local/lib/ruby/3.0.0/aarch64-linux/digest/sha1.so
ffff86e62000-ffff86e72000 ---p 00002000 fe:01 803786                     /usr/local/lib/ruby/3.0.0/aarch64-linux/digest/sha1.so
ffff86e72000-ffff86e73000 r--p 00002000 fe:01 803786                     /usr/local/lib/ruby/3.0.0/aarch64-linux/digest/sha1.so
ffff86e73000-ffff86e74000 rw-p 00003000 fe:01 803786                     /usr/local/lib/ruby/3.0.0/aarch64-linux/digest/sha1.so
ffff86e74000-ffff86e77000 r-xp 00000000 fe:01 672223                     /usr/local/lib/ruby/3.0.0/aarch64-linux/digest.so
ffff86e77000-ffff86e87000 ---p 00003000 fe:01 672223                     /usr/local/lib/ruby/3.0.0/aarch64-linux/digest.so
ffff86e87000-ffff86e88000 r--p 00003000 fe:01 672223                     /usr/local/lib/ruby/3.0.0/aarch64-linux/digest.so
ffff86e88000-ffff86e89000 rw-p 00004000 fe:01 672223                     /usr/local/lib/ruby/3.0.0/aarch64-linux/digest.so
ffff86e89000-ffff86e91000 r-xp 00000000 fe:01 672233                     /usr/local/lib/ruby/3.0.0/aarch64-linux/pathname.so
ffff86e91000-ffff86ea0000 ---p 00008000 fe:01 672233                     /usr/local/lib/ruby/3.0.0/aarch64-linux/pathname.so
ffff86ea0000-ffff86ea1000 r--p 00007000 fe:01 672233                     /usr/local/lib/ruby/3.0.0/aarch64-linux/pathname.so
ffff86ea1000-ffff86ea2000 rw-p 00008000 fe:01 672233                     /usr/local/lib/ruby/3.0.0/aarch64-linux/pathname.so
ffff86ea2000-ffff86ea4000 r-xp 00000000 fe:01 672229                     /usr/local/lib/ruby/3.0.0/aarch64-linux/monitor.so
ffff86ea4000-ffff86eb3000 ---p 00002000 fe:01 672229                     /usr/local/lib/ruby/3.0.0/aarch64-linux/monitor.so
ffff86eb3000-ffff86eb4000 r--p 00001000 fe:01 672229                     /usr/local/lib/ruby/3.0.0/aarch64-linux/monitor.so
ffff86eb4000-ffff86eb5000 rw-p 00002000 fe:01 672229                     /usr/local/lib/ruby/3.0.0/aarch64-linux/monitor.so
ffff86eb5000-ffff86eb7000 r-xp 00000000 fe:01 803837                     /usr/local/lib/ruby/3.0.0/aarch64-linux/enc/trans/transdb.so
ffff86eb7000-ffff86ec6000 ---p 00002000 fe:01 803837                     /usr/local/lib/ruby/3.0.0/aarch64-linux/enc/trans/transdb.so
ffff86ec6000-ffff86ec7000 r--p 00001000 fe:01 803837                     /usr/local/lib/ruby/3.0.0/aarch64-linux/enc/trans/transdb.so
ffff86ec7000-ffff86ec8000 rw-p 00002000 fe:01 803837                     /usr/local/lib/ruby/3.0.0/aarch64-linux/enc/trans/transdb.so
ffff86ec8000-ffff86eca000 r-xp 00000000 fe:01 803793                     /usr/local/lib/ruby/3.0.0/aarch64-linux/enc/encdb.so
ffff86eca000-ffff86ed9000 ---p 00002000 fe:01 803793                     /usr/local/lib/ruby/3.0.0/aarch64-linux/enc/encdb.so
ffff86ed9000-ffff86eda000 r--p 00001000 fe:01 803793                     /usr/local/lib/ruby/3.0.0/aarch64-linux/enc/encdb.so
ffff86eda000-ffff86edb000 rw-p 00002000 fe:01 803793                     /usr/local/lib/ruby/3.0.0/aarch64-linux/enc/encdb.so
ffff86edb000-ffff86edc000 ---p 00000000 00:00 0 
ffff86edc000-ffff86f7d000 rw-p 00000000 00:00 0 
ffff86f7d000-ffff86f7e000 ---p 00000000 00:00 0 
ffff86f7e000-ffff8701f000 rw-p 00000000 00:00 0 
ffff8701f000-ffff87020000 ---p 00000000 00:00 0 
ffff87020000-ffff870c1000 rw-p 00000000 00:00 0 
ffff870c1000-ffff870c2000 ---p 00000000 00:00 0 
ffff870c2000-ffff87163000 rw-p 00000000 00:00 0 
ffff87163000-ffff87164000 ---p 00000000 00:00 0 
ffff87164000-ffff87205000 rw-p 00000000 00:00 0 
ffff87205000-ffff87206000 ---p 00000000 00:00 0 
ffff87206000-ffff872a7000 rw-p 00000000 00:00 0 
ffff872a7000-ffff872a8000 ---p 00000000 00:00 0 
ffff872a8000-ffff87349000 rw-p 00000000 00:00 0 
ffff87349000-ffff8734a000 ---p 00000000 00:00 0 
ffff8734a000-ffff873eb000 rw-p 00000000 00:00 0 
ffff873eb000-ffff873ec000 ---p 00000000 00:00 0 
ffff873ec000-ffff8748d000 rw-p 00000000 00:00 0 
ffff8748d000-ffff8748e000 ---p 00000000 00:00 0 
ffff8748e000-ffff8752f000 rw-p 00000000 00:00 0 
ffff8752f000-ffff87530000 ---p 00000000 00:00 0 
ffff87530000-ffff875d1000 rw-p 00000000 00:00 0 
ffff875d1000-ffff875d2000 ---p 00000000 00:00 0 
ffff875d2000-ffff87673000 rw-p 00000000 00:00 0 
ffff87673000-ffff87674000 ---p 00000000 00:00 0 
ffff87674000-ffff87715000 rw-p 00000000 00:00 0 
ffff87715000-ffff87716000 ---p 00000000 00:00 0 
ffff87716000-ffff877b7000 rw-p 00000000 00:00 0 
ffff877b7000-ffff877b8000 ---p 00000000 00:00 0 
ffff877b8000-ffff87859000 rw-p 00000000 00:00 0 
ffff87859000-ffff8785a000 ---p 00000000 00:00 0 
ffff8785a000-ffff878fb000 rw-p 00000000 00:00 0 
ffff878fb000-ffff878fc000 ---p 00000000 00:00 0 
ffff878fc000-ffff8799d000 rw-p 00000000 00:00 0 
ffff8799d000-ffff8799e000 ---p 00000000 00:00 0 
ffff8799e000-ffff87a3f000 rw-p 00000000 00:00 0 
ffff87a3f000-ffff87a40000 ---p 00000000 00:00 0 
ffff87a40000-ffff87ae1000 rw-p 00000000 00:00 0 
ffff87ae1000-ffff87ae2000 ---p 00000000 00:00 0 
ffff87ae2000-ffff87b83000 rw-p 00000000 00:00 0 
ffff87b83000-ffff87b84000 ---p 00000000 00:00 0 
ffff87b84000-ffff87c25000 rw-p 00000000 00:00 0 
ffff87c25000-ffff87c26000 ---p 00000000 00:00 0 
ffff87c26000-ffff87cc7000 rw-p 00000000 00:00 0 
ffff87cc7000-ffff87cc8000 ---p 00000000 00:00 0 
ffff87cc8000-ffff87d69000 rw-p 00000000 00:00 0 
ffff87d69000-ffff87d6a000 ---p 00000000 00:00 0 
ffff87d6a000-ffff87e0b000 rw-p 00000000 00:00 0 
ffff87e0b000-ffff87e0c000 ---p 00000000 00:00 0 
ffff87e0c000-ffff87ead000 rw-p 00000000 00:00 0 
ffff87ead000-ffff87eae000 ---p 00000000 00:00 0 
ffff87eae000-ffff87f4f000 rw-p 00000000 00:00 0 
ffff87f4f000-ffff87f50000 ---p 00000000 00:00 0 
ffff87f50000-ffff87ff1000 rw-p 00000000 00:00 0 
ffff87ff1000-ffff87ff2000 ---p 00000000 00:00 0 
ffff87ff2000-ffff88093000 rw-p 00000000 00:00 0 
ffff88093000-ffff88094000 ---p 00000000 00:00 0 
ffff88094000-ffff88135000 rw-p 00000000 00:00 0 
ffff88135000-ffff88136000 ---p 00000000 00:00 0 
ffff88136000-ffff881d7000 rw-p 00000000 00:00 0 
ffff881d7000-ffff881d8000 ---p 00000000 00:00 0 
ffff881d8000-ffff88279000 rw-p 00000000 00:00 0 
ffff88279000-ffff8827a000 ---p 00000000 00:00 0 
ffff8827a000-ffff8a324000 rw-p 00000000 00:00 0 
ffff8a32f000-ffff8a335000 r-xp 00000000 fe:01 672241                     /usr/local/lib/ruby/3.0.0/aarch64-linux/strscan.so
ffff8a335000-ffff8a344000 ---p 00006000 fe:01 672241                     /usr/local/lib/ruby/3.0.0/aarch64-linux/strscan.so
ffff8a344000-ffff8a345000 r--p 00005000 fe:01 672241                     /usr/local/lib/ruby/3.0.0/aarch64-linux/strscan.so
ffff8a345000-ffff8a346000 rw-p 00006000 fe:01 672241                     /usr/local/lib/ruby/3.0.0/aarch64-linux/strscan.so
ffff8a346000-ffff8a34c000 r-xp 00000000 fe:01 672234                     /usr/local/lib/ruby/3.0.0/aarch64-linux/psych.so
ffff8a34c000-ffff8a35b000 ---p 00006000 fe:01 672234                     /usr/local/lib/ruby/3.0.0/aarch64-linux/psych.so
ffff8a35b000-ffff8a35c000 r--p 00005000 fe:01 672234                     /usr/local/lib/ruby/3.0.0/aarch64-linux/psych.so
ffff8a35c000-ffff8a35d000 rw-p 00006000 fe:01 672234                     /usr/local/lib/ruby/3.0.0/aarch64-linux/psych.so
ffff8a35d000-ffff8a360000 r-xp 00000000 fe:01 803781                     /usr/local/lib/ruby/3.0.0/aarch64-linux/cgi/escape.so
ffff8a360000-ffff8a36f000 ---p 00003000 fe:01 803781                     /usr/local/lib/ruby/3.0.0/aarch64-linux/cgi/escape.so
ffff8a36f000-ffff8a370000 r--p 00002000 fe:01 803781                     /usr/local/lib/ruby/3.0.0/aarch64-linux/cgi/escape.so
ffff8a370000-ffff8a371000 rw-p 00003000 fe:01 803781                     /usr/local/lib/ruby/3.0.0/aarch64-linux/cgi/escape.so
ffff8a371000-ffff8a374000 r-xp 00000000 fe:01 803850                     /usr/local/lib/ruby/3.0.0/aarch64-linux/enc/windows_31j.so
ffff8a374000-ffff8a383000 ---p 00003000 fe:01 803850                     /usr/local/lib/ruby/3.0.0/aarch64-linux/enc/windows_31j.so
ffff8a383000-ffff8a384000 r--p 00002000 fe:01 803850                     /usr/local/lib/ruby/3.0.0/aarch64-linux/enc/windows_31j.so
ffff8a384000-ffff8a385000 rw-p 00003000 fe:01 803850                     /usr/local/lib/ruby/3.0.0/aarch64-linux/enc/windows_31j.so
ffff8a385000-ffff8a486000 rw-p 00000000 00:00 0 
ffff8a486000-ffff8a4db000 r--p 00000000 fe:01 799945                     /usr/lib/locale/C.UTF-8/LC_CTYPE
ffff8a4db000-ffff8a4dd000 rw-p 00000000 00:00 0 
ffff8a4dd000-ffff8a576000 r-xp 00000000 fe:01 531440                     /lib/aarch64-linux-gnu/libm-2.31.so
ffff8a576000-ffff8a586000 ---p 00099000 fe:01 531440                     /lib/aarch64-linux-gnu/libm-2.31.so
ffff8a586000-ffff8a587000 r--p 00099000 fe:01 531440                     /lib/aarch64-linux-gnu/libm-2.31.so
ffff8a587000-ffff8a588000 rw-p 0009a000 fe:01 531440                     /lib/aarch64-linux-gnu/libm-2.31.so
ffff8a588000-ffff8a5b7000 r-xp 00000000 fe:01 531426                     /lib/aarch64-linux-gnu/libcrypt.so.1.1.0
ffff8a5b7000-ffff8a5c7000 ---p 0002f000 fe:01 531426                     /lib/aarch64-linux-gnu/libcrypt.so.1.1.0
ffff8a5c7000-ffff8a5c8000 r--p 0002f000 fe:01 531426                     /lib/aarch64-linux-gnu/libcrypt.so.1.1.0
ffff8a5c8000-ffff8a5c9000 rw-p 00030000 fe:01 531426                     /lib/aarch64-linux-gnu/libcrypt.so.1.1.0
ffff8a5c9000-ffff8a5d1000 rw-p 00000000 00:00 0 
ffff8a5d1000-ffff8a5d4000 r-xp 00000000 fe:01 531427                     /lib/aarch64-linux-gnu/libdl-2.31.so
ffff8a5d4000-ffff8a5e3000 ---p 00003000 fe:01 531427                     /lib/aarch64-linux-gnu/libdl-2.31.so
ffff8a5e3000-ffff8a5e4000 r--p 00002000 fe:01 531427                     /lib/aarch64-linux-gnu/libdl-2.31.so
ffff8a5e4000-ffff8a5e5000 rw-p 00003000 fe:01 531427                     /lib/aarch64-linux-gnu/libdl-2.31.so
ffff8a5e5000-ffff8a65b000 r-xp 00000000 fe:01 532178                     /usr/lib/aarch64-linux-gnu/libgmp.so.10.4.1
ffff8a65b000-ffff8a66b000 ---p 00076000 fe:01 532178                     /usr/lib/aarch64-linux-gnu/libgmp.so.10.4.1
ffff8a66b000-ffff8a66c000 r--p 00076000 fe:01 532178                     /usr/lib/aarch64-linux-gnu/libgmp.so.10.4.1
ffff8a66c000-ffff8a66d000 rw-p 00077000 fe:01 532178                     /usr/lib/aarch64-linux-gnu/libgmp.so.10.4.1
ffff8a66d000-ffff8a674000 r-xp 00000000 fe:01 531466                     /lib/aarch64-linux-gnu/librt-2.31.so
ffff8a674000-ffff8a683000 ---p 00007000 fe:01 531466                     /lib/aarch64-linux-gnu/librt-2.31.so
ffff8a683000-ffff8a684000 r--p 00006000 fe:01 531466                     /lib/aarch64-linux-gnu/librt-2.31.so
ffff8a684000-ffff8a685000 rw-p 00007000 fe:01 531466                     /lib/aarch64-linux-gnu/librt-2.31.so
ffff8a685000-ffff8a6a1000 r-xp 00000000 fe:01 531462                     /lib/aarch64-linux-gnu/libpthread-2.31.so
ffff8a6a1000-ffff8a6b0000 ---p 0001c000 fe:01 531462                     /lib/aarch64-linux-gnu/libpthread-2.31.so
ffff8a6b0000-ffff8a6b1000 r--p 0001b000 fe:01 531462                     /lib/aarch64-linux-gnu/libpthread-2.31.so
ffff8a6b1000-ffff8a6b2000 rw-p 0001c000 fe:01 531462                     /lib/aarch64-linux-gnu/libpthread-2.31.so
ffff8a6b2000-ffff8a6b6000 rw-p 00000000 00:00 0 
ffff8a6b6000-ffff8a6cf000 r-xp 00000000 fe:01 531481                     /lib/aarch64-linux-gnu/libz.so.1.2.11
ffff8a6cf000-ffff8a6de000 ---p 00019000 fe:01 531481                     /lib/aarch64-linux-gnu/libz.so.1.2.11
ffff8a6de000-ffff8a6df000 r--p 00018000 fe:01 531481                     /lib/aarch64-linux-gnu/libz.so.1.2.11
ffff8a6df000-ffff8a6e0000 rw-p 00019000 fe:01 531481                     /lib/aarch64-linux-gnu/libz.so.1.2.11
ffff8a6e0000-ffff8a83d000 r-xp 00000000 fe:01 531419                     /lib/aarch64-linux-gnu/libc-2.31.so
ffff8a83d000-ffff8a84d000 ---p 0015d000 fe:01 531419                     /lib/aarch64-linux-gnu/libc-2.31.so
ffff8a84d000-ffff8a850000 r--p 0015d000 fe:01 531419                     /lib/aarch64-linux-gnu/libc-2.31.so
ffff8a850000-ffff8a853000 rw-p 00160000 fe:01 531419                     /lib/aarch64-linux-gnu/libc-2.31.so
ffff8a853000-ffff8a856000 rw-p 00000000 00:00 0 
ffff8a856000-ffff8ac0e000 r-xp 00000000 fe:01 672211                     /usr/local/lib/libruby.so.3.0.2
ffff8ac0e000-ffff8ac1d000 ---p 003b8000 fe:01 672211                     /usr/local/lib/libruby.so.3.0.2
ffff8ac1d000-ffff8ac24000 r--p 003b7000 fe:01 672211                     /usr/local/lib/libruby.so.3.0.2
ffff8ac24000-ffff8ac28000 rw-p 003be000 fe:01 672211                     /usr/local/lib/libruby.so.3.0.2
ffff8ac28000-ffff8ac38000 rw-p 00000000 00:00 0 
ffff8ac38000-ffff8ac59000 r-xp 00000000 fe:01 531407                     /lib/aarch64-linux-gnu/ld-2.31.so
ffff8ac5a000-ffff8ac5c000 rw-p 00000000 00:00 0 
ffff8ac5d000-ffff8ac64000 r--s 00000000 fe:01 532147                     /usr/lib/aarch64-linux-gnu/gconv/gconv-modules.cache
ffff8ac64000-ffff8ac66000 rw-p 00000000 00:00 0 
ffff8ac66000-ffff8ac68000 r--p 00000000 00:00 0                          [vvar]
ffff8ac68000-ffff8ac69000 r-xp 00000000 00:00 0                          [vdso]
ffff8ac69000-ffff8ac6a000 r--p 00021000 fe:01 531407                     /lib/aarch64-linux-gnu/ld-2.31.so
ffff8ac6a000-ffff8ac6c000 rw-p 00022000 fe:01 531407                     /lib/aarch64-linux-gnu/ld-2.31.so
ffffe8bb3000-ffffe93b2000 rw-p 00000000 00:00 0                          [stack]

Removing the fork works fine.

@lloeki
Copy link
Collaborator Author

lloeki commented Oct 22, 2021

Thanks. This is probably due to rubyjs/mini_racer#170, as there was no development yet to use the new single threaded mode.

@tisba
Copy link

tisba commented Oct 22, 2021

Thanks. This is probably due to rubyjs/mini_racer#170, as there was no development yet to use the new single threaded mode.

Yeah I know, just wanted to check this too.

As I use mini_racer in a normal Rails application as part of the business logic, this is blocking us from updating from mini_racer 0.2.15 where this is not a problem. The main issue is, that if you fork anywhere, even unrelated to mini_racer usage, the problem is triggered.

Back to topic: I'll try to run our large internal test suite against this build later.

@tisba
Copy link

tisba commented Jan 18, 2022

For reference: mini_racer 0.6.2 with MiniRacer::Platform.set_flags!(:single_threaded) works now even with forking and on aarch64-linux, x86_64-linux, arm64-darwin21 and x86_64-darwin21.

I think what is "missing" for Linux ARM targets is mostly musl libc builds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants