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

cmd/cgo/internal/testshared: GOHOSTARCH=arm fails on go1.21rc2/arm64 with abi mismatch #61025

Open
mpx opened this issue Jun 27, 2023 · 16 comments
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@mpx
Copy link
Contributor

mpx commented Jun 27, 2023

System:

Raspberry Pi 4 Model B
Raspbian/Debian Bullseye (11)
binutils 2.35.2-2+rpi1
aarch64 kernel with arm userspace.

All the misc/cgo/testshared tests now fail with go1.21rc2 when using GOHOSTARCH=arm on arm64:

$ GOROOT_BOOTSTRAP=/home/build/go1.20.5 GOHOSTARCH=arm time ./all.bash
[..]
##### ../misc/cgo/testshared
--- FAIL: TestTrivialExecutable (17.68s)
    shared_test.go:52: executing ../../bin/trivial (trivial executable) failed exit status 2:
        abi mismatch detected between the executable and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf7b6c2d6, 0xc})
                /home/build/go-dev/src/runtime/panic.go:1075 +0x54 fp=0xffc54b9c sp=0xffc54b88 pc=0xf7aeae80
        runtime.moduledataverify1(0x21170)
                /home/build/go-dev/src/runtime/symtab.go:666 +0x408 fp=0xffc54c14 sp=0xffc54b9c pc=0xf7b1bfbc
        runtime.moduledataverify(...)
                /home/build/go-dev/src/runtime/symtab.go:617
        runtime.schedinit()
                /home/build/go-dev/src/runtime/proc.go:710 +0x44 fp=0xffc54c38 sp=0xffc54c14 pc=0xf7af1324
        runtime.rt0_go()
                /home/build/go-dev/src/runtime/asm_arm.s:168 +0x8c fp=0xffc54c78 sp=0xffc54c38 pc=0xf7b33ebc
[..]
Full failure log from cd77738
[..]
##### ../misc/cgo/testshared
--- FAIL: TestTrivialExecutable (17.68s)
    shared_test.go:52: executing ../../bin/trivial (trivial executable) failed exit status 2:
        abi mismatch detected between the executable and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf7b6c2d6, 0xc})
                /home/build/go-dev/src/runtime/panic.go:1075 +0x54 fp=0xffc54b9c sp=0xffc54b88 pc=0xf7aeae80
        runtime.moduledataverify1(0x21170)
                /home/build/go-dev/src/runtime/symtab.go:666 +0x408 fp=0xffc54c14 sp=0xffc54b9c pc=0xf7b1bfbc
        runtime.moduledataverify(...)
                /home/build/go-dev/src/runtime/symtab.go:617
        runtime.schedinit()
                /home/build/go-dev/src/runtime/proc.go:710 +0x44 fp=0xffc54c38 sp=0xffc54c14 pc=0xf7af1324
        runtime.rt0_go()
                /home/build/go-dev/src/runtime/asm_arm.s:168 +0x8c fp=0xffc54c78 sp=0xffc54c38 pc=0xf7b33ebc
--- FAIL: TestDivisionExecutable (1.51s)
    shared_test.go:52: executing ../../bin/division (division executable) failed exit status 2:
        abi mismatch detected between the executable and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf7d542d6, 0xc})
                /home/build/go-dev/src/runtime/panic.go:1075 +0x54 fp=0xffc01e3c sp=0xffc01e28 pc=0xf7cd2e80
        runtime.moduledataverify1(0x21170)
                /home/build/go-dev/src/runtime/symtab.go:666 +0x408 fp=0xffc01eb4 sp=0xffc01e3c pc=0xf7d03fbc
        runtime.moduledataverify(...)
                /home/build/go-dev/src/runtime/symtab.go:617
        runtime.schedinit()
                /home/build/go-dev/src/runtime/proc.go:710 +0x44 fp=0xffc01ed8 sp=0xffc01eb4 pc=0xf7cd9324
        runtime.rt0_go()
                /home/build/go-dev/src/runtime/asm_arm.s:168 +0x8c fp=0xffc01f18 sp=0xffc01ed8 pc=0xf7d1bebc
--- FAIL: TestCgoExecutable (4.91s)
    shared_test.go:52: executing ../../bin/execgo (cgo executable) failed exit status 2:
        abi mismatch detected between the executable and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf7c4e2d6, 0xc})
                /home/build/go-dev/src/runtime/panic.go:1075 +0x54 fp=0xffafa17c sp=0xffafa168 pc=0xf7bcce80
        runtime.moduledataverify1(0x30750)
                /home/build/go-dev/src/runtime/symtab.go:666 +0x408 fp=0xffafa1f4 sp=0xffafa17c pc=0xf7bfdfbc
        runtime.moduledataverify(...)
                /home/build/go-dev/src/runtime/symtab.go:617
        runtime.schedinit()
                /home/build/go-dev/src/runtime/proc.go:710 +0x44 fp=0xffafa218 sp=0xffafa1f4 pc=0xf7bd3324
        runtime.rt0_go()
                /home/build/go-dev/src/runtime/asm_arm.s:168 +0x8c fp=0xffafa258 sp=0xffafa218 pc=0xf7c15ebc
