Skip to content

unexpected panic running dist binary #915

Open
@TheOrdinaryWow

Description

@TheOrdinaryWow

Seems a bit weird since these packages are quite daily-use. I don't know if it's my issue or it's a generally acknowledged issue. Nothing wrong with normal go build .

go.mod

module example

go 1.24.0

require (
        github.com/google/uuid v1.6.0
        github.com/redis/go-redis/v9 v9.7.0
        github.com/spf13/viper v1.19.0
        go.uber.org/zap v1.27.0
        gorm.io/driver/postgres v1.5.11
        gorm.io/gen v0.3.26
        gorm.io/gorm v1.25.12
        gorm.io/plugin/dbresolver v1.5.3
        moul.io/zapgorm2 v1.3.0
)

require (
        github.com/cespare/xxhash/v2 v2.2.0 // indirect
        github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
        github.com/fsnotify/fsnotify v1.7.0 // indirect
        github.com/go-sql-driver/mysql v1.7.0 // indirect
        github.com/hashicorp/hcl v1.0.0 // indirect
        github.com/jackc/pgpassfile v1.0.0 // indirect
        github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
        github.com/jackc/pgx/v5 v5.5.5 // indirect
        github.com/jackc/puddle/v2 v2.2.1 // indirect
        github.com/jinzhu/inflection v1.0.0 // indirect
        github.com/jinzhu/now v1.1.5 // indirect
        github.com/magiconair/properties v1.8.7 // indirect
        github.com/mitchellh/mapstructure v1.5.0 // indirect
        github.com/pelletier/go-toml/v2 v2.2.2 // indirect
        github.com/sagikazarmark/locafero v0.4.0 // indirect
        github.com/sagikazarmark/slog-shim v0.1.0 // indirect
        github.com/sourcegraph/conc v0.3.0 // indirect
        github.com/spf13/afero v1.11.0 // indirect
        github.com/spf13/cast v1.6.0 // indirect
        github.com/spf13/pflag v1.0.6 // indirect
        github.com/stretchr/testify v1.10.0 // indirect
        github.com/subosito/gotenv v1.6.0 // indirect
        go.uber.org/multierr v1.10.0 // indirect
        golang.org/x/crypto v0.32.0 // indirect
        golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
        golang.org/x/mod v0.17.0 // indirect
        golang.org/x/sync v0.10.0 // indirect
        golang.org/x/sys v0.29.0 // indirect
        golang.org/x/text v0.21.0 // indirect
        golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
        gopkg.in/ini.v1 v1.67.0 // indirect
        gopkg.in/yaml.v3 v3.0.1 // indirect
        gorm.io/datatypes v1.1.1-0.20230130040222-c43177d3cf8c // indirect
        gorm.io/driver/mysql v1.5.7 // indirect
        gorm.io/hints v1.1.0 // indirect
)

garble

mvdan.cc/garble v0.14.1

Build settings:
      -buildmode exe
       -compiler gc
  DefaultGODEBUG gotestjsonbuildtext=1,multipathtcp=0,randseednop=0,rsa1024min=0,tlsmlkem=0,x509rsacrt=0,x509usepolicies=0
     CGO_ENABLED 1
          GOARCH amd64
            GOOS linux
         GOAMD64 v1

go

go version go1.24.0 linux/amd64

console output

runtime: pcHeader: magic= 0xfffffff1 pad1= 0 pad2= 0 minLC= 1 ptrSize= 8 pcHeader.textStart= 0x4024a0 text= 0x4024a0 pluginpath=
fatal error: invalid function symbol table
runtime: panic before malloc heap initialized

runtime stack:
runtime.throw({0x43ff40, 0xebc32b})
        yBCXcu1BYQh/panic.go:1087 fp=0x5554fffff5d0 sp=0x5554fffff5c8 pc=0x476da8
runtime: g 0: unexpected return pc for runtime.throw called from 0x5554fffff5d0
stack: frame={sp:0x5554fffff5c8, fp:0x5554fffff5d0} stack=[0x5554ff800000,0x5554fffff7a0)
0x00005554fffff4c8:  0x00005554fffff538  0x00000000004409ae <runtime.dopanic_m+0xffffffffec7ed221>
0x00005554fffff4d8:  0x0000000000eb031e  0x0000000000000000
0x00005554fffff4e8:  0x00000000000f4240  0x000000000176c360
0x00005554fffff4f8:  0x0000000000445307 <runtime.freezetheworld+0xffffffffa4706144>  0x01000000000003e8
0x00005554fffff508:  0x0000000000000008  0x00005554fffff538
0x00005554fffff518:  0x0000000000440757 <runtime.startpanic_m+0xffffffff6fd1de6d>  0x0000000000ecab4f
0x00005554fffff528:  0x0000000000fceef8  0x000000000176c360
0x00005554fffff538:  0x00005554fffff578  0x000000000044044b <runtime.fatalthrow.func1+0xffffffffe49fddb6>
0x00005554fffff548:  0x000000000176c360  0x0000000000476da8 <runtime.throw+0xffffffffe8c9395c>
0x00005554fffff558:  0x00005554fffff5c8  0x00005554fffff5c8
0x00005554fffff568:  0x0000000000476da8 <runtime.throw+0xffffffffe8c9395c>  0x000000000176c360
0x00005554fffff578:  0x00005554fffff5b8  0x00000000004403b8 <runtime.fatalthrow+0xffffffff36df1e58>
0x00005554fffff588:  0x00005554fffff598  0x000000000176c360
0x00005554fffff598:  0x00000000004403e0 <runtime.fatalthrow.func1+0xffffffffe49fdd4b>  0x000000000176c360
0x00005554fffff5a8:  0x0000000000476da8 <runtime.throw+0xffffffffe8c9395c>  0x00005554fffff5c8
0x00005554fffff5b8:  0x00005554fffff5e8  0x0000000000476da8 <runtime.throw+0xffffffffe8c9395c>
0x00005554fffff5c8: <0x00005554fffff5d0 >0x000000000043ff40 <runtime.throw.func1+0xffffffff852ecc61>
0x00005554fffff5d8:  0x0000000000ebc32b  0x000000000000001d
0x00005554fffff5e8:  0x00005554fffff700  0x0000000000460416 <runtime.moduledataverify1+0xffffffff858adb34>
0x00005554fffff5f8:  0x0000000000ebc32b  0x0000000000000000
0x00005554fffff608:  0x0000000000000000  0xfffffff100000000
0x00005554fffff618:  0x0000000000000000  0x0000000000000000
0x00005554fffff628:  0x0000000000000000  0x0000000000000000
0x00005554fffff638:  0x0000000000000000  0x0000000000000000
0x00005554fffff648:  0x0000000000000000  0x0000000000000000
0x00005554fffff658:  0x0000000000000008  0x0000000000000001
0x00005554fffff668:  0x0000000000000000  0x0000000000000000
0x00005554fffff678:  0x00000000004024a0 <+0x0000000000000000>  0x00000000004024a0 <+0x0000000000000000>
0x00005554fffff688:  0x0000000000000000  0x0000000000000000
0x00005554fffff698:  0x0000000000000000  0x0000000000000000
0x00005554fffff6a8:  0x0000000000000000  0x0000000000000000
0x00005554fffff6b8:  0x0000000000000000  0x00005554fffff6e8
0x00005554fffff6c8:  0x0000000000419a11 <runtime.unlock2+0xffffffff1205d204>

when executing garble reverse ./example output.txt, console output

main module (example) does not contain package example/example

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs infoRequires extra information to be solved

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions