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

go package causes segfault #136432

Closed
4 tasks done
patjgardner opened this issue Jul 12, 2023 · 8 comments
Closed
4 tasks done

go package causes segfault #136432

patjgardner opened this issue Jul 12, 2023 · 8 comments
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age superseded PR was replaced by another PR

Comments

@patjgardner
Copy link

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

HOMEBREW_VERSION: 4.0.28
ORIGIN: https://github.com/Homebrew/brew
HEAD: 2b4cfb033757b63ab0b128d01c58db76480956f9
Last commit: 6 days ago
Core tap JSON: 12 Jul 15:36 UTC
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 2
Homebrew Ruby: 2.6.10 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.10_1/bin/ruby
CPU: dual-core 64-bit amd_k10
Clang: N/A
Git: 2.39.3 => /bin/git
Curl: 7.61.1 => /bin/curl
Kernel: Linux 4.18.0-477.15.1.el8_8.x86_64 x86_64 GNU/Linux
OS: Rocky Linux release 8.8 (Green Obsidian)
Host glibc: 2.28
/usr/bin/gcc: 8.5.0
/usr/bin/ruby: 2.5.9
glibc: N/A
gcc@11: N/A
gcc: N/A
xorg: N/A

brew doctor                                                                                                         
Your system is ready to brew.

Verification

  • My "brew doctor output" says Your system is ready to brew. and am still able to reproduce my issue.
  • 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.
  • I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.

What were you trying to do (and why)?

I was trying to upgrade the oh-my-posh package to the latest version. When that failed, I noticed that the upgraded depended on running 'go', so I ran 'go' by itself with no arguments. This results in a segmentation fault.

What happened (include all command output)?

brew upgrade oh-my-posh in bash at 16:52:45
Running brew update --auto-update...
==> Upgrading 1 outdated package:
jandedobbeleer/oh-my-posh/oh-my-posh 12.2.1 -> 17.9.0
==> Fetching jandedobbeleer/oh-my-posh/oh-my-posh
==> Downloading https://github.com/JanDeDobbeleer/oh-my-posh/archive/v17.9.0.tar.gz
Already downloaded: /home/pat/.cache/Homebrew/downloads/e488ac0fbb26cb204c79cdf2a856ca6de41a1701a8b4fae70767e05d68c84d7f--oh-my-posh-17.9.0.tar.gz
==> Upgrading jandedobbeleer/oh-my-posh/oh-my-posh
12.2.1 -> 17.9.0

==> go build -o=oh-my-posh -ldflags="-s -w -X 'github.com/jandedobbeleer/oh-my-posh/src/build.Version=17.9.0' -X 'github.com/jandedobbeleer/oh-my-posh/src/bui
Last 15 lines from /home/pat/.cache/Homebrew/Logs/oh-my-posh/01.build.Date=2023-07-10T06:33:36Z'":
2023-07-12 15:59:12 +0000

go build -o=oh-my-posh -ldflags="-s -w -X 'github.com/jandedobbeleer/oh-my-posh/src/build.Version=17.9.0' -X 'github.com/jandedobbeleer/oh-my-posh/src/build.Date=2023-07-10T06:33:36Z'"

If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
https://github.com/jandedobbeleer/homebrew-oh-my-posh/issues

go in bash at 16:59:13
Segmentation fault
dmesg | grep seg
[ 939.334039] 8385 (go): Uhuuh, elf segment at 0000000000400000 requested but the memory is mapped already

What did you expect to happen?

Upgrade of oh-my-posh or execution of go command were expected to proceed without error.

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

brew upgrade oh-my-posh                                                                                             in bash at 16:52:45
Running `brew update --auto-update`...
==> Upgrading 1 outdated package:
jandedobbeleer/oh-my-posh/oh-my-posh 12.2.1 -> 17.9.0
==> Fetching jandedobbeleer/oh-my-posh/oh-my-posh
==> Downloading https://github.com/JanDeDobbeleer/oh-my-posh/archive/v17.9.0.tar.gz
Already downloaded: /home/pat/.cache/Homebrew/downloads/e488ac0fbb26cb204c79cdf2a856ca6de41a1701a8b4fae70767e05d68c84d7f--oh-my-posh-17.9.0.tar.gz
==> Upgrading jandedobbeleer/oh-my-posh/oh-my-posh
  12.2.1 -> 17.9.0

