Project

General

Profile

Actions

Bug #18895

closed

Mac M1 Monterey 12.4 - Bus error at active support

Added by shyamc (Shyam Sundhar C) almost 2 years ago. Updated almost 2 years ago.

Status:
Feedback
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.8p459 (2018-10-18 revision 65136) [x86_64-darwin21]
[ruby-core:109122]

Description

Hi All,

I have been using intel Mac for a long time. Just moving to M1 environment. Got several issues during bundle install but was able to fix it. Now when I run 'bundle exec rails s' and any callbacks is being called, I am getting this bug with lengthy terminal output.

Checked out and tried the existing issue : https://bugs.ruby-lang.org/issues/18555 but unable to resolve it.

So here I am, looking for help.

/Users/schockalingam/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/activesupport-3.2.22.5/lib/active_support/callbacks.rb:162: [BUG] Bus Error at 0x000000030db30ff8
ruby 2.3.8p459 (2018-10-18 revision 65136) [x86_64-darwin21]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:
     * ~/Library/Logs/CrashReporter
     * /Library/Logs/CrashReporter
     * ~/Library/Logs/DiagnosticReports
     * /Library/Logs/DiagnosticReports
   for more details.
Don't forget to include the above Crash Report log file in bug reports.

-- Control frame information -----------------------------------------------
c:0151 p:---- s:0859 e:000858 CFUNC  :class_eval
c:0150 p:0044 s:0853 e:000852 METHOD /Users/schockalingam/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/activesupport-3.2.22.5/lib/active_support/callbacks.rb:162
c:0149 p:0089 s:0849 e:000848 METHOD /Users/schockalingam/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/activesupport-3.2.22.5/lib/active_support/callbacks.rb:107 [FINISH]
c:0148 p:---- s:0841 e:000840 CFUNC  :new
c:0147 p:0026 s:0833 e:000832 BLOCK  /Users/schockalingam/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/activesupport-3.2.22.5/lib/active_support/callbacks.rb:496 [FINISH]

Thanks in advance,
Shyam C


Files

ruby-2022-07-03-152254.ips (33.8 KB) ruby-2022-07-03-152254.ips Diagnostic report shyamc (Shyam Sundhar C), 07/03/2022 12:33 PM
gem_env.txt (1.39 KB) gem_env.txt Gem environment shyamc (Shyam Sundhar C), 07/03/2022 12:34 PM
terminal_output.txt (944 KB) terminal_output.txt Terminal output shyamc (Shyam Sundhar C), 07/03/2022 12:37 PM

Updated by peterzhu2118 (Peter Zhu) almost 2 years ago

  • Status changed from Open to Feedback

Thank you for the bug report, however support for Ruby 2.3 has ended in 2019. Please update to Ruby 2.7.6 or later and open an issue if you still run into this issue.

Updated by austin (Austin Ziegler) almost 2 years ago

peterzhu2118 (Peter Zhu) wrote in #note-1:

Thank you for the bug report, however support for Ruby 2.3 has ended in 2019. Please update to Ruby 2.7.6 or later and open an issue if you still run into this issue.

This also has the feeling of running an Intel version of Ruby where there is likely some dependency on a library that has now been compiled as aarch64. My guess would be that ~/.rbenv was copied from the Intel macOS machine without necessarily copying /usr/local/… (the Intel location for Homebrew).

Updated by shyamc (Shyam Sundhar C) almost 2 years ago

austin (Austin Ziegler) wrote in #note-2:

peterzhu2118 (Peter Zhu) wrote in #note-1:

Thank you for the bug report, however support for Ruby 2.3 has ended in 2019. Please update to Ruby 2.7.6 or later and open an issue if you still run into this issue.

This also has the feeling of running an Intel version of Ruby where there is likely some dependency on a library that has now been compiled as aarch64. My guess would be that ~/.rbenv was copied from the Intel macOS machine without necessarily copying /usr/local/… (the Intel location for Homebrew).

I have installed the rbenv with command arch -x86_64 brew install rbenv ruby-build.

Also I am not sure that its an option where I can copy the ~/.rbenv and homebrew files from intel to M1. Can you please advice ?

Updated by austin (Austin Ziegler) almost 2 years ago

shyamc (Shyam Sundhar C) wrote in #note-3:

I have installed the rbenv with command arch -x86_64 brew install rbenv ruby-build.

Also I am not sure that its an option where I can copy the ~/.rbenv and homebrew files from intel to M1. Can you please advice ?

Yeah, don’t do that. Either one.

Unless there is something that you must absolutely link against an extant x86 library that isn’t source available, always build native.

Running under x86 on M1 is possible, but:

  1. Not all x86 instructions work (sometimes resulting in segfaults)
  2. There is a performance hit involved, even if it is negligible most of the time.

If you cannot build Ruby 2.3 or the necessary gems as native M1 (aarch64, which is entirely possible because Ruby 2.3 EOLed in 2019), then consider shifting your workflow for your older application so that you are running it in a Docker image, where you’re unlikely to have mixed binary formats.

I’ve been using M1 for a while now, and if you find yourself typing arch -x86_64 for pretty much anything, you’re doing it wrong (I haven’t had to do so in more than a year, although I’m also using new versions of Ruby, not Ruby 2.3).

Updated by shyamc (Shyam Sundhar C) almost 2 years ago

austin (Austin Ziegler) wrote in #note-4:

shyamc (Shyam Sundhar C) wrote in #note-3:

I have installed the rbenv with command arch -x86_64 brew install rbenv ruby-build.

Also I am not sure that its an option where I can copy the ~/.rbenv and homebrew files from intel to M1. Can you please advice ?

Yeah, don’t do that. Either one.

Unless there is something that you must absolutely link against an extant x86 library that isn’t source available, always build native.

Running under x86 on M1 is possible, but:

  1. Not all x86 instructions work (sometimes resulting in segfaults)
  2. There is a performance hit involved, even if it is negligible most of the time.

If you cannot build Ruby 2.3 or the necessary gems as native M1 (aarch64, which is entirely possible because Ruby 2.3 EOLed in 2019), then consider shifting your workflow for your older application so that you are running it in a Docker image, where you’re unlikely to have mixed binary formats.

I’ve been using M1 for a while now, and if you find yourself typing arch -x86_64 for pretty much anything, you’re doing it wrong (I haven’t had to do so in more than a year, although I’m also using new versions of Ruby, not Ruby 2.3).

Yea. I understand. I have plans to migrate the ruby version but for now I can't get into that. Running that in a docker container makes more sense for me at this time. Thanks !

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0