Bug 1474280

Summary: Run container on non-target platform cause golang panic
Product: Red Hat Enterprise Linux 7 Reporter: Luwen Su <lsu>
Component: dockerAssignee: Daniel Walsh <dwalsh>
Status: CLOSED NEXTRELEASE QA Contact: atomic-bugs <atomic-bugs>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7.4CC: amurdaca, lsm5
Target Milestone: rcKeywords: Extras
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-07-24 08:13:58 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Luwen Su 2017-07-24 05:56:33 EDT
Description of problem:
On x86 platform vm, try to run container that targeted for other platform,
cause a golang panic

Version-Release number of selected component (if applicable):
docker-1.12.6-48.git0fdc778.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.
# docker run -it --rm docker.io/ppc64le/debian dpkg --list

9c3d4f23b64e: Pull complete 
Digest: sha256:7b5f52d71fb35987a447ce509dbfdf92cfbfa7477a67798a295ffd860024bc7b
Status: Downloaded newer image for docker.io/ppc64le/debian:latest


panic: standard_init_linux.go:178: exec user process caused "exec format error" [recovered]
	panic: standard_init_linux.go:178: exec user process caused "exec format error"

goroutine 1 [running, locked to thread]:
github.com/urfave/cli.HandleAction.func1(0xc4200977a0)
	/builddir/build/BUILD/docker-0fdc77886ccc101a28b11ce63e87a935c936d2ef/runc-79c3939053c870fbb4de5484d98640d5ba028ef4/Godeps/_workspace/src/github.com/urfave/cli/app.go:478 +0x23f
panic(0x6f0c00, 0xc420112e00)
	/usr/lib/golang/src/runtime/panic.go:489 +0x2cf
github.com/opencontainers/runc/libcontainer.(*LinuxFactory).StartInitialization.func1(0xc420097208, 0xc42000e0d0, 0xc4200972a8)
	/builddir/build/BUILD/docker-0fdc77886ccc101a28b11ce63e87a935c936d2ef/runc-79c3939053c870fbb4de5484d98640d5ba028ef4/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:259 +0xc1
github.com/opencontainers/runc/libcontainer.(*LinuxFactory).StartInitialization(0xc4200489b0, 0xaa88e0, 0xc420112e00)
	/builddir/build/BUILD/docker-0fdc77886ccc101a28b11ce63e87a935c936d2ef/runc-79c3939053c870fbb4de5484d98640d5ba028ef4/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:277 +0x353
main.glob..func8(0xc420074780, 0x0, 0x0)
	/builddir/build/BUILD/docker-0fdc77886ccc101a28b11ce63e87a935c936d2ef/runc-79c3939053c870fbb4de5484d98640d5ba028ef4/main_unix.go:26 +0x66
reflect.Value.call(0x6d9b20, 0x7502a8, 0x13, 0x73b882, 0x4, 0xc420097760, 0x1, 0x1, 0xc4200976f0, 0x731360, ...)
	/usr/lib/golang/src/reflect/value.go:434 +0x91f
reflect.Value.Call(0x6d9b20, 0x7502a8, 0x13, 0xc420097760, 0x1, 0x1, 0x665a76, 0x73ba0e, 0x4)
	/usr/lib/golang/src/reflect/value.go:302 +0xa4
github.com/urfave/cli.HandleAction(0x6d9b20, 0x7502a8, 0xc420074780, 0x0, 0x0)
	/builddir/build/BUILD/docker-0fdc77886ccc101a28b11ce63e87a935c936d2ef/runc-79c3939053c870fbb4de5484d98640d5ba028ef4/Godeps/_workspace/src/github.com/urfave/cli/app.go:487 +0x18f
github.com/urfave/cli.Command.Run(0x73ba2e, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x74d2ea, 0x51, 0x0, ...)
	/builddir/build/BUILD/docker-0fdc77886ccc101a28b11ce63e87a935c936d2ef/runc-79c3939053c870fbb4de5484d98640d5ba028ef4/Godeps/_workspace/src/github.com/urfave/cli/command.go:191 +0xac8
github.com/urfave/cli.(*App).Run(0xc42009a000, 0xc42000c140, 0x2, 0x2, 0x0, 0x0)
	/builddir/build/BUILD/docker-0fdc77886ccc101a28b11ce63e87a935c936d2ef/runc-79c3939053c870fbb4de5484d98640d5ba028ef4/Godeps/_workspace/src/github.com/urfave/cli/app.go:240 +0x5d6
main.main()
	/builddir/build/BUILD/docker-0fdc77886ccc101a28b11ce63e87a935c936d2ef/runc-79c3939053c870fbb4de5484d98640d5ba028ef4/main.go:137 +0xbd2

2.The return error is fine if use docker-latest
# docker-latest run -it --rm docker.io/ppc64le/debian dpkg --list
 
latest: Pulling from docker.io/ppc64le/debian
9c3d4f23b64e: Pull complete 
Digest: sha256:7b5f52d71fb35987a447ce509dbfdf92cfbfa7477a67798a295ffd860024bc7b
Status: Downloaded newer image for docker.io/ppc64le/debian:latest
standard_init_linux.go:178: exec user process caused "exec format error"

#rpm -q docker-latest
docker-latest-1.13.1-21.1.gitcd75c68.el7.x86_64


Actual results:
Golang panic

Expected results:
Could handle this kind of error properly.

Additional info:
Comment 2 Daniel Walsh 2017-07-24 08:13:58 EDT
Since this is fixed in the next release, I am going to close.  I don't see this as requiring a back port.