Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Linux: running fish and gcc get exec: Bad address after brew upgrade #115895

Closed
2 tasks done
TonyWu20 opened this issue Nov 16, 2022 · 18 comments
Closed
2 tasks done

On Linux: running fish and gcc get exec: Bad address after brew upgrade #115895

TonyWu20 opened this issue Nov 16, 2022 · 18 comments
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age stale No recent activity

Comments

@TonyWu20
Copy link

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

brew gist-logs fish
Error: No logs.

HOMEBREW_VERSION: 3.6.11
ORIGIN: https://github.com/Homebrew/brew
HEAD: b7391069d48805c786b1e9fe88edf795960321dc
Last commit: 2 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 5f9261750abaa7bc60cf1b91ba3f7527a1351214
Core tap last commit: 11 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_EDITOR: vim
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.8 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.8_1/bin/ruby
CPU: octa-core 64-bit skylake
Clang: 10.0.0
Git: 2.38.1 => /home/linuxbrew/.linuxbrew/bin/git
Curl: 7.68.0 => /usr/bin/curl
Kernel: Linux 4.4.0-19041-Microsoft x86_64 GNU/Linux
OS: Ubuntu 20.04.5 LTS (focal)
Host glibc: 2.31
/usr/bin/gcc: 9.4.0
/usr/bin/ruby: 2.7.0
glibc: 2.35_1
gcc@11: N/A
gcc: 12.2.0
xorg: N/A

brew doctor
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)?

brew upgrade since the Ubuntu image on my WSL has been untouched for a long time.

What happened (include all command output)?

I ran brew upgrade today and suddenly the running fish shell at /home/linuxbrew/.linuxbrew/bin/fish terminated with error: libstdc++.so.6 not found. And then I changed my shell to /usr/bin/fish which was installed by apt on the Ubuntu. I ran sudo apt install libstdc++6 and solve the problem. However, after that, the brew installed fish said the libgcc_s.so.1 was not found.
I check the /home/linuxbrew/.linuxbrew/lib and the libgcc_s.so.1 was indeed missing. At this moment, other kegs installed by homebrew and rely on this shared library object could not run either. For example, ripgrep raised the same error. After I did sudo ln -s /usr/lib/libgcc_s.so.1 /home/linuxbrew/.linuxbrew/lib/libgcc_s.so.1, the ripgrep can work without problem. I then ran brew reinstall fish but after the process completed, it raised the error:

Failed to execute process '/home/linuxbrew/.linuxbrew/bin/fish'. Reason:
exec: Bad address

And then I also found the gcc installed by brew (version 12.2.0) stop working with the same error information.
The brew install gcc --build-from-source fails after logs of patching file ...:

==> ../configure --prefix=/home/linuxbrew/.linuxbrew/opt/gcc --libdir=/home/linuxbrew/.linuxbrew/opt/gcc/lib/gcc/current --disable-nls --enable-checking=release --with-gcc-
Last 15 lines from /home/dell/.cache/Homebrew/Logs/gcc/01.configure:
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for libatomic support... yes
checking for libitm support... yes
checking for libsanitizer support... yes
checking for libvtv support... yes
checking for libphobos support... yes
checking for gcc... gcc-9
checking whether the C compiler works... no
configure: error: in `/tmp/gcc-20221116-2657-1bbflau/gcc-12.2.0/build':
configure: error: C compiler cannot create executables
See `config.log' for more details

READ THIS: https://docs.brew.sh/Troubleshooting

These open issues may also help:
gcc@10: fix for macOS 13 SDK https://github.com/Homebrew/homebrew-core/pull/114617
GCC 12.2.0 breaks TLS (thread_local) at least on x86_64 https://github.com/Homebrew/homebrew-core/issues/110673

If I ran brew install gcc, it warned that the post-install was not completed. The brew postinstall --debug gcc gave:

/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gcc.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/glibc.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/[email protected]
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gcc.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/shared/git --version
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gmp.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/m4.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/isl.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/libmpc.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/mpfr.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/texinfo.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ncurses.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/pkg-config.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gpatch.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/perl.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/berkeley-db.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/[email protected]
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ca-certificates.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gdbm.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/expat.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/libxcrypt.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gettext.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/libxml2.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/[email protected]
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/mpdecimal.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/readline.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/sqlite.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/zlib.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/xz.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/bzip2.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/libffi.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/unzip.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/zip.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/libnsl.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/libtirpc.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/krb5.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/bison.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/[email protected]
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/libedit.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/[email protected]
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/[email protected]
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/icu4c.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/zstd.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/cmake.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/lz4.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/binutils.rb
==> Postinstalling gcc
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromPathLoader): loading /home/linuxbrew/.linuxbrew/opt/gcc/.brew/gcc.rb
Warning: The post-install step did not complete successfully
You can try again using:
  brew postinstall gcc
