brew: Error: `send_io()` function is unimplemented on this machine

brew gist-logs <formula> link OR brew config AND brew doctor output

~ brew config
HOMEBREW_VERSION: 3.2.1
ORIGIN: https://github.com/Homebrew/brew
HEAD: 35b15af4005ff0140a73a64e48abb4cbc85cc270
Last commit: 4 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: d0e381b9df56e4a3ae8a093d0d4a7ffafc2268ca
Core tap last commit: 37 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.y1oWFGfmgW/org.macosforge.xquartz:0
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit haswell
Clang: 12.0.5 build 1205
Git: 2.32.0 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 11.5-x86_64
CLT: 12.5.1.0.1.1623191612
Xcode: N/A
 ~ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
  /Users/<username>/.pyenv/shims/icu-config
  /Users/<username>/.pyenv/shims/krb5-config
  /Users/<username>/.pyenv/shims/libpng16-config
  /Users/<username>/.pyenv/shims/python3.9-config
  /Users/<username>/.pyenv/shims/python-config
  /Users/<username>/.pyenv/shims/python3-config
  /Users/<username>/.pyenv/shims/ncursesw6-config
  /Users/<username>/.pyenv/shims/pcre-config
  /Users/<username>/.pyenv/shims/ncurses6-config
  /Users/<username>/.pyenv/shims/python3.8-config
  /Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10-config
  /Library/Frameworks/Python.framework/Versions/3.10/bin/python3-config
  /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8-config

  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.

What were you trying to do (and why)?

I was trying to upgrade my outdated packages.

I ran brew update first, then brew upgrade, so that my packages were up-to-date.

What happened (include all command output)?

~ brew upgrade
==> Upgrading 2 outdated packages:
hashicorp/tap/terraform 1.0.1 -> 1.0.2
libuv 1.41.0 -> 1.41.1
==> Upgrading hashicorp/tap/terraform
 1.0.1 -> 1.0.2

==> Downloading https://releases.hashicorp.com/terraform/1.0.2/terraform_1.0.2_darwin_amd64.zip
######################################################################## 100.0%
Error: send_io() function is unimplemented on this machine
Please report this issue:
 https://docs.brew.sh/Troubleshooting
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:79:in `send_io'
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:79:in `block (3 levels) in safe_fork'
/usr/local/Homebrew/Library/Homebrew/utils.rb:417:in `ignore_interrupts'
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:73:in `block (2 levels) in safe_fork'
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:34:in `open'
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:34:in `block in safe_fork'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/tmpdir.rb:93:in `mktmpdir'
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:33:in `safe_fork'
/usr/local/Homebrew/Library/Homebrew/formula_installer.rb:868:in `build'
/usr/local/Homebrew/Library/Homebrew/formula_installer.rb:419:in `install'
/usr/local/Homebrew/Library/Homebrew/upgrade.rb:146:in `upgrade_formula'
/usr/local/Homebrew/Library/Homebrew/upgrade.rb:47:in `block in upgrade_formulae'
/usr/local/Homebrew/Library/Homebrew/upgrade.rb:44:in `each'
/usr/local/Homebrew/Library/Homebrew/upgrade.rb:44:in `upgrade_formulae'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:178:in `upgrade_outdated_formulae'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:106:in `upgrade'
/usr/local/Homebrew/Library/Homebrew/brew.rb:122:in `<main>'
Traceback (most recent call last):
   2: from /usr/local/Homebrew/Library/Homebrew/build.rb:221:in `<main>'
   1: from /usr/local/Homebrew/Library/Homebrew/build.rb:221:in `open'
/usr/local/Homebrew/Library/Homebrew/build.rb:221:in `recv_io': file descriptor was not passed (msg_controllen=0 smaller than sizeof(struct cmsghdr)=12) (SocketError)
   1: from /usr/local/Homebrew/Library/Homebrew/build.rb:217:in `<main>'
/usr/local/Homebrew/Library/Homebrew/build.rb:256:in `rescue in <main>': private method `puts' called for nil:NilClass (NoMethodError)

~ Traceback (most recent call last):                                                                                                                                                                                                       
   18: from /usr/local/Homebrew/Library/Homebrew/brew.rb:122:in `<main>'
   17: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:106:in `upgrade'
   16: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:178:in `upgrade_outdated_formulae'
   15: from /usr/local/Homebrew/Library/Homebrew/upgrade.rb:44:in `upgrade_formulae'
   14: from /usr/local/Homebrew/Library/Homebrew/upgrade.rb:44:in `each'
   13: from /usr/local/Homebrew/Library/Homebrew/upgrade.rb:47:in `block in upgrade_formulae'
   12: from /usr/local/Homebrew/Library/Homebrew/upgrade.rb:146:in `upgrade_formula'
   11: from /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:419:in `install'
   10: from /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:868:in `build'
    9: from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:33:in `safe_fork'
    8: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/tmpdir.rb:93:in `mktmpdir'
    7: from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:34:in `block in safe_fork'
    6: from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:34:in `open'
    5: from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:37:in `block (2 levels) in safe_fork'
    4: from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:37:in `fork'
    3: from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:45:in `block (3 levels) in safe_fork'
    2: from /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:880:in `block in build'
    1: from /usr/local/Homebrew/Library/Homebrew/sandbox.rb:99:in `exec'