--- FAIL: TestGopathShlib (10.49s)
    shared_test.go:52: executing ../../bin/exe (executable linked to GOPATH library) failed exit status 2:
        abi mismatch detected between libtestshared-depBase.so and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf782a2d6, 0xc})
                /home/build/go-dev/src/runtime/panic.go:1075 +0x54 fp=0xff8e68ac sp=0xff8e6898 pc=0xf77a8e80
        runtime.moduledataverify1(0xf7697dd0)
                /home/build/go-dev/src/runtime/symtab.go:666 +0x408 fp=0xff8e6924 sp=0xff8e68ac pc=0xf77d9fbc
        runtime.moduledataverify(...)
                /home/build/go-dev/src/runtime/symtab.go:617
        runtime.schedinit()
                /home/build/go-dev/src/runtime/proc.go:710 +0x44 fp=0xff8e6948 sp=0xff8e6924 pc=0xf77af324
        runtime.rt0_go()
                /home/build/go-dev/src/runtime/asm_arm.s:168 +0x8c fp=0xff8e6988 sp=0xff8e6948 pc=0xf77f1ebc
--- FAIL: TestTwoGopathShlibs (7.74s)
    shared_test.go:52: executing ../../bin/exe2 (executable linked to GOPATH library) failed exit status 2:
        abi mismatch detected between libtestshared-depBase.so and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf75f32d6, 0xc})
                /home/build/go-dev/src/runtime/panic.go:1075 +0x54 fp=0xffa732cc sp=0xffa732b8 pc=0xf7571e80
        runtime.moduledataverify1(0xf79cadd0)
                /home/build/go-dev/src/runtime/symtab.go:666 +0x408 fp=0xffa73344 sp=0xffa732cc pc=0xf75a2fbc
        runtime.moduledataverify(...)
                /home/build/go-dev/src/runtime/symtab.go:617
        runtime.schedinit()
                /home/build/go-dev/src/runtime/proc.go:710 +0x44 fp=0xffa73368 sp=0xffa73344 pc=0xf7578324
        runtime.rt0_go()
                /home/build/go-dev/src/runtime/asm_arm.s:168 +0x8c fp=0xffa733a8 sp=0xffa73368 pc=0xf75baebc
--- FAIL: TestThreeGopathShlibs (20.07s)
    shared_test.go:52: executing ../../bin/exe3 (executable linked to GOPATH library) failed exit status 2:
        abi mismatch detected between libtestshared-depBase.so and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf769c2d6, 0xc})
                /home/build/go-dev/src/runtime/panic.go:1075 +0x54 fp=0xffa80abc sp=0xffa80aa8 pc=0xf761ae80
        runtime.moduledataverify1(0xf7393dd0)
                /home/build/go-dev/src/runtime/symtab.go:666 +0x408 fp=0xffa80b34 sp=0xffa80abc pc=0xf764bfbc
        runtime.moduledataverify(...)
                /home/build/go-dev/src/runtime/symtab.go:617
        runtime.schedinit()
                /home/build/go-dev/src/runtime/proc.go:710 +0x44 fp=0xffa80b58 sp=0xffa80b34 pc=0xf7621324
        runtime.rt0_go()
                /home/build/go-dev/src/runtime/asm_arm.s:168 +0x8c fp=0xffa80b98 sp=0xffa80b58 pc=0xf7663ebc
--- FAIL: TestABIChecking (5.99s)
    shared_test.go:1012: exe failed, but without line "abi mismatch detected between the executable and lib"; got output:
        abi mismatch detected between libtestshared-depBase.so and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf79422d6, 0xc})
                /home/build/go-dev/src/runtime/panic.go:1075 +0x54 fp=0xffc1a58c sp=0xffc1a578 pc=0xf78c0e80
        runtime.moduledataverify1(0xf77afdd0)
                /home/build/go-dev/src/runtime/symtab.go:666 +0x408 fp=0xffc1a604 sp=0xffc1a58c pc=0xf78f1fbc
        runtime.moduledataverify(...)
                /home/build/go-dev/src/runtime/symtab.go:617
        runtime.schedinit()
                /home/build/go-dev/src/runtime/proc.go:710 +0x44 fp=0xffc1a628 sp=0xffc1a604 pc=0xf78c7324
        runtime.rt0_go()
                /home/build/go-dev/src/runtime/asm_arm.s:168 +0x8c fp=0xffc1a668 sp=0xffc1a628 pc=0xf7909ebc
--- FAIL: TestImplicitInclusion (3.36s)
    shared_test.go:52: executing ../../bin/implicitcmd (running executable linked against library that contains same package as it) failed exit status 2:
        abi mismatch detected between libtestshared-explicit.so and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf77562d6, 0xc})
                /home/build/go-dev/src/runtime/panic.go:1075 +0x54 fp=0xff815d4c sp=0xff815d38 pc=0xf76d4e80
        runtime.moduledataverify1(0xf789d090)
                /home/build/go-dev/src/runtime/symtab.go:666 +0x408 fp=0xff815dc4 sp=0xff815d4c pc=0xf7705fbc
        runtime.moduledataverify(...)
                /home/build/go-dev/src/runtime/symtab.go:617
        runtime.schedinit()
                /home/build/go-dev/src/runtime/proc.go:710 +0x44 fp=0xff815de8 sp=0xff815dc4 pc=0xf76db324
        runtime.rt0_go()
                /home/build/go-dev/src/runtime/asm_arm.s:168 +0x8c fp=0xff815e28 sp=0xff815de8 pc=0xf771debc
