Issue #22073 has been updated by taq (Eustaquio Rangel). Update / Resolution: After further investigation, I was able to identify the root cause. The issue was not with Ruby 3.4.9, GCC 15.2, or Ubuntu 26.04 itself. My home directory is mounted with eCryptfs (Ubuntu's home directory encryption). The RVM installation resides in ~/.rvm/, which is inside the encrypted filesystem. When compiling native gems, mkmf writes the .so file and immediately loads it — and eCryptfs apparently does not guarantee that a freshly written binary is immediately available for execution, causing segfaults at load time. Confirmation: reinstalling RVM in /opt/rvm (outside the encrypted filesystem) and reinstalling Ruby 3.4.9 there resolved all segfaults completely. The same bundle install that previously crashed now works without issues. The same root cause also explained segfaults I was seeing when building Neovim from source in my home directory — it compiles LuaJIT in .deps/ and immediately executes it during the build process. Building in /opt worked fine. Ruby 3.4.9, GCC 15.2, and Ubuntu 26.04 are not at fault. I apologize for the noise. Hopefully this helps someone else who hits the same issue with eCryptfs and native extensions. ---------------------------------------- Bug #22073: Ruby 3.4.9 segfaults when loading native default gems compiled on Ubuntu 26.04 (GCC 15.2); Ruby 4.0.3 unaffected on same system https://bugs.ruby-lang.org/issues/22073#change-117365 * Author: taq (Eustaquio Rangel) * Status: Open * ruby -v: 3.4.9 * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- Hello, I'm reporting a reproducible issue on Ruby 3.4.9 on a freshly upgraded Ubuntu 26.04 LTS. Please let me know if you'd prefer this as a comment on #21655 instead. On Ubuntu 26.04 LTS, Ruby 3.4.9 produces unusable binaries when compiling current versions of native default gems (prism, cgi, date, io-console, rbs, and likely others). The versions of these gems that ship with the Ruby tarball work fine, but as soon as bundle install (or any gem install) compiles a newer version of them in the local environment, loading those gems segfaults or bus-errors immediately. Ruby 4.0.3 on the same machine, same toolchain, same Ubuntu installation does not exhibit this problem. My environment: OS: Ubuntu 26.04 LTS (Resolute Raccoon), upgraded today Kernel: 7.0.0-15-generic glibc: ldd (Ubuntu GLIBC 2.43-2ubuntu2) 2.43 System GCC: gcc (Ubuntu 15.2.0-16ubuntu1) 15.2.0 (default is GCC 15.2 on this release; GCC 14 also tested via apt install gcc-14) Ruby: ruby 3.4.9 (2026-03-11 revision 76cca827ab) +YJIT +PRISM [x86_64-linux] Reproduced with both RVM and rbenv (independent installations) 1. Install Ruby 3.4.9 on Ubuntu 26.04. irb works. 2. gem install bundler && bundle install in any project with a non-trivial Gemfile (e.g. Rails 8). Among other things, this installs newer versions of default gems: prism 1.9.0, cgi 0.5.1, date 3.5.1, io-console 0.8.2, etc. 3. Run irb (or any Ruby that loads one of those gems). Segfault or bus error on loading the native .so. The crashing extension varies depending on load order, but I've reproduced it in prism.so, cgi/escape.so, date_core.so, io/console.so, and rbs_extension.so. Removing the newer gem from the gemset (e.g. rm -rf ~/.rvm/gems/ruby-3.4.9/gems/prism-1.9.0) causes Ruby to fall back to the older version that ships with the Ruby tarball (prism 1.5.2), which works — until the next crash on another default gem. Ruby 4.0.3 installed via the same RVM, on the same Ubuntu 26.04 system, runs a non-trivial Rails 8 application with bundle install and bundle exec working without any crashes. This suggests the fix (or whatever change avoids the issue) is on master/4.0 and was not backported to the 3.4 branch. Workarounds attempted (none successful): 1. rvm get stable to install all current Ruby build dependencies (including libncurses5-dev which was initially missing). Ruby itself rebuilt; gems still crash. 2. Rebuilding Ruby with CFLAGS="-fno-ipa-modref" per #21655. RbConfig::CONFIG["CFLAGS"] confirms the flag is in the build. Gems still crash. (Note: I have not verified whether the flag is propagated to the gem build via mkmf.) 3. Rebuilding Ruby with CC=gcc-14 CXX=g++-14 (GCC 14 is available in default 26.04 repositories). Gems still crash. 4. Reinstalling Ruby 3.4.9 via rbenv (independent of RVM) and reproducing from scratch. Same crash. Happy to provide additional information — debug build, full gdb backtrace, build logs, etc. Just let me know what would be most useful. Thank you. -- https://bugs.ruby-lang.org/