/usr/local/Homebrew/Library/Homebrew/utils.rb:322:in `safe_system': Failure while executing; `/usr/bin/sandbox-exec -f /private/tmp/homebrew20210708-13548-1nwm9s1.sb nice /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -W1 -- /usr/local/Homebrew/Library/Homebrew/build.rb /usr/local/Homebrew/Library/Taps/hashicorp/homebrew-tap/Formula/terraform.rb` exited with 1. (ErrorDuringExecution)
   18: from /usr/local/Homebrew/Library/Homebrew/brew.rb:122:in `<main>'
   17: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:106:in `upgrade'
   16: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:178:in `upgrade_outdated_formulae'
   15: from /usr/local/Homebrew/Library/Homebrew/upgrade.rb:44:in `upgrade_formulae'
   14: from /usr/local/Homebrew/Library/Homebrew/upgrade.rb:44:in `each'
   13: from /usr/local/Homebrew/Library/Homebrew/upgrade.rb:47:in `block in upgrade_formulae'
   12: from /usr/local/Homebrew/Library/Homebrew/upgrade.rb:146:in `upgrade_formula'
   11: from /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:419:in `install'
   10: from /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:868:in `build'
    9: from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:33:in `safe_fork'
    8: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/tmpdir.rb:93:in `mktmpdir'
    7: from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:34:in `block in safe_fork'
    6: from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:34:in `open'
    5: from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:37:in `block (2 levels) in safe_fork'
    4: from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:37:in `fork'
    3: from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:39:in `block (3 levels) in safe_fork'
    2: from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:65:in `rescue in block (3 levels) in safe_fork'
    1: from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:65:in `puts'
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:65:in `write': Broken pipe (Errno::EPIPE)

What did you expect to happen?

I expected the upgrade to run successfully.

Step-by-step reproduction instructions (by running brew commands)

brew update
brew upgrade

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 3
  • Comments: 17 (6 by maintainers)

Most upvoted comments

@lyzlisa can you try setting HOMEBREW_FORCE_VENDOR_RUBY and see if that helps? You can just do export HOMEBREW_FORCE_VENDOR_RUBY=1.

This won’t work on ARM, unfortunately.

And finally, I’ve filed FB9302034 with Apple if anyone else can replicate this and wants to dupe it.

Thanks, @Developer-Ecosystem-Engineering!

This should be fixed now, so if anyone else is still having issues with it, please update to today’s RC.

I can confirm that all of the Ruby specs pass with the system Ruby in macOS 11.5 20G70, and that the brew postinstall/safe_fork works correctly.

Thanks, mysterious multi-headed Apple engineers!

@lyzlisa It’s possible that the upgrade was marked as complete despite it possibly failing. I would try

brew reinstall hashicorp/tap/terraform

and see if that completes successfully (after doing export HOMEBREW_FORCE_VENDOR_RUBY=1 still)

but the original reporter shows 11.5, and I’m willing to bet they’re on 11.5b5 too

@dotsam, that’s correct, I started seeing after upgrading to b5

You can just do export HOMEBREW_FORCE_VENDOR_RUBY=1

@carlocab Does this seem right?

$ export HOMEBREW_FORCE_VENDOR_RUBY=1
$ brew update
Already up-to-date.
$ brew upgrade
==> Downloading https://ghcr.io/v2/homebrew/portable-ruby/portable-ruby/blobs/sha256:b065e5e3783954f3e65d8d3a6377ca51649bfcfa21b356b0dd70490f74c6bd86
#=#=-  #       #                                                                                                                                                                                                                                               #=O=#     #        #                                                                                                                                                                                                                                           -#O=- #      #          #                                                                                                                                                                                                                                      -=O#-   #        #           #                     ######################################################################################################################################################################################################################################################### 100.0%
==> Pouring portable-ruby-2.6.3_2.yosemite.bottle.tar.gz

I’m seeing this too on my first brew upgrade since installing 11.5b5. brew config doesn’t show OS build, but the original reporter shows 11.5, and I’m willing to bet they’re on 11.5b5 too. What I can see is that the original report is on Intel, and I’m on Apple Silicon with an M1 Air, so architecture doesn’t seem to matter, but I’m guessing something has changed/broken in 11.5b5.

Doing a little testing, I initially thought this might be related to sandbox-exec, but manually disabling brew’s use of sandbox-exec for sandboxing still produces the same result:

brew postinstall libomp --debug --verbose
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/libomp.rb
==> Postinstalling libomp
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::FromPathLoader): loading /opt/homebrew/opt/libomp/.brew/libomp.rb
Warning: The post-install step did not complete successfully
You can try again using:
  brew postinstall libomp
