ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: "byroot (Jean Boussier) via ruby-core" <ruby-core@ml.ruby-lang.org>
To: ruby-core@ml.ruby-lang.org
Cc: "byroot (Jean Boussier)" <noreply@ruby-lang.org>
Subject: [ruby-core:120825] [Ruby master Bug#21096] Ruby hangs up when compiling for bytecode on AArch64 emulated by QEMU
Date: Wed, 29 Jan 2025 11:40:23 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-111692.20250129114022.38767@ruby-lang.org> (raw)
In-Reply-To: <redmine.issue-21096.20250129072809.38767@ruby-lang.org>

Issue #21096 has been updated by byroot (Jean Boussier).


As mentioned on the Rails issue, this is unlikely to be debugged unless a reproducer is provided, which does include a Ruby script or application that cause the hang when compiled, and the precise host and container versions.


----------------------------------------
Bug #21096: Ruby hangs up when compiling for bytecode on AArch64 emulated by QEMU
https://bugs.ruby-lang.org/issues/21096#change-111692

* Author: midnight (Sarun R)
* Status: Open
* ruby -v: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [x86_64-linux]
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
Hello,

We are experiencing issues when using [Bootsnap](https://github.com/Shopify/bootsnap) for production container image building, specifically when running `bundle exec bootsnap precompile --gemfile` on an emulated ARM64 environment on AMD64 hosts.

Here are more details:
* Bootsnap is a Ruby gem for bytecode caching, which speeds up loading times. It achieves this by calling `RubyVM::InstructionSequence.compile_file` and `RubyVM::InstructionSequence.load_from_binary`.
* When running `bundle exec bootsnap precompile --gemfile` in the environment described (using QEMU to emulate the AArch64 instruction set), the process can compile and generate some bytecode but eventually hangs.
* The hang seems random, occurring at different points during the process.
* According to [a Rails GitHub issue](https://github.com/rails/rails/issues/54039), the issue affects both `Docker` and `containerd`, as well as native Linux and macOS environments.
* From [a Bootsnap GitHub issue](https://github.com/Shopify/bootsnap/issues/495), the problem likely doesn't occur in Ruby `3.2.6` but appears in later versions.
* So far, the common factors observed are:
  * Emulated ARM64 on AMD64 CPUs (likely using QEMU)
  * Newer Ruby versions (e.g., 3.3 and 3.4)

As a user, I don't have the expertise to debug the issue but am willing to gather more information if provided with sufficient instructions.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

  reply	other threads:[~2025-01-29 11:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-29  7:28 [ruby-core:120817] " midnight (Sarun R) via ruby-core
2025-01-29 11:40 ` byroot (Jean Boussier) via ruby-core [this message]
2025-01-29 14:14 ` [ruby-core:120828] " midnight (Sarun R) via ruby-core
2025-02-14  4:33 ` [ruby-core:121015] [Ruby master Bug#21096] `Process.fork` hangs up on QEMU when called multiple times midnight (Sarun R) via ruby-core
2025-02-14  8:15 ` [ruby-core:121042] " byroot (Jean Boussier) via ruby-core
2025-03-11  7:21 ` [ruby-core:121283] " mame (Yusuke Endoh) via ruby-core

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-111692.20250129114022.38767@ruby-lang.org \
    --to=ruby-core@ml.ruby-lang.org \
    --cc=noreply@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).