I create a file named hw.go
with the below code
package main
import "fmt"
func main() {
fmt.Println("hello world")
}
and compiled like this on ubuntu (pretty new version):
go build -v -a -tags netgo -ldflags '-w -extldflags "-static"' hw.go
Then I moved the binary to an older linux also 64 bit and while executing got this error:
what am I doing wrong ?
futexwakeup addr=0x558708 returned -38
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x1006 pc=0x425e5b]
runtime stack:
runtime.throw(0x4becb7, 0x2a)
/usr/local/go/src/runtime/panic.go:617 +0x72
runtime.sigpanic()
/usr/local/go/src/runtime/signal_unix.go:374 +0x4a9
runtime.futexwakeup(0x558708, 0x2b1000000001)
/usr/local/go/src/runtime/os_linux.go:81 +0x8b
runtime.notewakeup(0x558708)
/usr/local/go/src/runtime/lock_futex.go:136 +0x44
runtime.startlockedm(0xc000000180)
/usr/local/go/src/runtime/proc.go:2105 +0x7e
runtime.schedule()
/usr/local/go/src/runtime/proc.go:2555 +0x69
runtime.park_m(0xc000000a80)
/usr/local/go/src/runtime/proc.go:2605 +0xa1
runtime.mcall(0x0)
/usr/local/go/src/runtime/asm_amd64.s:299 +0x5b
goroutine 1 [runnable, locked to thread]:
internal/poll.init()
<autogenerated>:1 +0x73
os.init()
<autogenerated>:1 +0x54
fmt.init()
<autogenerated>:1 +0x54
main.init()
<autogenerated>:1 +0x45
runtime.main()
/usr/local/go/src/runtime/proc.go:188 +0x1c8
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1337 +0x1
Just tried an old compiler and it worked. 1.10.8 is the latest version it works, 1.11.8 doesn't work.
*I didn't check minor versions