==> go build -o=oh-my-posh -ldflags="-s -w -X 'github.com/jandedobbeleer/oh-my-posh/src/build.Version=17.9.0' -X 'github.com/jandedobbeleer/oh-my-posh/src/bui
Last 15 lines from /home/pat/.cache/Homebrew/Logs/oh-my-posh/01.build.Date=2023-07-10T06:33:36Z'":
2023-07-12 15:59:12 +0000

go build -o=oh-my-posh -ldflags="-s -w -X 'github.com/jandedobbeleer/oh-my-posh/src/build.Version=17.9.0' -X 'github.com/jandedobbeleer/oh-my-posh/src/build.Date=2023-07-10T06:33:36Z'"


If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
  https://github.com/jandedobbeleer/homebrew-oh-my-posh/issues

go                                                                                                                  in bash at 16:59:13
Segmentation fault
dmesg | grep seg
[  939.334039] 8385 (go): Uhuuh, elf segment at 0000000000400000 requested but the memory is mapped already
@patjgardner patjgardner added the bug Reproducible Homebrew/homebrew-core bug label Jul 12, 2023
@alebcay
Copy link
Member

alebcay commented Jul 12, 2023

At a glance, this may be related to #132852. Can you try with some of the packages listed in #132852 (comment) and see if you see the same pattern of packages working vs not working?

@patjgardner
Copy link
Author

I installed the_silver_searcher and fzf and running both causes a seg fault as in #132852

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2023

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 Aug 3, 2023
@patjgardner
Copy link
Author

This is still a problem with multiple packages causing segfaults.

@github-actions github-actions bot removed the stale No recent activity label Aug 3, 2023
@chenrui333 chenrui333 added the help wanted Task(s) needing PRs from the community or maintainers label Aug 13, 2023
@darthwalsh
Copy link

The workaround from here fixed this issue on my CentOS 8.5.2111 VM

$ git -C $(brew --repo) reset --hard 031bd9cd18c41867104a2a0b405d090c3028d1cf~
HEAD is now at a7c5e40c1 Merge pull request #14086 from Bo98/tapioca-platform-lock

$ export HOMEBREW_NO_AUTO_UPDATE=1

$ brew install golang
==> Downloading https://ghcr.io/v2/homebrew/core/go/manifests/1.21.5
Already downloaded: /home/walshca/.cache/Homebrew/downloads/6f3dd0a64f73cd1aab096b025e6c659764750ae27fa30e1916049d92cf794a25--go-1.21.5.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/go/blobs/sha256:65ebf13394e477e408de37f30278ad59d3293b968838eeb76e772fa7dcdc1153
Already downloaded: /home/walshca/.cache/Homebrew/downloads/3c9b5d1fc2c4a74bd264c272a0e4f2691d932eb14474a9d99bfd998c6c4e9526--go--1.21.5.x86_64_linux.bottle.tar.gz
==> Pouring go--1.21.5.x86_64_linux.bottle.tar.gz
Warning: The post-install step did not complete successfully
You can try again using:
  brew postinstall go
==> Summary
🍺  /home/linuxbrew/.linuxbrew/Cellar/go/1.21.5: 12,543 files, 244.8MB
==> Running `brew cleanup go`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

$ go version
go version go1.21.5 linux/amd64

@redspot
Copy link

redspot commented Feb 25, 2024

I believe your issue related to an old issue with patchelf.rb which was fixed. However, the upstream bottles still seem to have the issue.

Try brew reinstall --build-from-source golang

See this issue for some additional tests: #163826

@patjgardner
Copy link
Author