--- FAIL: TestInterface (4.76s)
    shared_test.go:52: executing ../../bin/iface (running type/itab uniqueness tester) failed exit status 2:
        abi mismatch detected between libtestshared-iface_b.so and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf7ce22d6, 0xc})
                /home/build/go-dev/src/runtime/panic.go:1075 +0x54 fp=0xff979dbc sp=0xff979da8 pc=0xf7c60e80
        runtime.moduledataverify1(0xf7b5e090)
                /home/build/go-dev/src/runtime/symtab.go:666 +0x408 fp=0xff979e34 sp=0xff979dbc pc=0xf7c91fbc
        runtime.moduledataverify(...)
                /home/build/go-dev/src/runtime/symtab.go:617
        runtime.schedinit()
                /home/build/go-dev/src/runtime/proc.go:710 +0x44 fp=0xff979e58 sp=0xff979e34 pc=0xf7c67324
        runtime.rt0_go()
                /home/build/go-dev/src/runtime/asm_arm.s:168 +0x8c fp=0xff979e98 sp=0xff979e58 pc=0xf7ca9ebc
--- FAIL: TestGlobal (3.99s)
    shared_test.go:52: executing ../../bin/global (global executable) failed exit status 2:
        abi mismatch detected between libtestshared-globallib.so and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf73f42d6, 0xc})
                /home/build/go-dev/src/runtime/panic.go:1075 +0x54 fp=0xffda889c sp=0xffda8888 pc=0xf7372e80
        runtime.moduledataverify1(0xf753b0a0)
                /home/build/go-dev/src/runtime/symtab.go:666 +0x408 fp=0xffda8914 sp=0xffda889c pc=0xf73a3fbc
        runtime.moduledataverify(...)
                /home/build/go-dev/src/runtime/symtab.go:617
        runtime.schedinit()
                /home/build/go-dev/src/runtime/proc.go:710 +0x44 fp=0xffda8938 sp=0xffda8914 pc=0xf7379324
        runtime.rt0_go()
                /home/build/go-dev/src/runtime/asm_arm.s:168 +0x8c fp=0xffda8978 sp=0xffda8938 pc=0xf73bbebc
--- FAIL: TestTestInstalledShared (11.84s)
    shared_test.go:1063: executing /home/build/go-dev/bin/go test -linkshared -test.short sync/atomic failed exit status 1:
--- FAIL: TestGeneratedHash (5.73s)
    shared_test.go:1076: executing /home/build/go-dev/bin/go test -linkshared ./issue30768 failed exit status 1:
--- FAIL: TestGCData (4.66s)
    shared_test.go:52: executing ./main (running gcdata/main) failed exit status 2:
        abi mismatch detected between libtestshared-gcdata-p.so and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf7dff2d6, 0xc})
                /home/build/go-dev/src/runtime/panic.go:1075 +0x54 fp=0xffda274c sp=0xffda2738 pc=0xf7d7de80
        runtime.moduledataverify1(0xf7c7b090)
                /home/build/go-dev/src/runtime/symtab.go:666 +0x408 fp=0xffda27c4 sp=0xffda274c pc=0xf7daefbc
        runtime.moduledataverify(...)
                /home/build/go-dev/src/runtime/symtab.go:617
        runtime.schedinit()
                /home/build/go-dev/src/runtime/proc.go:710 +0x44 fp=0xffda27e8 sp=0xffda27c4 pc=0xf7d84324
        runtime.rt0_go()
                /home/build/go-dev/src/runtime/asm_arm.s:168 +0x8c fp=0xffda2828 sp=0xffda27e8 pc=0xf7dc6ebc
--- FAIL: TestIssue44031 (5.43s)
    shared_test.go:1098: executing /home/build/go-dev/bin/go run -linkshared ./issue44031/main failed exit status 1:
        abi mismatch detected between libtestshared-issue44031-a.so and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf79252d6, 0xc})
                /home/build/go-dev/src/runtime/panic.go:1075 +0x54 fp=0xffbaa06c sp=0xffbaa058 pc=0xf78a3e80
        runtime.moduledataverify1(0xf763f090)
                /home/build/go-dev/src/runtime/symtab.go:666 +0x408 fp=0xffbaa0e4 sp=0xffbaa06c pc=0xf78d4fbc
        runtime.moduledataverify(...)
                /home/build/go-dev/src/runtime/symtab.go:617
        runtime.schedinit()
                /home/build/go-dev/src/runtime/proc.go:710 +0x44 fp=0xffbaa108 sp=0xffbaa0e4 pc=0xf78aa324
        runtime.rt0_go()
                /home/build/go-dev/src/runtime/asm_arm.s:168 +0x8c fp=0xffbaa148 sp=0xffbaa108 pc=0xf78ecebc
        exit status 2
