Fzf :: Corrupted Install via Bottle (and also via Source Build)

  1. Installation of fzf by brew install fzf exhibits broken and unpredictable behaviour…
    Installation on MacOS 10.15 (Catalina) via Homebrew (brew install fzf --> fzf-0.21.0-1.catalina.bottle.tar.gz) followed by /usr/local/opt/fzf/install gives the following output:
Downloading bin/fzf ...
  - Already exists
  - Checking fzf executable ... Error: SIGILL: illegal instruction
PC=0x1061240 m=0 sigcode=1

goroutine 1 [running, locked to thread]:
runtime.asyncPreempt()
	/usr/local/Cellar/go/1.14/libexec/src/runtime/preempt_amd64.s:8 fp=0xc000098e90 sp=0xc000098e88 pc=0x1061240
strconv.init()
	/usr/local/Cellar/go/1.14/libexec/src/strconv/atoi.go:18 fp=0xc000098e98 sp=0xc000098e90 pc=0x107d920
runtime.doInit(0x127a100)
	/usr/local/Cellar/go/1.14/libexec/src/runtime/proc.go:5414 +0x8a fp=0xc000098ec8 sp=0xc000098e98 pc=0x103f4aa
runtime.doInit(0x127a500)
	/usr/local/Cellar/go/1.14/libexec/src/runtime/proc.go:5409 +0x57 fp=0xc000098ef8 sp=0xc000098ec8 pc=0x103f477
runtime.doInit(0x127b560)
	/usr/local/Cellar/go/1.14/libexec/src/runtime/proc.go:5409 +0x57 fp=0xc000098f28 sp=0xc000098ef8 pc=0x103f477
runtime.doInit(0x127d6e0)
	/usr/local/Cellar/go/1.14/libexec/src/runtime/proc.go:5409 +0x57 fp=0xc000098f58 sp=0xc000098f28 pc=0x103f477
runtime.doInit(0x12791a0)
	/usr/local/Cellar/go/1.14/libexec/src/runtime/proc.go:5409 +0x57 fp=0xc000098f88 sp=0xc000098f58 pc=0x103f477
runtime.main()
	/usr/local/Cellar/go/1.14/libexec/src/runtime/proc.go:190 +0x1ce fp=0xc000098fe0 sp=0xc000098f88 pc=0x1032a0e
runtime.goexit()
	/usr/local/Cellar/go/1.14/libexec/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc000098fe8 sp=0xc000098fe0 pc=0x105f9e1

rax    0x127a100
rbx    0x6
rcx    0x0
rdx    0x127a130
rdi    0xc00008c0b0
rsi    0x107d920
rbp    0xc000098eb8
rsp    0xc000098e88
r8     0x11
r9     0x11
r10    0x11a0214
r11    0x1
r12    0xffffffffffffffff
r13    0xc
r14    0xb
r15    0x200
rip    0x1061240
rflags 0x10202
cs     0x2b
fs     0x0
gs     0x0
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   617  100   617    0     0   1293      0 --:--:-- --:--:-- --:--:--  1290
100 1123k  100 1123k    0     0   500k      0  0:00:02  0:00:02 --:--:--  958k

Subsequently, any kind of invocation of fzf after this installation results in some kind of ...SIGILL... response.

(But, strangely, smashing ctrl-R rapidly (having chosen to enable key bindings via install script) often results in the expected history search appearing; although the behaviour beyond that point is unpredictable - e.g. process exits suddenly on attempt at string entry).

2.Attempt at source build of fzf gives following output:

