Repository navigation
Closed
Labels
Description
Background info
- Cross compiling from amd64 -> armv7
- This is a bug I'm fixing on behalf of the Buildroot project
- The error appears to be a cgo illegal instruction
- Device is a Bananapi M1 Plus
- A20 ARM Cortex-A7 Dual-core
What version of Go are you using (go version)?
$ go version go version go1.11.2 linux/amd64
Does this issue reproduce with the latest release?
Yes. Reproduce by compiling dockerd with:
GOARCH=arm
GOARM=7
GOROOT="/workspaces/m1_plus/host/lib/go"
CC="/workspaces/m1_plus/host/bin/arm-linux-gnueabihf-gcc"
CXX="/workspaces/m1_plus/host/bin/arm-linux-gnueabihf-g++"
GOTOOLDIR="/workspaces/m1_plus/host/lib/go/pkg/tool/linux_arm"
PATH="/workspaces/m1_plus/host/bin:/workspaces/m1_plus/host/sbin:/usr/x86_64-pc-linux-gnu/gcc-bin/6.4.0:/usr/lib/llvm/5/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/opt/golang/bin"
GOBIN=
CGO_ENABLED=1
GOPATH="/workspaces/m1_plus/build/docker-engine-v18.06.1-ce/_gopath"
/workspaces/m1_plus/host/bin/go build -v -asmflags "-trimpath=/workspaces/m1_plus/build/" -gcflags \
"-trimpath=/workspaces/m1_plus/build/" \
-ldflags "-X main.GitCommit=v18.06.1-ce -X main.Version=v18.06.1-ce" \
-tags "cgo exclude_graphdriver_zfs autogen systemd journald exclude_graphdriver_btrfs exclude_graphdriver_devicemapper exclude_graphdriver _vfs" \
-o /workspaces/m1_plus/build/docker-engine-v18.06.1-ce/bin/dockerd
./cmd/dockerd
The Docker daemon initially works correctly on the target system, but if you run "docker build ." the cgo call mygetgrgid_r causes the SIGILL.
What operating system and processor architecture are you using (go env)?
go env Output
$ go env GOARCH="arm" GOBIN="" GOCACHE="/home/paralin/.cache/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/paralin/Documents/synrobo/skiff/workspaces/m1_plus/build/docker-engine-v18.06.1-ce/_gopath" GOPROXY="" GORACE="" GOROOT="/home/paralin/Documents/synrobo/skiff/workspaces/m1_plus/host/lib/go" GOTMPDIR="" GOTOOLDIR="/home/paralin/Documents/synrobo/skiff/workspaces/m1_plus/host/lib/go/pkg/tool/linux_amd64" GCCGO="gccgo" GOARM="7" CC="/home/paralin/Documents/synrobo/skiff/workspaces/m1_plus/host/bin/arm-linux-gnueabihf-gcc" CXX="/home/paralin/Documents/synrobo/skiff/workspaces/m1_plus/host/bin/arm-linux-gnueabihf-g++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -marm -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build687750654=/tmp/go-build -gno-record-gcc-switches"
What did you do?
- Compile dockerd using the above commands
- Execute dockerd on the target system
- Use the Docker CLI to try to "docker build ."
Note: this bug only happens if the FROM declaration in the Dockerfile specifies a docker image that does not currently exist on the system (the cgo call must happen during the image pull phase).
What did you expect to see?
Program runs correctly
What did you see instead?
SIGILL illegal instruction
# docker build .
SIGILL: illegal instruction
PC=0x4f64e m=7 sigcode=1
goroutine 0 [idle]:
runtime: unexpected return pc for runtime.dumpregs called from 0xdabba0
stack: frame={sp:0xa3ffeccc, fp:0xa3ffed2c} stack=[0xa37ff0d4,0xa3ffecd4)
a3ffec4c: 00000000 00000002 01eeb980 00000000
a3ffec5c: a439fad5 00000077 0000007c 00000001
a3ffec6c: a2e00010 00000400 020589c8 02059000
a3ffec7c: 00000002 00ebd330 0204e780 00000008
a3ffec8c: 02000d20 0000001c 00dabc4c 02145340
a3ffec9c: 00dabbec 00000670 020589c8 00000002
a3ffecac: 00066ebc <runtime.asmcgocall+108> 01ed9604 00000001 a4ccb060
a3ffecbc: a4ccb060 00000670 023c6b60 00000000
a3ffeccc: <00dabba0 00000000
runtime.dumpregs(0xa650ca76)
/home/paralin/workspaces/m1_plus/host/lib/go/src/runtime/signal_arm.go:27 +0x4ce
goroutine 28 [syscall]:
runtime.cgocall(0xdabc1c, 0x20589c8, 0x29)
/home/paralin/workspaces/m1_plus/host/lib/go/src/runtime/cgocall.go:128 +0x5c fp=0x20589ac sp=0x2058994 pc=0x127d4
os/user._Cfunc_mygetgrgid_r(0x0, 0x232eb30, 0xa2e00470, 0x400, 0x2145340, 0x0)
_cgo_gotypes.go:104 +0x38 fp=0x20589c4 sp=0x20589ac pc=0x3c1fd8
os/user.lookupUnixGid.func1.1(0x0, 0x232eb30, 0xa2e00470, 0x400, 0x2145340, 0xa2e00470)
/home/paralin/workspaces/m1_plus/host/lib/go/src/os/user/cgo_lookup_unix.go:181 +0xfc fp=0x20589e0 sp=0x20589c4 pc=0x3c39f8
os/user.lookupUnixGid.func1(0x8)
/home/paralin/workspaces/m1_plus/host/lib/go/src/os/user/cgo_lookup_unix.go:181 +0x40 fp=0x20589fc sp=0x20589e0 pc=0x3c3a94
os/user.retryWithBuffer(0x2145348, 0x2058a70, 0x2145348, 0x0)
/home/paralin/workspaces/m1_plus/host/lib/go/src/os/user/cgo_lookup_unix.go:253 +0x2c fp=0x2058a24 sp=0x20589fc pc=0x3c2f40
os/user.lookupUnixGid(0x0, 0x0, 0x0, 0x0)
/home/paralin/workspaces/m1_plus/host/lib/go/src/os/user/cgo_lookup_unix.go:177 +0xc8 fp=0x2058a84 sp=0x2058a24 pc=0x3c2ad4
os/user.lookupGroupId(0x10b7b40, 0x1, 0xa, 0x10b7b40, 0x1)
/home/paralin/workspaces/m1_plus/host/lib/go/src/os/user/cgo_lookup_unix.go:167 +0x54 fp=0x2058a9c sp=0x2058a84 pc=0x3c29e4
os/user.LookupGroupId(0x10b7b40, 0x1, 0x1, 0x0, 0x0)
/home/paralin/workspaces/m1_plus/host/lib/go/src/os/user/lookup.go:53 +0x24 fp=0x2058ab4 sp=0x2058a9c pc=0x3c1d60
archive/tar.statUnix(0x12c09f0, 0x24f8480, 0x22bbae0, 0xd374c270, 0xe)
/home/paralin/workspaces/m1_plus/host/lib/go/src/archive/tar/stat_unix.go:45 +0x5ac fp=0x2058be8 sp=0x2058ab4 pc=0x3cca84
archive/tar.FileInfoHeader(0x12c09f0, 0x24f8480, 0x0, 0x0, 0xd374c270, 0xe, 0x1ed0d08)
/home/paralin/workspaces/m1_plus/host/lib/go/src/archive/tar/common.go:702 +0x384 fp=0x2058cb4 sp=0x2058be8 pc=0x3c60a0
github.com/docker/cli/vendor/github.com/docker/docker/pkg/archive.FileInfoHeader(0x22595b2, 0xa, 0x12c09f0, 0x24f8480, 0x0, 0x0, 0x4a6430, 0xf78538, 0x24d81e0)
/home/paralin/workspaces/m1_plus/build/docker-cli-v18.06.1-ce/gopath/src/github.com/docker/cli/vendor/github.com/docker/docker/pkg/archive/archive.go:361 +0x34 fp=0x2058d14 sp=0x205
8cb4 pc=0x49ffa0
github.com/docker/cli/vendor/github.com/docker/docker/pkg/archive.(*tarAppender).addTarFile(0x24adb40, 0x22595a0, 0x1c, 0x22595b2, 0xa, 0x0, 0x0)
/home/paralin/workspaces/m1_plus/build/docker-cli-v18.06.1-ce/gopath/src/github.com/docker/cli/vendor/github.com/docker/docker/pkg/archive/archive.go:479 +0xa0 fp=0x2058d60 sp=0x205
8d14 pc=0x4a0720
github.com/docker/cli/vendor/github.com/docker/docker/pkg/archive.TarWithOptions.func1.2(0x22595a0, 0x1c, 0x12c09f0, 0x24f83f0, 0x0, 0x0, 0xe, 0x1ed0d08)
/home/paralin/workspaces/m1_plus/build/docker-cli-v18.06.1-ce/gopath/src/github.com/docker/cli/vendor/github.com/docker/docker/pkg/archive/archive.go:889 +0x484 fp=0x2058e64 sp=0x20
58d60 pc=0x4a64b8
path/filepath.walk(0x22595a0, 0x1c, 0x12c09f0, 0x24f83f0, 0x23f2cc0, 0x0, 0x0)
/home/paralin/workspaces/m1_plus/host/lib/go/src/path/filepath/path.go:358 +0x2f0 fp=0x2058ec8 sp=0x2058e64 pc=0x16ec28
path/filepath.walk(0x2259500, 0x13, 0x12c09f0, 0x24f8360, 0x23f2cc0, 0x0, 0x30)
/home/paralin/workspaces/m1_plus/host/lib/go/src/path/filepath/path.go:382 +0x204 fp=0x2058f2c sp=0x2058ec8 pc=0x16eb3c
path/filepath.Walk(0x2259500, 0x13, 0x23f2cc0, 0x108490a, 0x1)
/home/paralin/workspaces/m1_plus/host/lib/go/src/path/filepath/path.go:404 +0xe8 fp=0x2058f58 sp=0x2058f2c pc=0x16ed40
github.com/docker/cli/vendor/github.com/docker/docker/pkg/archive.TarWithOptions.func1(0x24d27d0, 0x12aedc8, 0x232e900, 0x2144f10, 0x2144f00, 0x232e8f0)
/home/paralin/workspaces/m1_plus/build/docker-cli-v18.06.1-ce/gopath/src/github.com/docker/cli/vendor/github.com/docker/docker/pkg/archive/archive.go:807 +0x238 fp=0x2058fd4 sp=0x20
58f58 pc=0x4a69d0
runtime.goexit()
/home/paralin/workspaces/m1_plus/host/lib/go/src/runtime/asm_arm.s:867 +0x4 fp=0x2058fd4 sp=0x2058fd4 pc=0x670dc
created by github.com/docker/cli/vendor/github.com/docker/docker/pkg/archive.TarWithOptions
/home/paralin/workspaces/m1_plus/build/docker-cli-v18.06.1-ce/gopath/src/github.com/docker/cli/vendor/github.com/docker/docker/pkg/archive/archive.go:749 +0x1e0
goroutine 1 [select]:
net/http.(*persistConn).roundTrip(0x22bb9a0, 0x24ada80, 0x0, 0x0, 0x0)
/home/paralin/workspaces/m1_plus/host/lib/go/src/net/http/transport.go:2101 +0x400
net/http.(*Transport).roundTrip(0x24b6f20, 0x24d6880, 0x0, 0x0, 0x0)
/home/paralin/workspaces/m1_plus/host/lib/go/src/net/http/transport.go:465 +0x688
net/http.(*Transport).RoundTrip(0x24b6f20, 0x24d6880, 0x24b6f20, 0x0, 0x0)
/home/paralin/workspaces/m1_plus/host/lib/go/src/net/http/roundtrip.go:17 +0x24
net/http.send(0x24d6880, 0x12aada8, 0x24b6f20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x21452a8, 0xa6d7af3f, ...)
/home/paralin/workspaces/m1_plus/host/lib/go/src/net/http/client.go:250 +0x12c
net/http.(*Client).send(0x24ad400, 0x24d6880, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x10, 0x2247b3f, ...)
/home/paralin/workspaces/m1_plus/host/lib/go/src/net/http/client.go:174 +0xb8
net/http.(*Client).do(0x24ad400, 0x24d6880, 0x0, 0x0, 0x0)
/home/paralin/workspaces/m1_plus/host/lib/go/src/net/http/client.go:641 +0x1ec
net/http.(*Client).Do(0x24ad400, 0x24d6880, 0xa, 0x2145268, 0x238bef0)
/home/paralin/workspaces/m1_plus/host/lib/go/src/net/http/client.go:509 +0x24
github.com/docker/cli/vendor/golang.org/x/net/context/ctxhttp.Do(0x12bd2d0, 0x24ad720, 0x24ad400, 0x24d6800, 0x24b73f0, 0x0, 0xffffffff)
/home/paralin/workspaces/m1_plus/build/docker-cli-v18.06.1-ce/gopath/src/github.com/docker/cli/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go:30 +0xa0
github.com/docker/cli/vendor/github.com/docker/docker/client.(*Client).doRequest(0x22471c0, 0x12bd2d0, 0x24ad720, 0x24d6800, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/home/paralin/workspaces/m1_plus/build/docker-cli-v18.06.1-ce/gopath/src/github.com/docker/cli/vendor/github.com/docker/docker/client/request.go:132 +0x60
github.com/docker/cli/vendor/github.com/docker/docker/client.(*Client).sendRequest(0x22471c0, 0x12bd2d0, 0x24ad720, 0x10858bf, 0x4, 0x1087985, 0x6, 0x24ad7e0, 0x12a98c0, 0x22478c0, ...)
/home/paralin/workspaces/m1_plus/build/docker-cli-v18.06.1-ce/gopath/src/github.com/docker/cli/vendor/github.com/docker/docker/client/request.go:122 +0xc4
github.com/docker/cli/vendor/github.com/docker/docker/client.(*Client).postRaw(0x22471c0, 0x12bd2d0, 0x24ad720, 0x1087985, 0x6, 0x24ad7e0, 0x12a98c0, 0x22478c0, 0x255949c, 0x0, ...)
/home/paralin/workspaces/m1_plus/build/docker-cli-v18.06.1-ce/gopath/src/github.com/docker/cli/vendor/github.com/docker/docker/client/request.go:50 +0x80
github.com/docker/cli/vendor/github.com/docker/docker/client.(*Client).ImageBuild(0x22471c0, 0x12bd2d0, 0x24ad720, 0x12a98c0, 0x22478c0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/home/paralin/workspaces/m1_plus/build/docker-cli-v18.06.1-ce/gopath/src/github.com/docker/cli/vendor/github.com/docker/docker/client/image_build.go:35 +0x168
github.com/docker/cli/cli/command/image.runBuild(0x12c6ad8, 0x207c980, 0xbe99df16, 0x1, 0x0, 0x0, 0x2399070, 0x113e8dc, 0x2399090, 0x113e9b4, ...)
/home/paralin/workspaces/m1_plus/build/docker-cli-v18.06.1-ce/gopath/src/github.com/docker/cli/cli/command/image/build.go:399 +0x70c
github.com/docker/cli/cli/command/image.NewBuildCommand.func1(0x240b540, 0x2144df8, 0x1, 0x1, 0x0, 0x0)
/home/paralin/workspaces/m1_plus/build/docker-cli-v18.06.1-ce/gopath/src/github.com/docker/cli/cli/command/image/build.go:110 +0x6c
github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).execute(0x240b540, 0x208e070, 0x1, 0x2, 0x240b540, 0x208e070)
/home/paralin/workspaces/m1_plus/build/docker-cli-v18.06.1-ce/gopath/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:762 +0x364
github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x20f2c80, 0x200ff08, 0xee1248, 0x200ff10)
/home/paralin/workspaces/m1_plus/build/docker-cli-v18.06.1-ce/gopath/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:852 +0x210
github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).Execute(0x20f2c80, 0x20f2c80, 0x12aafe8)
/home/paralin/workspaces/m1_plus/build/docker-cli-v18.06.1-ce/gopath/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:800 +0x1c
main.main()
cmd/docker/docker.go:174 +0x98
goroutine 20 [syscall]:
os/signal.signal_recv(0x0)
/home/paralin/workspaces/m1_plus/host/lib/go/src/runtime/sigqueue.go:139 +0x130
os/signal.loop()
/home/paralin/workspaces/m1_plus/host/lib/go/src/os/signal/signal_unix.go:23 +0x14
created by os/signal.init.0
/home/paralin/workspaces/m1_plus/host/lib/go/src/os/signal/signal_unix.go:29 +0x30
goroutine 23 [chan receive]:
github.com/docker/cli/vendor/github.com/golang/glog.(*loggingT).flushDaemon(0x1ed0f30)
/home/paralin/workspaces/m1_plus/build/docker-cli-v18.06.1-ce/gopath/src/github.com/docker/cli/vendor/github.com/golang/glog/glog.go:879 +0x70
created by github.com/docker/cli/vendor/github.com/golang/glog.init.0
/home/paralin/workspaces/m1_plus/build/docker-cli-v18.06.1-ce/gopath/src/github.com/docker/cli/vendor/github.com/golang/glog/glog.go:410 +0x1a0
goroutine 26 [IO wait]:
internal/poll.runtime_pollWait(0xa4ccffc0, 0x72, 0x9dfc8)
/home/paralin/workspaces/m1_plus/host/lib/go/src/runtime/netpoll.go:173 +0x44
internal/poll.(*pollDesc).wait(0x24d26a4, 0x72, 0xffffff00, 0x12ac9b0, 0x1e5f15c)
/home/paralin/workspaces/m1_plus/host/lib/go/src/internal/poll/fd_poll_runtime.go:85 +0x7c
internal/poll.(*pollDesc).waitRead(0x24d26a4, 0x24f2000, 0x1000, 0x1000)
/home/paralin/workspaces/m1_plus/host/lib/go/src/internal/poll/fd_poll_runtime.go:90 +0x2c
internal/poll.(*FD).Read(0x24d2690, 0x24f2000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
/home/paralin/workspaces/m1_plus/host/lib/go/src/internal/poll/fd_unix.go:169 +0x14c
net.(*netFD).Read(0x24d2690, 0x24f2000, 0x1000, 0x1000, 0x20000e0, 0x4, 0x148c0)
/home/paralin/workspaces/m1_plus/host/lib/go/src/net/fd_unix.go:202 +0x38
net.(*conn).Read(0x2144e88, 0x24f2000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
/home/paralin/workspaces/m1_plus/host/lib/go/src/net/net.go:177 +0x58
net/http.(*persistConn).Read(0x22bb9a0, 0x24f2000, 0x1000, 0x1000, 0x2af2a0, 0x2078000, 0x204d620)
/home/paralin/workspaces/m1_plus/host/lib/go/src/net/http/transport.go:1497 +0x170
bufio.(*Reader).fill(0x23f2ab0)
/home/paralin/workspaces/m1_plus/host/lib/go/src/bufio/bufio.go:100 +0x10c
bufio.(*Reader).Peek(0x23f2ab0, 0x1, 0x0, 0x0, 0x1, 0x2279680, 0x0)
/home/paralin/workspaces/m1_plus/host/lib/go/src/bufio/bufio.go:132 +0x2c
net/http.(*persistConn).readLoop(0x22bb9a0)
/home/paralin/workspaces/m1_plus/host/lib/go/src/net/http/transport.go:1645 +0x164
created by net/http.(*Transport).dialConn
/home/paralin/workspaces/m1_plus/host/lib/go/src/net/http/transport.go:1338 +0x7f8
goroutine 27 [select]:
io.(*pipe).Read(0x23f2b40, 0x24c0000, 0x8000, 0x8000, 0x2026300, 0x19501, 0x1ee5001)
/home/paralin/workspaces/m1_plus/host/lib/go/src/io/pipe.go:50 +0xac
io.(*PipeReader).Read(0x2144f08, 0x24c0000, 0x8000, 0x8000, 0x1ee5020, 0x24c0000, 0x0)
/home/paralin/workspaces/m1_plus/host/lib/go/src/io/pipe.go:127 +0x38
github.com/docker/cli/vendor/github.com/docker/docker/pkg/progress.(*Reader).Read(0x22478c0, 0x24c0000, 0x8000, 0x8000, 0x24ddc8, 0x7c6d0, 0x8000)
/home/paralin/workspaces/m1_plus/build/docker-cli-v18.06.1-ce/gopath/src/github.com/docker/cli/vendor/github.com/docker/docker/pkg/progress/progressreader.go:35 +0x40
net/http.transferBodyReader.Read(0x24d2910, 0x24c0000, 0x8000, 0x8000, 0x8000, 0x8000, 0xf20d01)
/home/paralin/workspaces/m1_plus/host/lib/go/src/net/http/transfer.go:62 +0x40
io.copyBuffer(0xa4cdd250, 0x21452f0, 0x12ac890, 0x24d2910, 0x24c0000, 0x8000, 0x8000, 0xf20d10, 0xf4b780, 0x100, ...)
/home/paralin/workspaces/m1_plus/host/lib/go/src/io/io.go:402 +0xd8
io.Copy(0xa4cdd250, 0x21452f0, 0x12ac890, 0x24d2910, 0x21452f0, 0x24f3000, 0x195, 0x1000)
/home/paralin/workspaces/m1_plus/host/lib/go/src/io/io.go:364 +0x48
net/http.(*transferWriter).writeBody(0x24d2910, 0x12a9158, 0x24ad580, 0x2, 0x2)
/home/paralin/workspaces/m1_plus/host/lib/go/src/net/http/transfer.go:355 +0xec
net/http.(*Request).write(0x24d6880, 0x12a9158, 0x24ad580, 0x0, 0x0, 0x0, 0x0, 0x0)
/home/paralin/workspaces/m1_plus/host/lib/go/src/net/http/request.go:645 +0x4d8
net/http.(*persistConn).writeLoop(0x22bb9a0)
/home/paralin/workspaces/m1_plus/host/lib/go/src/net/http/transport.go:1888 +0x134
created by net/http.(*Transport).dialConn
/home/paralin/workspaces/m1_plus/host/lib/go/src/net/http/transport.go:1339 +0x814
trap 0x6
error 0x0
oldmask 0x0
r0 0x0
r1 0x20000000
r2 0x72
r3 0xa2e00471
r4 0x0
r5 0xa2e0086f
r6 0xfffffc01
r7 0xa2e0086f
r8 0xa2c00470
r9 0x7ffffffe
r10 0x2000d20
fp 0x3ff
ip 0xa43b3064
sp 0xa3ffeccc
lr 0xa439f8a8
pc 0x4f64e
cpsr 0x400f0030
fault 0xe4
#+END_SRC
Activity
paralin commentedon Nov 7, 2018
Here is the /proc/cpuinfo:
paralin commentedon Nov 7, 2018
Cross compiler information (CC and CXX)
paralin commentedon Nov 7, 2018
Go is compiled with:
randall77 commentedon Nov 7, 2018
Can you disassemble the binary and show us the instructions around PC=0x4f64e?
Possibly a dup of #28431 . Can you try tip and/or patch the associated CL in?
paralin commentedon Nov 7, 2018
Reproduced against go 1.10.3 .... Really starting to look like this may not be a Go specific issue, but I don't know where else to start looking yet (maybe the toolchain?)
This build, I ensured that CC_FOR_TARGET=$(CC) and CXX_FOR_TARGET=$(CXX) when cross-compiling.
The disassembly around 5152c:
Done using the toolchain objdump.
I see UNDEFINED instruction here a lot, are these causing the SIGILL?
Will try with the CL patched in.
@randall77
randall77 commentedon Nov 7, 2018
Looks like you disassembled in thumb mode. We generate only standard arm code. Could you figure out how to disassemble in standard mode?
Or, this could be the root of the issue. Maybe your C-compiled code is thumb and Go is standard? That would probably break everything.
paralin commentedon Nov 7, 2018
@randall77 In Buildroot we compile with thumb2 enabled on ARM. Would this break everything if the thumb mode was disabled when Go was calling the CC, or also if anything in the shared libraries used was in thumb2?
paralin commentedon Nov 7, 2018
@randall77 That CL doesn't apply to this scenario, it's for arm64 (this is arm) and for android (this is GOOS=linux)
randall77 commentedon Nov 7, 2018
I don't know much about arm <-> thumb transitions, just a suspicion based on the fact that the disassembler chose thumb.
It would be a good experiment at least to disable thumb everywhere you can, and see if that helps.
Ok. It's possibly a related issue, as we do use some feature detection to enable instructions on arm as well. I think we do it for the hardware divide instruction, at least. But that seems an unlikely culprit at the moment.
paralin commentedon Nov 7, 2018
Crash at PC=0x127d4 (cgocall.go:128) go 1.11.2
Maybe
bl 0x43aac?paralin commentedon Nov 7, 2018
_cgo_gotypes.go:104 +0x38 fp=0x20589c4 sp=0x20589ac pc=0x3c1fd83c1fd8: e59fb0b0 ldr fp, [pc, #176] ; 0x3c2090paralin commentedon Nov 7, 2018
Okay, disabling static compilation of the binary fixes the issue. I'm going to go ahead and close this, it's probably related to mixing thumb2 and standard instructions with static compilation. Going to give up on having a static docker client for now.
disable static build of `builder` to avoid sigsegv