--- FAIL: TestIssue47873 (3.84s)
    shared_test.go:1106: executing /home/build/go-dev/bin/go run -linkshared ./issue47837/main failed exit status 1:
        abi mismatch detected between libtestshared-issue47837-a.so and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf7b232d6, 0xc})
                /home/build/go-dev/src/runtime/panic.go:1075 +0x54 fp=0xffe4ac8c sp=0xffe4ac78 pc=0xf7aa1e80
        runtime.moduledataverify1(0xf7c6b090)
                /home/build/go-dev/src/runtime/symtab.go:666 +0x408 fp=0xffe4ad04 sp=0xffe4ac8c pc=0xf7ad2fbc
        runtime.moduledataverify(...)
                /home/build/go-dev/src/runtime/symtab.go:617
        runtime.schedinit()
                /home/build/go-dev/src/runtime/proc.go:710 +0x44 fp=0xffe4ad28 sp=0xffe4ad04 pc=0xf7aa8324
        runtime.rt0_go()
                /home/build/go-dev/src/runtime/asm_arm.s:168 +0x8c fp=0xffe4ad68 sp=0xffe4ad28 pc=0xf7aeaebc
        exit status 2
FAIL
FAIL    misc/cgo/testshared     176.158s
FAIL
2023/06/27 15:39:14 Failed: exit status 1

##### ../misc/cgo/testplugin
ok      misc/cgo/testplugin     0.005s
go tool dist: FAILED

The same build approach has worked for at many releases until now (eg, go1.20.5 builds and tests correctly).

Git bisect shows the failure started with the following commit for #22040:

cd77738: cmd/link: don't switch to gold on ARM Linux

Cc @ianlancetaylor

Edit: Failure log is from cd77738, not go1.21rc2. The same error occurs for go1.21rc2 but in a different location. go1.21rc2 error log below.

@bcmills bcmills added compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jun 27, 2023
@bcmills
Copy link
Member

bcmills commented Jun 27, 2023

(attn @golang/compiler)

@cherrymui
Copy link
Member

cd77738: cmd/link: don't switch to gold on ARM Linux

If you run the test with environment varivable CGO_LDFLAGS=-fuse-ld=gold, does the error occur? Thanks.

@cherrymui cherrymui changed the title build: GOHOSTARCH=arm fails on go1.21rc2/arm64 with abi mismatch misc/cgo/testshared: GOHOSTARCH=arm fails on go1.21rc2/arm64 with abi mismatch Jun 27, 2023
@cherrymui
Copy link
Member

Wait, in go1.21rc2 tree there is no misc/cgo/testshared anymore (it is moved to cmd/cgo/internal). Are you sure you're running go1.21rc2, and could you make sure when updating the tree, residual files are deleted? Thanks.

@bcmills bcmills added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jun 27, 2023
@mpx
Copy link
Contributor Author

mpx commented Jun 27, 2023

Ah, sorry for the confusion. The above error log is from the clean commit highlighted by git bisect.

Here is the failure log from go1.21rc2:

[..]
ok      cmd/cgo/internal/testnocgo      0.019s
ok      cmd/cgo/internal/testplugin     0.048s
ok      cmd/cgo/internal/testsanitizers 0.221s
--- FAIL: TestTrivialExecutable (35.65s)
    shared_test.go:57: executing ../../bin/trivial (trivial executable) failed exit status 2:
        abi mismatch detected between the executable and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf77d745f, 0xc})
                /home/build/go1.21rc2/src/runtime/panic.go:1077 +0x54 fp=0xff9cacdc sp=0xff9cacc8 pc=0xf776050c
        runtime.moduledataverify1(0x21158)
                /home/build/go1.21rc2/src/runtime/symtab.go:568 +0x414 fp=0xff9cad64 sp=0xff9cacdc pc=0xf7793bbc
        runtime.moduledataverify(...)
                /home/build/go1.21rc2/src/runtime/symtab.go:519
        runtime.schedinit()
                /home/build/go1.21rc2/src/runtime/proc.go:724 +0x44 fp=0xff9cad88 sp=0xff9cad64 pc=0xf7767bd0
        runtime.rt0_go()
                /home/build/go1.21rc2/src/runtime/asm_arm.s:168 +0x8c fp=0xff9cadc8 sp=0xff9cad88 pc=0xf77ac220
--- FAIL: TestDivisionExecutable (3.00s)
    shared_test.go:57: executing ../../bin/division (division executable) failed exit status 2:
        abi mismatch detected between the executable and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
[..]
Full log from go1.21rc2
ok      cmd/cgo/internal/testnocgo      0.019s
ok      cmd/cgo/internal/testplugin     0.048s
ok      cmd/cgo/internal/testsanitizers 0.221s
--- FAIL: TestTrivialExecutable (35.65s)
    shared_test.go:57: executing ../../bin/trivial (trivial executable) failed exit status 2:
        abi mismatch detected between the executable and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf77d745f, 0xc})
                /home/build/go1.21rc2/src/runtime/panic.go:1077 +0x54 fp=0xff9cacdc sp=0xff9cacc8 pc=0xf776050c
        runtime.moduledataverify1(0x21158)
                /home/build/go1.21rc2/src/runtime/symtab.go:568 +0x414 fp=0xff9cad64 sp=0xff9cacdc pc=0xf7793bbc
        runtime.moduledataverify(...)
                /home/build/go1.21rc2/src/runtime/symtab.go:519
        runtime.schedinit()
                /home/build/go1.21rc2/src/runtime/proc.go:724 +0x44 fp=0xff9cad88 sp=0xff9cad64 pc=0xf7767bd0
        runtime.rt0_go()
                /home/build/go1.21rc2/src/runtime/asm_arm.s:168 +0x8c fp=0xff9cadc8 sp=0xff9cad88 pc=0xf77ac220