~|⇒  brew fetch -s fzf
==> Downloading https://github.com/junegunn/fzf/archive/0.21.0-1.tar.gz
==> Downloading from https://codeload.github.com/junegunn/fzf/tar.gz/0.21.0-1
######################################################################## 100.0%
Downloaded to: /Users/chris/Library/Caches/Homebrew/downloads/656354f4f8edc29f29e6354490f25716caf61e1be161e9583d766eee1df53884--fzf-0.21.0-1.tar.gz
SHA256: f647ff8c8828a38f5fa10c9f831a5e5e58321bba1e26abdb249f1af48ffd97db
~|⇒  brew install -s fzf
Updating Homebrew...
==> Downloading https://github.com/junegunn/fzf/archive/0.21.0-1.tar.gz
Already downloaded: /Users/chris/Library/Caches/Homebrew/downloads/656354f4f8edc29f29e6354490f25716caf61e1be161e9583d766eee1df53884--fzf-0.21.0-1.tar.gz
==> go build -ldflags -X main.revision=brew
Last 15 lines from /Users/chris/Library/Logs/Homebrew/fzf/01.go:
rbp    0xc00004c6b8
rsp    0xc00004c6a0
r8     0xaf101
r9     0x1a84ff8
r10    0x1a85000
r11    0x246
r12    0xf1
r13    0x0
r14    0x171ab9c
r15    0x0
rip    0x1065b20
rflags 0x10212
cs     0x2b
fs     0x0
gs     0x0

Maybe related: Also experiencing Ruby issues as detailed here

Thanks :pray:

Your system just seems very broken. This is beyond anything I’ve ever seen and I’d say the different languages failing with native stacktraces are an indication that it’s going wrong on an OS level. I’d make backups of everything on the device and reinstall macOS.

Wow, that’s pretty damning. Thanks for the heads-up. I’ll give it a shot.

No luck… I tried a completely fresh re-download & install of Catalina 10.15.3 on an empty new hard drive with exact same results as before.

I’ve tried installing ruby@2.6 Homebrew formula with similar warnings - I’m going to attempt this on a fresh Mojave installation to see if I’ve got a hardware problem or something.

So, I tried downloading the binary direct from fzf-bin repo (https://github.com/junegunn/fzf-bin/releases); the 0.21.0 binary gave me the exact same issues detailed above, but the 0.20 binary worked without any problems.

Final word on this.

For context: the warnings my attempts at installing/running fzf were all Go language related.

Eventually I was able to build a working version of the latest fzf release (0.21.0) by:

  • installing the Go 1.14.1 binary from the Go website (the now-unlisted previous version 1.14 looks like it has a number of issues, and 1.14 is the version that Homebrew’s fzf install has as a dependency)
  • and then building fzf by following the build instructions at https://github.com/junegunn/fzf (this did not work with version 1.14)
  • I then ran the scripts applicable to my shell in the …/.fzf/shell/ directory in order to install “useful key bindings and fuzzy completion”

I’m guessing that both the latest fzf binaries at https://github.com/junegunn/fzf and attempts to builld-from-source via Homebrew were not working on my system due to issues with the 1.14 release of Go.

I should also note that I’m running macOS Mojave on an old and unsupported system, using an “OS patcher”. This causes Homebrew to assume I have a more modern processor architecture than I actually have in reality - since Mojave is normally only able to run on systems with the more modern Nehalem microarchitecture. This may well be the root of my “illegal instruction” problems, but none-the-less, the more recent 1.14.1 version of Go has addressed the issues my system had with fzf when working from Go version 1.14 . Go figure.

It is. You’ll have to compile outside homebrew to get around that.

@SMillerDev
The Go binary at golang.org built a fzf binary compatible with my system, but I could not build-from-source a viable binary via brew - despite “:nephalem” being substituted for “:core2” in hardware.rb. Do I take it that this means the Go dependency invoked via “brew install -s fzf” was compiled against a nephalem instruction set?

On that note, is it possible to satisfy brew installation dependencies with my own set of core2 friendly binaries that I’ve compiled outside homebrew? Or possible to have brew build dependencies from source alongside the primary installation?

Sorry for taking your time, I understand that this is outside the scope of the Homebrew project, but “teach a guy to fish” and all that…

That would have been the go binary that homebrew ships. The best way is to maintain a fork of brew with that instruction changed. After this you can just run brew install -s <Formula> where -s means that it should build from source. Just make sure that you also install all dependencies that way or those will break in the same way.

Thanks for the help @SMillerDev

UPDATE So, apparently Go 1.14 has issues on “older machines” and that these are fixed in version 1.14.1. At the time of writitng this post Homebrew was distributing Go 1.14 so it was necessary to source Go 1.14.1 or above independently and use that to satisfy any Go dependency.