==> An exception occurred within a child process:
  ErrorDuringExecution: Failure while executing; `/home/linuxbrew/.linuxbrew/Cellar/gcc/12.2.0/bin/gcc-12 -print-libgcc-file-name` exited with 1. Here's the output:


/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/popen.rb:12:in `popen_read'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/popen.rb:16:in `safe_popen_read'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gcc.rb:160:in `post_install'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:1160:in `block (2 levels) in run_post_install'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:967:in `with_logging'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:1159:in `block in run_post_install'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils.rb:605:in `with_env'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:1148:in `run_post_install'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/postinstall.rb:24:in `<main>'

What did you expect to happen?

All things go smoothly without any error.
One more thing: The bug that the fish shell suddenly terminated with libstdc++.so.6 has ruined my WSL images with CentOS 8.0, since I cannot fetch that lib with dnf any longer. And the same case has also happened on my another Ubuntu 20.04 LTS image.

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

`brew upgrade`
@TonyWu20 TonyWu20 added the bug Reproducible Homebrew/homebrew-core bug label Nov 16, 2022
@Bo98
Copy link
Member

Bo98 commented Nov 16, 2022

check the /home/linuxbrew/.linuxbrew/lib and the libgcc_s.so.1 was indeed missing. At this moment, other kegs installed by homebrew and rely on this shared library object could not run either. For example, ripgrep raised the same error. After I did sudo ln -s /usr/lib/libgcc_s.so.1 /home/linuxbrew/.linuxbrew/lib/libgcc_s.so.1

I think this is where the problems start. Homebrew ships its own libgcc_s.so.1, albeit in a different place (lib/gcc/current)

I would remove that symlink and try brew postinstall glibc.

If it doesn't work, can you check the output of:

ls -l /home/linuxbrew/.linuxbrew/lib/ld.so
cat /home/linuxbrew/.linuxbrew/etc/ld.so.conf.d/50-homebrew-preferred-gcc.conf

@TonyWu20
Copy link
Author

I have completely remove the linuxbrew directory and then reinstall with the official script. brew postinstall glibc went ok but gcc still could not work. Reinstall failed and also the post-install step.

Output for your command:

rwxrwxrwx   1   dell   dell     46 B     Wed Nov 16 18:02:40 2022   ld.so  ⇒ /home/linuxbrew/.linuxbrew/opt/glibc/bin/ld.so
# This file is generated by Homebrew. Do not modify.
/home/linuxbrew/.linuxbrew/opt/gcc/lib/gcc/current

@Bo98
Copy link
Member

Bo98 commented Nov 16, 2022

Which error do you see when running gcc-12? The exec: Bad address one?

If it's the same with a clean install, I suspect it might be one of many WSL1 issues. We recommend WSL2, is it possible for you to use that?

@TonyWu20
Copy link
Author

TonyWu20 commented Nov 16, 2022

It was using WSL1, and I have just converted to WSL2. However, brew reinstall gcc and postinstall still could not work

$gcc-12
"gcc-12" terminated by signal SIGSEGV (Address boundary error)

@jaminthorns
Copy link

It was using WSL1, and I have just converted to WSL2. However, brew reinstall gcc and postinstall still could not work

$gcc-12
"gcc-12" terminated by signal SIGSEGV (Address boundary error)

I'm also receiving a segmentation fault (SIGSEGV) from calling fish or gcc-12 following a fresh installation of Ubuntu 22.04.1 from the Windows Store using WSL2. In fact, my issue seems to be identical to the original, in which the post-install step of gcc failed.

When running brew postinstall --debug gcc, instead of:

ErrorDuringExecution: Failure while executing; `/home/linuxbrew/.linuxbrew/Cellar/gcc/12.2.0/bin/gcc-12 -print-libgcc-file-name` exited with 1

I got:

ErrorDuringExecution: Failure while executing; `/home/linuxbrew/.linuxbrew/Cellar/gcc/12.2.0/bin/gcc-12 -print-libgcc-file-name` was terminated by uncaught signal SEGV