--- FAIL: TestDivisionExecutable (3.00s)
    shared_test.go:57: executing ../../bin/division (division executable) failed exit status 2:
        abi mismatch detected between the executable and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf78e945f, 0xc})
                /home/build/go1.21rc2/src/runtime/panic.go:1077 +0x54 fp=0xffa6b95c sp=0xffa6b948 pc=0xf787250c
        runtime.moduledataverify1(0x22158)
                /home/build/go1.21rc2/src/runtime/symtab.go:568 +0x414 fp=0xffa6b9e4 sp=0xffa6b95c pc=0xf78a5bbc
        runtime.moduledataverify(...)
                /home/build/go1.21rc2/src/runtime/symtab.go:519
        runtime.schedinit()
                /home/build/go1.21rc2/src/runtime/proc.go:724 +0x44 fp=0xffa6ba08 sp=0xffa6b9e4 pc=0xf7879bd0
        runtime.rt0_go()
                /home/build/go1.21rc2/src/runtime/asm_arm.s:168 +0x8c fp=0xffa6ba48 sp=0xffa6ba08 pc=0xf78be220
--- FAIL: TestCgoExecutable (4.66s)
    shared_test.go:57: executing ../../bin/execgo (cgo executable) failed exit status 2:
        abi mismatch detected between the executable and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf7ae345f, 0xc})
                /home/build/go1.21rc2/src/runtime/panic.go:1077 +0x54 fp=0xffef74fc sp=0xffef74e8 pc=0xf7a6c50c
        runtime.moduledataverify1(0x41738)
                /home/build/go1.21rc2/src/runtime/symtab.go:568 +0x414 fp=0xffef7584 sp=0xffef74fc pc=0xf7a9fbbc
        runtime.moduledataverify(...)
                /home/build/go1.21rc2/src/runtime/symtab.go:519
        runtime.schedinit()
                /home/build/go1.21rc2/src/runtime/proc.go:724 +0x44 fp=0xffef75a8 sp=0xffef7584 pc=0xf7a73bd0
        runtime.rt0_go()
                /home/build/go1.21rc2/src/runtime/asm_arm.s:168 +0x8c fp=0xffef75e8 sp=0xffef75a8 pc=0xf7ab8220
--- FAIL: TestGopathShlib (30.94s)
    shared_test.go:57: executing ../../bin/exe (executable linked to GOPATH library) failed exit status 2:
        abi mismatch detected between libtestshared-depBase.so and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf7b9645f, 0xc})
                /home/build/go1.21rc2/src/runtime/panic.go:1077 +0x54 fp=0xffc8337c sp=0xffc83368 pc=0xf7b1f50c
        runtime.moduledataverify1(0xf79e7e68)
                /home/build/go1.21rc2/src/runtime/symtab.go:568 +0x414 fp=0xffc83404 sp=0xffc8337c pc=0xf7b52bbc
        runtime.moduledataverify(...)
                /home/build/go1.21rc2/src/runtime/symtab.go:519
        runtime.schedinit()
                /home/build/go1.21rc2/src/runtime/proc.go:724 +0x44 fp=0xffc83428 sp=0xffc83404 pc=0xf7b26bd0
        runtime.rt0_go()
                /home/build/go1.21rc2/src/runtime/asm_arm.s:168 +0x8c fp=0xffc83468 sp=0xffc83428 pc=0xf7b6b220
--- FAIL: TestTwoGopathShlibs (12.36s)
    shared_test.go:57: executing ../../bin/exe2 (executable linked to GOPATH library) failed exit status 2:
        abi mismatch detected between libtestshared-depBase.so and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf747545f, 0xc})
                /home/build/go1.21rc2/src/runtime/panic.go:1077 +0x54 fp=0xffd18f2c sp=0xffd18f18 pc=0xf73fe50c
        runtime.moduledataverify1(0xf785fe68)
                /home/build/go1.21rc2/src/runtime/symtab.go:568 +0x414 fp=0xffd18fb4 sp=0xffd18f2c pc=0xf7431bbc
        runtime.moduledataverify(...)
                /home/build/go1.21rc2/src/runtime/symtab.go:519
        runtime.schedinit()
                /home/build/go1.21rc2/src/runtime/proc.go:724 +0x44 fp=0xffd18fd8 sp=0xffd18fb4 pc=0xf7405bd0
        runtime.rt0_go()
                /home/build/go1.21rc2/src/runtime/asm_arm.s:168 +0x8c fp=0xffd19018 sp=0xffd18fd8 pc=0xf744a220
--- FAIL: TestThreeGopathShlibs (13.82s)
    shared_test.go:57: executing ../../bin/exe3 (executable linked to GOPATH library) failed exit status 2:
        abi mismatch detected between libtestshared-depBase.so and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf7a2f45f, 0xc})
                /home/build/go1.21rc2/src/runtime/panic.go:1077 +0x54 fp=0xffc8134c sp=0xffc81338 pc=0xf79b850c
        runtime.moduledataverify1(0xf770ae68)
                /home/build/go1.21rc2/src/runtime/symtab.go:568 +0x414 fp=0xffc813d4 sp=0xffc8134c pc=0xf79ebbbc
        runtime.moduledataverify(...)
                /home/build/go1.21rc2/src/runtime/symtab.go:519
        runtime.schedinit()
                /home/build/go1.21rc2/src/runtime/proc.go:724 +0x44 fp=0xffc813f8 sp=0xffc813d4 pc=0xf79bfbd0
        runtime.rt0_go()
                /home/build/go1.21rc2/src/runtime/asm_arm.s:168 +0x8c fp=0xffc81438 sp=0xffc813f8 pc=0xf7a04220
