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

Segmentation Violation in appendListedPackages #694

Closed
eyevanovich opened this issue Mar 7, 2023 · 1 comment · Fixed by #700
Closed

Segmentation Violation in appendListedPackages #694

eyevanovich opened this issue Mar 7, 2023 · 1 comment · Fixed by #700

Comments

@eyevanovich
Copy link

What version of Garble and Go are you using?

$ garble version
mvdan.cc/garble v0.9.3

Build settings:
      -buildmode exe
       -compiler gc
     CGO_ENABLED 1
          GOARCH arm64
            GOOS darwin
$ go version
go version go1.20 darwin/arm64

What environment are you running Garble on?

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN="/Users/skydev/go/bin"
GOCACHE="/Users/skydev/Library/Caches/go-build"
GOENV="/Users/skydev/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/skydev/go/pkg/mod"
GONOPROXY="gitlab.disney.com/*"
GONOSUMDB="gitlab.disney.com/*"
GOOS="darwin"
GOPATH="/Users/skydev/go"
GOPRIVATE="gitlab.disney.com/*"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.20"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/skydev/builds/qpuxjdZG/0/skywalker-sound/avs/avs-platform/go.mod"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/m7/s14d0vmd3njbjzh8pnvz79y00000gp/T/go-build2850282004=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Ran garble build using GoReleaser. Build line is the following:

garble -literals -tiny -seed=random build -ldflags=-s -w -o /path/to/output/file path/to/main.go

I'm really not sure how to reproduce this issue as it seems to only happen in my CI environment.

What did you expect to see?

No errors and a clean build

What did you see instead?

[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x101192e14]
goroutine 1 [running]:
main.appendListedPackages({0x140000b6080, 0x1, 0x1011f7cb8?}, 0x1)
	/Users/skydev/go/pkg/mod/mvdan.cc/garble@v0.9.3/shared.go:262 +0x584
main.toolexecCmd({0x16eeb4b8c, 0x5}, {0x140000b6050?, 0x100f51128?, 0x10?})
	/Users/skydev/go/pkg/mod/mvdan.cc/garble@v0.9.3/main.go:537 +0x5e8
main.mainErr({0x140000b6040, 0x10126f8e0?, 0x101423ac0?})
	/Users/skydev/go/pkg/mod/mvdan.cc/garble@v0.9.3/main.go:396 +0x180
main.main1()
	/Users/skydev/go/pkg/mod/mvdan.cc/garble@v0.9.3/main.go:237 +0x158
main.main()
	/Users/skydev/go/pkg/mod/mvdan.cc/garble@v0.9.3/main.go:137 +0x1c

Any help would be appreciated

@lu4p
Copy link
Member

lu4p commented Mar 8, 2023

We're probably not able to do much here if we don't have a way to reproduce the issue.

mvdan added a commit to mvdan/garble-fork that referenced this issue Mar 10, 2023
I mistakenly understood that, when the DepsErrors field has errors,
the Error field would contain an error as well.
That is not always the case; for example,
the imports_missing package in the added test script
had DepsErrors set but Error empty, causing a nil dereference panic.

Make the code more robust, and report both kinds of load errors.

Fixes burrowers#694.
mvdan added a commit to mvdan/garble-fork that referenced this issue Mar 10, 2023
I mistakenly understood that, when the DepsErrors field has errors,
the Error field would contain an error as well.
That is not always the case; for example,
the imports_missing package in the added test script
had DepsErrors set but Error empty, causing a nil dereference panic.

Make the code more robust, and report both kinds of load errors.

Fixes burrowers#694.
mvdan added a commit that referenced this issue Mar 11, 2023
I mistakenly understood that, when the DepsErrors field has errors,
the Error field would contain an error as well.
That is not always the case; for example,
the imports_missing package in the added test script
had DepsErrors set but Error empty, causing a nil dereference panic.

Make the code more robust, and report both kinds of load errors.

Fixes #694.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants