what causes this Trace/breakpoint trap?

1,144 views
Skip to first unread message

Darren Hoo

unread,
May 16, 2016, 6:15:32 AM5/16/16
to golang-nuts
A simple hello.go cross compiled on OSX,

# GOOS=linux GOARCH=386 go build

when copied and executed on a linux vps host(OpenVZ) , it gets killed:

# ./hello
Trace/breakpoint trap

# strace ./hello

execve("./hello", ["./hello"], [/* 26 vars */]) = 0
modify_ldt(1, {entry_number:7, base_addr:0x82ca8bc, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, 16) = -1 EPERM (Operation not permitted)
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

But using Go tip to cross compile it, it runs ok.

Direct building using Go 1.6.2 on the target host is not possible because compile fails too

go build command-line-arguments: /usr/local/go/pkg/tool/linux_386/compile: signal: trace/breakpoint trap


Dave Cheney

unread,
May 16, 2016, 6:55:44 AM5/16/16
to golang-nuts
This could be the difference between a statically and dynamically linked binary. The cross compiled version will be static.
Reply all
Reply to author
Forward
0 new messages