--- FAIL: TestABIChecking (8.22s)
    shared_test.go:1051: exe failed, but without line "abi mismatch detected between the executable and lib"; got output:
        abi mismatch detected between libtestshared-depBase.so and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf7d4f45f, 0xc})
                /home/build/go1.21rc2/src/runtime/panic.go:1077 +0x54 fp=0xffde15bc sp=0xffde15a8 pc=0xf7cd850c
        runtime.moduledataverify1(0xf7ba0e68)
                /home/build/go1.21rc2/src/runtime/symtab.go:568 +0x414 fp=0xffde1644 sp=0xffde15bc pc=0xf7d0bbbc
        runtime.moduledataverify(...)
                /home/build/go1.21rc2/src/runtime/symtab.go:519
        runtime.schedinit()
                /home/build/go1.21rc2/src/runtime/proc.go:724 +0x44 fp=0xffde1668 sp=0xffde1644 pc=0xf7cdfbd0
        runtime.rt0_go()
                /home/build/go1.21rc2/src/runtime/asm_arm.s:168 +0x8c fp=0xffde16a8 sp=0xffde1668 pc=0xf7d24220
--- FAIL: TestImplicitInclusion (13.75s)
    shared_test.go:57: executing ../../bin/implicitcmd (running executable linked against library that contains same package as it) failed exit status 2:
        abi mismatch detected between libtestshared-explicit.so and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf7c5845f, 0xc})
                /home/build/go1.21rc2/src/runtime/panic.go:1077 +0x54 fp=0xfffd7c4c sp=0xfffd7c38 pc=0xf7be150c
        runtime.moduledataverify1(0xf7dce060)
                /home/build/go1.21rc2/src/runtime/symtab.go:568 +0x414 fp=0xfffd7cd4 sp=0xfffd7c4c pc=0xf7c14bbc
        runtime.moduledataverify(...)
                /home/build/go1.21rc2/src/runtime/symtab.go:519
        runtime.schedinit()
                /home/build/go1.21rc2/src/runtime/proc.go:724 +0x44 fp=0xfffd7cf8 sp=0xfffd7cd4 pc=0xf7be8bd0
        runtime.rt0_go()
                /home/build/go1.21rc2/src/runtime/asm_arm.s:168 +0x8c fp=0xfffd7d38 sp=0xfffd7cf8 pc=0xf7c2d220
--- FAIL: TestInterface (13.59s)
    shared_test.go:57: executing ../../bin/iface (running type/itab uniqueness tester) failed exit status 2:
        abi mismatch detected between libtestshared-iface_b.so and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf7bb145f, 0xc})
                /home/build/go1.21rc2/src/runtime/panic.go:1077 +0x54 fp=0xfff312bc sp=0xfff312a8 pc=0xf7b3a50c
        runtime.moduledataverify1(0xf7a11060)
                /home/build/go1.21rc2/src/runtime/symtab.go:568 +0x414 fp=0xfff31344 sp=0xfff312bc pc=0xf7b6dbbc
        runtime.moduledataverify(...)
                /home/build/go1.21rc2/src/runtime/symtab.go:519
        runtime.schedinit()
                /home/build/go1.21rc2/src/runtime/proc.go:724 +0x44 fp=0xfff31368 sp=0xfff31344 pc=0xf7b41bd0
        runtime.rt0_go()
                /home/build/go1.21rc2/src/runtime/asm_arm.s:168 +0x8c fp=0xfff313a8 sp=0xfff31368 pc=0xf7b86220
--- FAIL: TestGlobal (6.50s)
    shared_test.go:57: executing ../../bin/global (global executable) failed exit status 2:
        abi mismatch detected between libtestshared-globallib.so and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf6f1c45f, 0xc})
                /home/build/go1.21rc2/src/runtime/panic.go:1077 +0x54 fp=0xffcb5cdc sp=0xffcb5cc8 pc=0xf6ea550c
        runtime.moduledataverify1(0xf7092070)
                /home/build/go1.21rc2/src/runtime/symtab.go:568 +0x414 fp=0xffcb5d64 sp=0xffcb5cdc pc=0xf6ed8bbc
        runtime.moduledataverify(...)
                /home/build/go1.21rc2/src/runtime/symtab.go:519
        runtime.schedinit()
                /home/build/go1.21rc2/src/runtime/proc.go:724 +0x44 fp=0xffcb5d88 sp=0xffcb5d64 pc=0xf6eacbd0
        runtime.rt0_go()
                /home/build/go1.21rc2/src/runtime/asm_arm.s:168 +0x8c fp=0xffcb5dc8 sp=0xffcb5d88 pc=0xf6ef1220
--- FAIL: TestTestInstalledShared (27.58s)
    shared_test.go:1106: executing /home/build/go1.21rc2/bin/go test -linkshared -test.short sync/atomic failed exit status 1:
--- FAIL: TestGeneratedHash (9.84s)
    shared_test.go:1121: executing /home/build/go1.21rc2/bin/go test -linkshared ./issue30768 failed exit status 1:
