brew: Installing Rust-based packages on Linux fails with "cannot normalize PT_NOTE segment" error

brew config output

HOMEBREW_VERSION: 3.6.10
ORIGIN: https://github.com/Homebrew/brew
HEAD: eaf887656ffb8e9e35ccf08081814d4735637564
Last commit: 10 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 02218094c06c0dac51214fb58814394223db799d
Core tap last commit: 10 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 2
Homebrew Ruby: 2.6.8 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.8_1/bin/ruby
CPU: dual-core 64-bit zen
Clang: 14.0.0
Git: 2.34.1 => /bin/git
Curl: 7.81.0 => /bin/curl
Kernel: Linux 5.15.0-1021-oracle x86_64 GNU/Linux
OS: Ubuntu 22.04.1 LTS (jammy)
Host glibc: 2.35
/usr/bin/gcc: 11.3.0
/usr/bin/ruby: N/A
glibc: N/A
gcc@11: N/A
gcc: 12.2.0
xorg: N/A

brew doctor output

Your system is ready to brew.

Verification

  • 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 set up a brand new Linux machine by installing a list of homebrew packages I usually use.

What happened (include all command output)?

All of the installs succeeded, except for several of the packages which were written in Rust. Specifically, attempting to brew install any of dog, dust, rm-improved, or zoxide yields the following error:

==> Downloading https://ghcr.io/v2/homebrew/core/zoxide/manifests/0.8.3
Already downloaded: /home/breq/.cache/Homebrew/downloads/bdd0e6ba45cfabe01c7681d06d90aa4f72e426e93a16f27e0cb6aac1bd638b32--zoxide-0.8.3.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/zoxide/blobs/sha256:518af8008a52ad206b92820ce1dca7eb713bdf63f4ba6509eca3441ef9b8b810
Already downloaded: /home/breq/.cache/Homebrew/downloads/47616426cb3d831cfcda6db9c906104354739366f16f41e5518d640f7c5057a7--zoxide--0.8.3.x86_64_linux.bottle.tar.gz
==> Pouring zoxide--0.8.3.x86_64_linux.bottle.tar.gz
Error: cannot normalize PT_NOTE segment: non-contiguous SHT_NOTE sections
Please report this issue:
  https://docs.brew.sh/Troubleshooting
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/patchelf-1.4.0/lib/patchelf/alt_saver.rb:682:in `normalize_note_segment'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/patchelf-1.4.0/lib/patchelf/alt_saver.rb:659:in `block in normalize_note_segments'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/patchelf-1.4.0/lib/patchelf/alt_saver.rb:955:in `block in phdrs_by_type'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/patchelf-1.4.0/lib/patchelf/alt_saver.rb:952:in `each'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/patchelf-1.4.0/lib/patchelf/alt_saver.rb:952:in `each_with_index'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/patchelf-1.4.0/lib/patchelf/alt_saver.rb:952:in `phdrs_by_type'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/patchelf-1.4.0/lib/patchelf/alt_saver.rb:653:in `normalize_note_segments'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/patchelf-1.4.0/lib/patchelf/alt_saver.rb:638:in `rewrite_sections_library'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/patchelf-1.4.0/lib/patchelf/alt_saver.rb:475:in `rewrite_sections'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/patchelf-1.4.0/lib/patchelf/alt_saver.rb:88:in `save!'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/patchelf-1.4.0/lib/patchelf/patcher.rb:191:in `save'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/os/linux/elf.rb:167:in `save_using_patchelf_rb'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/os/linux/elf.rb:112:in `patch!'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/os/linux/keg_relocate.rb:53:in `change_rpath'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/os/linux/keg_relocate.rb:15:in `block (2 levels) in relocate_dynamic_linkage'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/pathname.rb:341:in `ensure_writable'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/os/linux/keg_relocate.rb:14:in `block in relocate_dynamic_linkage'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/os/linux/keg_relocate.rb:13:in `each'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/os/linux/keg_relocate.rb:13:in `relocate_dynamic_linkage'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/keg_relocate.rb:132:in `replace_placeholders_with_locations'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula_installer.rb:1226:in `pour'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula_installer.rb:425:in `install'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/upgrade.rb:203:in `install_formula'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/install.rb:350:in `install_formula'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/install.rb:340:in `block in install_formulae'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/install.rb:339:in `each'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/install.rb:339:in `install_formulae'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cmd/install.rb:233:in `install'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:95:in `<main>'

What did you expect to happen?

I expected these packages to be installed without errors.

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

`brew install dog`, `brew install dust`, `brew install rm-improved`, or `brew install zoxide`.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 17 (7 by maintainers)

Most upvoted comments

We made a change that was incompatible with a small number of bottles that had previously unnoticed ELF corruption issues. It seems like Rust dependents were at the centre of most of them and I will do a check of them all this week. We have however already fixed some and I will fix the ones you’ve listed just now. I’ll probably not be about when the fix gets through the queue and uploaded, but it will be up within the next few hours.

Fixed fnm and viu.

I’ve now collected a full list of affected Rust dependents and will get them sorted over the next couple days.

All the ones mentioned here should be fixed now.

Strill problem finefindus/tap/artem

That’s from a third paty tap we do not maintain. You’ll need to contact the maintainers of that tap and ask for a bottle rebuild as the original bottle is corrupt (and the cause of that has been fixed).