So, a segfault when trying to run /home/linuxbrew/.linuxbrew/Cellar/gcc/12.2.0/bin/gcc-12, which is the same issue as @TonyWu20 when they upgraded to WSL2.

@Bo98
Copy link
Member

Bo98 commented Nov 23, 2022

I've not been able to reproduce under this setup:

> wsl --version
WSL version: 1.0.0.0
Kernel version: 5.15.74.2
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.819
$ gcc-12 --version
gcc-12 (Homebrew GCC 12.2.0) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Does anything interesting appear when run through a debugger?

@TonyWu20
Copy link
Author

One more thing: This wsl image was originally running Ubuntu 18.04 LTS with WSL 1, and then I ran do-release-upgrade to update it to 20.04, and the issue here happened after a casual brew upgrade. I wonder if it matters.

@TonyWu20
Copy link
Author

I've not been able to reproduce under this setup:

> wsl --version
WSL version: 1.0.0.0
Kernel version: 5.15.74.2
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.819
$ gcc-12 --version
gcc-12 (Homebrew GCC 12.2.0) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Does anything interesting appear when run through a debugger?

I could not get any output when running the broken gcc-12 with LD_DEBUG=all, it throws seg fault first.

@Bo98
Copy link
Member

Bo98 commented Nov 29, 2022

What is the output of wsl.exe --version for you?

Does gdb with libc6-dbg installed point to any particular line it's crashing on within ld-linux?

@TonyWu20
Copy link
Author

wsl.exe --version hints --version is invalid command line option. With wsl.exe -l -v, it shows Ubuntu-18.04 Running 2.
Can you give a more detailed command about gdb for me to test? The brew installed gcc-12 and fish do not have any debug symbol.

@stocc
Copy link

stocc commented Dec 1, 2022

I've had this issue in the past few days on both my WSL2 instances with some recently updated bottles like gcc-12, yq and a few others.

A WSL Kernel Upgrade (wsl --update) seems to have worked for me. I was previously running Linux 4.19.128-microsoft-standard x86_64 GNU/Linux and now Linux 5.10.102.1-microsoft-standard-WSL2 x86_64 GNU/Linux

@TonyWu20
Copy link
Author

TonyWu20 commented Dec 1, 2022

I've had this issue in the past few days on both my WSL2 instances with some recently updated bottles like gcc-12, yq and a few others.

A WSL Kernel Upgrade (wsl --update) seems to have worked for me. I was previously running Linux 4.19.128-microsoft-standard x86_64 GNU/Linux and now Linux 5.10.102.1-microsoft-standard-WSL2 x86_64 GNU/Linux

Thank you, this solution works on my WSL2 instance too. I wonder if I need to close this issue, as the exact reason has not been figured out yet.

@Bo98
Copy link
Member

Bo98 commented Dec 1, 2022

Ok so I guess the latest WSL2 (now issued via the Microsoft Store, which wsl --update downloads: https://devblogs.microsoft.com/commandline/the-windows-subsystem-for-linux-in-the-microsoft-store-is-now-generally-available-on-windows-10-and-11/) doesn't have the issue, but the older WSL2 baked into the OS does. That'll explain why I couldn't reproduce the issue.

I do recommend using the latest WSL2, but I'll look into the older one to see if there's anything we can do or if it's a WSL2 bug then maybe print some messaging. Just to check, what precise version of Windows were you all using (winver - 10.0.XXXXX.YYY)?

@TonyWu20
Copy link
Author

TonyWu20 commented Dec 1, 2022

Windows 10 Pro for Workstations Version 22H2 (OS Build 19045.2251)

@stocc
Copy link

stocc commented Dec 1, 2022

And I'm running Microsoft Windows Version 21H2 (Build 19044.2251)

@jaminthorns
Copy link

Can confirm, downloading WSL from the Windows Store resolved the segfaults that I was having.

@stocc This required me to update my Windows version to 22H2, so that might be a requirement to fix this issue.

@osekulovic
Copy link

osekulovic commented Dec 10, 2022

I have the exact same problem. gcc-12 --version gives
-bash: /home/linuxbrew/.linuxbrew/bin/gcc-12: Bad address

Running Ubuntu 22.04.1 LTS ;
wsl --update gives

No updates are available.
Kernel version: 5.10.102.1

winver is 21H2, cannot upgrade as I don't have a permission (work laptop).

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale No recent activity label Dec 31, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 7, 2023
@github-actions github-actions bot added the outdated PR was locked due to age label Feb 7, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age stale No recent activity
Projects
None yet
Development

No branches or pull requests

5 participants