--- FAIL: TestGCData (10.86s)
    shared_test.go:57: executing ./main (running gcdata/main) failed exit status 2:
        abi mismatch detected between libtestshared-gcdata-p.so and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf77b045f, 0xc})
                /home/build/go1.21rc2/src/runtime/panic.go:1077 +0x54 fp=0xffbf38bc sp=0xffbf38a8 pc=0xf773950c
        runtime.moduledataverify1(0xf7610060)
                /home/build/go1.21rc2/src/runtime/symtab.go:568 +0x414 fp=0xffbf3944 sp=0xffbf38bc pc=0xf776cbbc
        runtime.moduledataverify(...)
                /home/build/go1.21rc2/src/runtime/symtab.go:519
        runtime.schedinit()
                /home/build/go1.21rc2/src/runtime/proc.go:724 +0x44 fp=0xffbf3968 sp=0xffbf3944 pc=0xf7740bd0
        runtime.rt0_go()
                /home/build/go1.21rc2/src/runtime/asm_arm.s:168 +0x8c fp=0xffbf39a8 sp=0xffbf3968 pc=0xf7785220
--- FAIL: TestIssue44031 (19.31s)
    shared_test.go:1146: executing /home/build/go1.21rc2/bin/go run -linkshared ./issue44031/main failed exit status 1:
        abi mismatch detected between libtestshared-issue44031-a.so and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf7d9f45f, 0xc})
                /home/build/go1.21rc2/src/runtime/panic.go:1077 +0x54 fp=0xffae950c sp=0xffae94f8 pc=0xf7d2850c
        runtime.moduledataverify1(0xf7a9d060)
                /home/build/go1.21rc2/src/runtime/symtab.go:568 +0x414 fp=0xffae9594 sp=0xffae950c pc=0xf7d5bbbc
        runtime.moduledataverify(...)
                /home/build/go1.21rc2/src/runtime/symtab.go:519
        runtime.schedinit()
                /home/build/go1.21rc2/src/runtime/proc.go:724 +0x44 fp=0xffae95b8 sp=0xffae9594 pc=0xf7d2fbd0
        runtime.rt0_go()
                /home/build/go1.21rc2/src/runtime/asm_arm.s:168 +0x8c fp=0xffae95f8 sp=0xffae95b8 pc=0xf7d74220
        exit status 2
--- FAIL: TestIssue47873 (5.00s)
    shared_test.go:1155: executing /home/build/go1.21rc2/bin/go run -linkshared ./issue47837/main failed exit status 1:
        abi mismatch detected between libtestshared-issue47837-a.so and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf790d45f, 0xc})
                /home/build/go1.21rc2/src/runtime/panic.go:1077 +0x54 fp=0xffce984c sp=0xffce9838 pc=0xf789650c
        runtime.moduledataverify1(0xf7a84060)
                /home/build/go1.21rc2/src/runtime/symtab.go:568 +0x414 fp=0xffce98d4 sp=0xffce984c pc=0xf78c9bbc
        runtime.moduledataverify(...)
                /home/build/go1.21rc2/src/runtime/symtab.go:519
        runtime.schedinit()
                /home/build/go1.21rc2/src/runtime/proc.go:724 +0x44 fp=0xffce98f8 sp=0xffce98d4 pc=0xf789dbd0
        runtime.rt0_go()
                /home/build/go1.21rc2/src/runtime/asm_arm.s:168 +0x8c fp=0xffce9938 sp=0xffce98f8 pc=0xf78e2220
        exit status 2
FAIL
FAIL    cmd/cgo/internal/testshared     323.892s
ok      cmd/cgo/internal/testso 7.317s
ok      cmd/cgo/internal/teststdio      6.758s
ok      cmd/cgo/internal/testtls        0.021s
[..]

Same error, but from the new location for those tests.

I'll test with CGO_LDFLAGS=-fuse-ld=gold.

@mpx mpx changed the title misc/cgo/testshared: GOHOSTARCH=arm fails on go1.21rc2/arm64 with abi mismatch cmd/cgo/internal/testshared: GOHOSTARCH=arm fails on go1.21rc2/arm64 with abi mismatch Jun 27, 2023
@bcmills bcmills removed the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jun 27, 2023
@mpx
Copy link
Contributor Author

mpx commented Jun 27, 2023

Same failure mode with CGO_LDFLAGS=-fuse-ld=gold:

$ GOROOT_BOOTSTRAP=/home/build/go1.20.5 GOHOSTARCH=arm CGO_LDFLAGS=-fuse-ld=gold time ./all.bash
[..]
ok      cmd/cgo/internal/testnocgo      0.019s
ok      cmd/cgo/internal/testplugin     0.025s
ok      cmd/cgo/internal/testsanitizers 0.439s
--- FAIL: TestTrivialExecutable (3.86s)
    shared_test.go:57: executing ../../bin/trivial (trivial executable) failed exit status 2:
        abi mismatch detected between the executable and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf777d86f, 0xc})
                /home/build/go1.21rc2/src/runtime/panic.go:1077 +0x54 fp=0xffcc467c sp=0xffcc4668 pc=0xf770691c
        runtime.moduledataverify1(0x21168)
                /home/build/go1.21rc2/src/runtime/symtab.go:568 +0x414 fp=0xffcc4704 sp=0xffcc467c pc=0xf7739fcc
        runtime.moduledataverify(...)
                /home/build/go1.21rc2/src/runtime/symtab.go:519
        runtime.schedinit()
                /home/build/go1.21rc2/src/runtime/proc.go:724 +0x44 fp=0xffcc4728 sp=0xffcc4704 pc=0xf770dfe0
        runtime.rt0_go()
                /home/build/go1.21rc2/src/runtime/asm_arm.s:168 +0x8c fp=0xffcc4768 sp=0xffcc4728 pc=0xf7752630
