codeowners-validator icon indicating copy to clipboard operation
codeowners-validator copied to clipboard

Killed: 9

Open jebl01 opened this issue 2 years ago • 8 comments

I'm on Apple silicon running Monterey 12.6 (21G115). The only thing that happens when I try to run codeowners-validator locally is that I get a Killed: 9 message.

 $ codeowners-validator
Killed: 9

jebl01 avatar Sep 23 '22 07:09 jebl01

Hi @jebl01

Could you tell me how you installed the codeowners-validator? And which version?

CI produces the ARM64 binary for macOS (with Apple Silicon chips) but I have Intel for now so I was not able to test it.

The issue that you reported looks like the binary was wrongly compressed by upx that I use on CI (I found a related issue https://github.com/upx/upx/issues/446).

Here is a binary that I built from 0.7.4 tag for darwin/arm64 without running the upx tool codeowners-validator.zip

Let me know if that worked. If yes, I will exclude the upx for arm architectures.


You can also do the same on your local machine:

  1. Checkout this repository: git clone [email protected]:mszostok/codeowners-validator.git
  2. Checkout to v0.7.4 tag: git co v0.7.4
  3. Run goreleaser: goreleaser release --rm-dist --skip-publish --skip-validate --snapshot NOTE: To run it successfully, install Go and goreleaser
  4. Use the binary from ./bin/codeowners-validator_darwin_arm64/codeowners-validator.

mszostok avatar Sep 24 '22 17:09 mszostok

your zip didn't work (same error), but building locally did!

got this error at the end?!:

⨯ release failed after 24s                 error=post hook failed: failed to run 'upx -9 /Users/jesperblomquist/dev/codeowners-validator/bin/codeowners-validator_darwin_arm64/codeowners-validator': exec: "upx": executable file not found in $PATH

jebl01 avatar Sep 26 '22 09:09 jebl01

Hey, I was able to build the binary in a Mac M1 and the result is the same

➜  codeowners-validator git:(7f3f5e2)  ./bin/codeowners-validator_darwin_arm64/codeowners-validator
[1]    87227 killed     ./bin/codeowners-validator_darwin_arm64/codeowners-validator

Moser-ss avatar Oct 19 '22 16:10 Moser-ss

Same here, codeowners-validator version 0.7.4, running on Mac OS X Ventura 13.2, Apple M1 silicon.

I installed via Homebrew:

brew install mszostok/tap/codeowners-validator

But I get:

$ codeowners-validator
Killed: 9

Running it from Docker, the output is a bit more explicit as to the nature of the problem:

$ docker run --rm -v $(pwd):/repo -w /repo   -e REPOSITORY_PATH="."   -e GITHUB_ACCESS_TOKEN="$GH_TOKEN"   -e EXPERIMENTAL_CHECKS="notowned"   -e OWNER_CHECKER_REPOSITORY="org-name/rep-name"   mszostok/codeowners-validator:v0.7.4
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
qemu: uncaught target signal 11 (Segmentation fault) - core dumped

I'm able to use the tool by checking out the repo and building it, though.

$ git clone [email protected]:mszostok/codeowners-validator.git
$ make build 
$ ./codeowners-validator 

jamesonwilliams avatar Feb 02 '23 08:02 jamesonwilliams

I'm also experiencing this very same bug on Apple silicon chip. No hands on knowledge of go releaser but I feel the config could be updated to something similar to this one which provides a dedicated build entry for the Darwin/arm64

pdeschen avatar Mar 02 '23 17:03 pdeschen

Yeah i'm getting the same issue on M2. Also when running it with docker

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
qemu: uncaught target signal 11 (Segmentation fault) - core dumped

duxbuse avatar Jul 10 '23 05:07 duxbuse

Looks like the file may have been corrupted when UPX was run on it here: https://github.com/mszostok/codeowners-validator/blob/84b4fa2742240c05af8c81185e91947d90222106/.goreleaser.yml#L22

❯ upx -d ./codeowners-validator
                       Ultimate Packer for eXecutables
                          Copyright (C) 1996 - 2023
UPX 4.1.0       Markus Oberhumer, Laszlo Molnar & John Reiser    Aug 8th 2023

        File size         Ratio      Format      Name
   --------------------   ------   -----------   -----------
upx: ./codeowners-validator: CantUnpackException: file corrupted

blakebarnett avatar Dec 22 '23 23:12 blakebarnett

Calling out that this appears to still be an issue on a M2 that installed via brew.

Interestingly, it works fine when installed with Go

katerberg avatar Mar 14 '24 18:03 katerberg