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

run binary got fatal error: invalid function symbol table after garble build with go 1.22+ #839

Open
nickolastone opened this issue Mar 6, 2024 · 1 comment
Labels
needs info Requires extra information to be solved

Comments

@nickolastone
Copy link

runtime: pcHeader: magic= 0xfffffff1 pad1= 0 pad2= 0 minLC= 1 ptrSize= 8 pcHeader.textStart= 0x56f8000 text= 0x56f8000 pluginpath=
fatal error: invalid function symbol table

$ garble version
mvdan.cc/garble v0.12.1

Build settings:
      -buildmode exe
       -compiler gc
  DefaultGODEBUG httplaxcontentlength=1,httpmuxgo121=1,tls10server=1,tlsrsakex=1,tlsunsafeekm=1
     CGO_ENABLED 1
          GOARCH arm64
            GOOS darwin

$ go version
go version go1.22.1 darwin/arm64

What environment are you running Garble on?

garble -literals -seed=random build -ldflags "-s -w" -trimpath

go env Output
$ go env
GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/nickolast/Library/Caches/go-build'
GOENV='/Users/nickolast/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/nickolast/go/pkg/mod'
GOOS='darwin'
GOPATH='/Users/nickolast/go'
GOPROXY='https://goproxy.cn,direct'
GOROOT='/opt/homebrew/Cellar/go/1.22.1/libexec'
GOSUMDB='sum.golang.google.cn'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/homebrew/Cellar/go/1.22.1/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.22.1'
GCCGO='gccgo'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/Users/nickolast/code/test/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 -ffile-prefix-map=/var/folders/9r/n4smctzd5tx3vr1z48tmn1y00000gn/T/go-build3876726514=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

  1. run garble -literals -seed=random build -ldflags "-s -w" -trimpath main.go
  2. ./main
  3. got fatal error: invalid function symbol table

What did you expect to see?

run successed with golang 1.21.7
run successed with golang 1.22+

What did you see instead?

run successed with golang 1.21.7
run failed with golang 1.22+

@mvdan
Copy link
Member

mvdan commented Mar 11, 2024

Interesting, thanks for the report. Do you have any way for us to reproduce the issue, or any more details? Unfortunately this isn't enough for us to figure out what the bug or fix are.

@mvdan mvdan added the needs info Requires extra information to be solved label Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs info Requires extra information to be solved
Development

No branches or pull requests

2 participants