==> send_io() function is unimplemented on this machine
/opt/homebrew/Library/Homebrew/utils/fork.rb:79:in `send_io'
/opt/homebrew/Library/Homebrew/utils/fork.rb:79:in `block (3 levels) in safe_fork'
/opt/homebrew/Library/Homebrew/utils.rb:417:in `ignore_interrupts'
/opt/homebrew/Library/Homebrew/utils/fork.rb:73:in `block (2 levels) in safe_fork'
/opt/homebrew/Library/Homebrew/utils/fork.rb:34:in `open'
/opt/homebrew/Library/Homebrew/utils/fork.rb:34:in `block in safe_fork'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/tmpdir.rb:93:in `mktmpdir'
/opt/homebrew/Library/Homebrew/utils/fork.rb:33:in `safe_fork'
/opt/homebrew/Library/Homebrew/formula_installer.rb:1084:in `post_install'
/opt/homebrew/Library/Homebrew/cmd/postinstall.rb:30:in `block in postinstall'
/opt/homebrew/Library/Homebrew/cmd/postinstall.rb:27:in `each'
/opt/homebrew/Library/Homebrew/cmd/postinstall.rb:27:in `postinstall'
/opt/homebrew/Library/Homebrew/brew.rb:122:in `<main>'
Traceback (most recent call last):
        2: from /opt/homebrew/Library/Homebrew/postinstall.rb:15:in `<main>'
        1: from /opt/homebrew/Library/Homebrew/postinstall.rb:15:in `open'
/opt/homebrew/Library/Homebrew/postinstall.rb:15:in `recv_io': file descriptor was not passed (msg_controllen=0 smaller than sizeof(struct cmsghdr)=12) (SocketError)
        1: from /opt/homebrew/Library/Homebrew/postinstall.rb:13:in `<main>'
/opt/homebrew/Library/Homebrew/postinstall.rb:24:in `rescue in <main>': private method `puts' called for nil:NilClass (NoMethodError)

And indeed, running the ruby unixsocket specs also fails:

$ ../mspec/bin/mspec library/socket/unixsocket
$ ruby /Users/sam/Developer/ruby/mspec/bin/mspec-run library/socket/unixsocket
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20]
.....................................EEEEE...........EE.....

1)
UNIXSocket#recv_io reads an IO object across the socket ERROR
NotImplementedError: send_io() function is unimplemented on this machine
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/recv_io_spec.rb:27:in `send_io'
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/recv_io_spec.rb:27:in `block (3 levels) in <top (required)>'
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/recv_io_spec.rb:4:in `<top (required)>'

2)
UNIXSocket#recv_io takes an optional class to use ERROR
NotImplementedError: send_io() function is unimplemented on this machine
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/recv_io_spec.rb:36:in `send_io'
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/recv_io_spec.rb:36:in `block (3 levels) in <top (required)>'
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/recv_io_spec.rb:4:in `<top (required)>'

3)
UNIXSocket#recv_io without a custom class returns an IO ERROR
NotImplementedError: send_io() function is unimplemented on this machine
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/recv_io_spec.rb:62:in `send_io'
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/recv_io_spec.rb:62:in `block (4 levels) in <top (required)>'
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/recv_io_spec.rb:47:in `block in <top (required)>'
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/recv_io_spec.rb:46:in `<top (required)>'

4)
UNIXSocket#recv_io with a custom class returns an instance of the custom class ERROR
NotImplementedError: send_io() function is unimplemented on this machine
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/recv_io_spec.rb:71:in `send_io'
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/recv_io_spec.rb:71:in `block (4 levels) in <top (required)>'
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/recv_io_spec.rb:47:in `block in <top (required)>'
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/recv_io_spec.rb:46:in `<top (required)>'

5)
UNIXSocket#recv_io with a custom mode opens the IO using the given mode ERROR
NotImplementedError: send_io() function is unimplemented on this machine
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/recv_io_spec.rb:80:in `send_io'
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/recv_io_spec.rb:80:in `block (4 levels) in <top (required)>'
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/recv_io_spec.rb:47:in `block in <top (required)>'
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/recv_io_spec.rb:46:in `<top (required)>'

6)
UNIXSocket#send_io sends the fd for an IO object across the socket ERROR
NotImplementedError: send_io() function is unimplemented on this machine
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/send_io_spec.rb:27:in `send_io'
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/send_io_spec.rb:27:in `block (3 levels) in <top (required)>'
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/send_io_spec.rb:4:in `<top (required)>'

7)
UNIXSocket#send_io sends an IO object ERROR
NotImplementedError: send_io() function is unimplemented on this machine
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/send_io_spec.rb:52:in `send_io'
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/send_io_spec.rb:52:in `block (3 levels) in <top (required)>'
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/send_io_spec.rb:38:in `block in <top (required)>'
/Users/sam/Developer/ruby/spec/library/socket/unixsocket/send_io_spec.rb:37:in `<top (required)>'

Finished in 0.016727 seconds

15 files, 60 examples, 67 expectations, 0 failures, 7 errors, 0 tagged

So this appears to be broken upstream in ruby. This feels like a suspiciously basic thing to have broken though, so I’m inclined to say this is Apple’s bug, but I really don’t know where to go from here to determine one way or another.