--- FAIL: TestDivisionExecutable (2.13s)
    shared_test.go:57: executing ../../bin/division (division executable) failed exit status 2:
        abi mismatch detected between the executable and libruntime,sync-atomic.so
        fatal error: abi mismatch
        runtime: panic before malloc heap initialized
        
        runtime stack:
        runtime.throw({0xf7b5786f, 0xc})
                /home/build/go1.21rc2/src/runtime/panic.go:1077 +0x54 fp=0xff8fe9dc sp=0xff8fe9c8 pc=0xf7ae091c
        runtime.moduledataverify1(0x22168)
                /home/build/go1.21rc2/src/runtime/symtab.go:568 +0x414 fp=0xff8fea64 sp=0xff8fe9dc pc=0xf7b13fcc
        runtime.moduledataverify(...)
                /home/build/go1.21rc2/src/runtime/symtab.go:519
        runtime.schedinit()
                /home/build/go1.21rc2/src/runtime/proc.go:724 +0x44 fp=0xff8fea88 sp=0xff8fea64 pc=0xf7ae7fe0
        runtime.rt0_go()
                /home/build/go1.21rc2/src/runtime/asm_arm.s:168 +0x8c fp=0xff8feac8 sp=0xff8fea88 pc=0xf7b2c630
[..]

@mpx
Copy link
Contributor Author

mpx commented Jun 27, 2023

FYI, building go1.21rc2 with cd77738 reverted works. Not to suggest this is the best approach, just to confirm.

@ianlancetaylor
Copy link
Contributor

Which version of GNU ld are you using?

@mpx
Copy link
Contributor Author

mpx commented Jun 28, 2023

$ ld --version
GNU ld (GNU Binutils for Raspbian) 2.35.2
[..]
$ file -L `which ld`
/usr/bin/ld: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=d7d5337de83876a374f24cd1ebc073c334303541, for GNU/Linux 3.2.0, stripped
$ uname -m
aarch64

@cagedmantis cagedmantis added this to the Go1.21 milestone Jun 28, 2023
@cherrymui
Copy link
Member

Just to make sure the flag is propagated through, does CGO_LDFLAGS=-fuse-ld=gold go test cmd/cgo/internal/testshared makes any difference? Thanks.

@mpx
Copy link
Contributor Author

mpx commented Jun 28, 2023

Tested directly with CGO_LDFLAGS=-fuse-ld=gold ~/go1.21rc2/bin/go test cmd/cgo/internal/testshared and it still fails with the same errors.

@gopherbot
Copy link

Change https://go.dev/cl/511695 mentions this issue: cmd/link: switch to gold linker on ARM in dynamic linking mode

@gopherbot
Copy link

Change https://go.dev/cl/511696 mentions this issue: cmd/cgo/internal/testshared: skip in short mode and not on builders

@cherrymui
Copy link
Member

cherrymui commented Jul 20, 2023

Thanks. Not sure why the flag doesn't work. Maybe we did not pass the flag through for the test somehow...

I don't have GNU ld 2.35.2 on hand. I tried an older version (2.31.1) and a newer version (2.40.50.20230611), also couldn't reproduce. And I'm also not on an ARM64 OS running ARM32 binary. I don't think the OS architecture matters here. Have you tried running it on an ARM32 OS?

Anyway, I think it is okay to continue to switch to gold linker, at least for Go 1.21. Could you try if CL https://go.dev/cl/511695 helps?

Also, are you actively using the shared build mode for your code, or you just run all.bash and see the failure? Thanks.

gopherbot pushed a commit that referenced this issue Jul 21, 2023
We already skip testcarchive, testcshared, and testplugin in short
mode and not on builders. The shared build mode is not more
supported than the c-archive, c-shared, and plugin build modes. No
need to run it everywhere by default.

Updates #61025.

Change-Id: I6a06e04c1a1dc78f0f85456320d128bd67277915
Reviewed-on: https://go-review.googlesource.com/c/go/+/511696
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
@gopherbot gopherbot modified the milestones: Go1.21, Go1.22 Aug 8, 2023
@mpx
Copy link
Contributor Author

mpx commented Aug 9, 2023

Sorry, missed this earlier.

I've been using an ARM32 distro (Rasbian) with an upgraded ARM64 kernel, I haven't tried other configurations.

1.21.0 fails similarly (as expected). all.bash completes successfully after applying the patch from cl/511695.

I'm not using shared build mode - only building/testing the toolchain with all.bash.

@cherrymui
Copy link
Member

Thanks. As we don't yet know if it affects real use case, we're probably not going to backport the CL yet. As you don't use shared build mode, you can ignore that test failure. Thanks.

@mpx
Copy link
Contributor Author

mpx commented Aug 26, 2023

Thanks. FYI, the devel tree builds/tests fine with this configuration so it should be resolved in the next release (as expected).
go version devel go1.21-1dbbafc70f Mon Jun 26 21:06:37 2023 +0000 linux/arm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Status: Todo
Development

No branches or pull requests

6 participants