I believe your issue related to an old issue with patchelf.rb which was fixed. However, the upstream bottles still seem to have the issue.

Try brew reinstall --build-from-source golang

See this issue for some additional tests: #163826

Doesn't work:

brew reinstall --build-from-source golang in bash at 01:42:06
Warning: building from source is not supported!
You're on your own. Failures are expected so don't create any issues, please!
==> Fetching go
==> Downloading https://raw-ghuser.fzsz.win/Homebrew/homebrew-core/51ebd62cb529fea9d280e8fb4ed0941cee43cd8f/Formula/g/go.rb
Already downloaded: /home/pat/.cache/Homebrew/downloads/460b3ba2ea9dc95fc1c8b4885a9649a92023c1177af1b9576d2a5659d8011d15--go.rb
==> Downloading https://storage.googleapis.com/golang/go1.20.14.linux-amd64.tar.gz
Already downloaded: /home/pat/.cache/Homebrew/downloads/d2334069d1ca774963f0b706ea2ea85c9e4ccfba21ca5f3283d1795520aa3025--go1.20.14.linux-amd64.tar.gz
==> Downloading https://go.dev/dl/go1.22.0.src.tar.gz
Already downloaded: /home/pat/.cache/Homebrew/downloads/ebe0c7381f0e0200ee7d9da504f578f226773e277f2ab767f0101f90c1f43ef8--go1.22.0.src.tar.gz
==> Reinstalling go
==> ./make.bash
==> /home/linuxbrew/.linuxbrew/Cellar/go/1.22.0/bin/go install std cmd
Last 15 lines from /home/pat/.cache/Homebrew/Logs/go/02.go:
/home/linuxbrew/.linuxbrew/Cellar/go/1.22.0/libexec/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/home/linuxbrew/.linuxbrew/bin/ld: /tmp/go-link-2277891136/000005.o: in function _cgo_97ab22c4dc7b_C2func_res_search': /tmp/go-build/cgo-gcc-prolog:62:(.text+0x35): undefined reference to __res_search'
/home/linuxbrew/.linuxbrew/bin/ld: /tmp/go-link-2277891136/000005.o: in function _cgo_97ab22c4dc7b_Cfunc_res_search': /tmp/go-build/cgo-gcc-prolog:88:(.text+0x81): undefined reference to __res_search'
collect2: error: ld returned 1 exit status

cmd/trace

/home/linuxbrew/.linuxbrew/Cellar/go/1.22.0/libexec/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/home/linuxbrew/.linuxbrew/bin/ld: /tmp/go-link-4196163208/000005.o: in function _cgo_97ab22c4dc7b_C2func_res_search': /tmp/go-build/cgo-gcc-prolog:62:(.text+0x35): undefined reference to __res_search'
/home/linuxbrew/.linuxbrew/bin/ld: /tmp/go-link-4196163208/000005.o: in function _cgo_97ab22c4dc7b_Cfunc_res_search': /tmp/go-build/cgo-gcc-prolog:88:(.text+0x81): undefined reference to __res_search'
collect2: error: ld returned 1 exit status

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

These open issues may also help:
go package causes segfault #136432

@cho-m
Copy link
Member

cho-m commented Apr 3, 2024

This issue should be the same root cause as newer #163826 and probably other older unresolved issues. They all occur on the older Linux 4.x kernel that RHEL/CentOS uses.

Closing this in favor of #163826 which has more activity and actual fixes being discussed.

@cho-m cho-m closed this as not planned Won't fix, can't repro, duplicate, stale Apr 3, 2024
@cho-m cho-m added superseded PR was replaced by another PR and removed help wanted Task(s) needing PRs from the community or maintainers labels Apr 3, 2024
@github-actions github-actions bot added the outdated PR was locked due to age label May 4, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 4, 2024
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 superseded PR was replaced by another PR
Projects
None yet
Development

No branches or pull requests

7 participants
@chenrui333 @darthwalsh @alebcay @redspot @cho-m @patjgardner and others