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

gollvm: runc runtime error, broken pipe #35907

heylinn opened this issue Nov 29, 2019 · 2 comments

gollvm: runc runtime error, broken pipe #35907

heylinn opened this issue Nov 29, 2019 · 2 comments


Copy link

@heylinn heylinn commented Nov 29, 2019

What version of Go are you using (go version)?

$ go version
go version go1.13 gollvm LLVM 10.0.0svn linux/amd64

Does this issue reproduce with the latest release?


What operating system and processor architecture are you using (go env)?

Ubuntu 18.04.3 LTS, x86_64

What did you do?


$ cd 
$ git clone
$ cd runc
$ mkdir -p .gopath/src/
$ ln -sf `pwd` `pwd`/.gopath/src/
$ export GOPATH=`pwd`/.gopath
$ cd .gopath/src/
$ go build -tags "seccomp" -o runc .

$ cd 
$ mkdir mycontainer
$ cp helloworld_rootfs.tar.gz mycontainer
$ cd mycontainer
$ tar -xf helloworld_rootfs.tar.gz

$ ../runc/runc spec --rootless
$ sed -i 's;"sh";"/hello";' config.json
$ ../runc/runc run mycontainer

What did you expect to see?

Hello from Docker!                                                                                                                            
This message shows that your installation appears to be working correctly.

What did you see instead?

$ ../runc/runc run mycontainer
WARN[0000] exit status 127                              
ERRO[0000] container_linux.go:346: starting container process caused "process_linux.go:315: copying bootstrap data to pipe caused \"write init-p: broken pipe\"" 
container_linux.go:346: starting container process caused "process_linux.go:315: copying bootstrap data to pipe caused \"write init-p: broken pipe\""

$ gdb --args ../runc/runc run mycontainer
Thread 6 "runc" received signal SIGPIPE, Broken pipe.
[Switching to Thread 0x7fffe97f8700 (LWP 17662)]
0x00007ffff59ed187 in __GI___libc_write (fd=7, buf=0xc000236100, nbytes=64) at ../sysdeps/unix/sysv/linux/write.c:27
27      ../sysdeps/unix/sysv/linux/write.c: No such file or directory.
(gdb) bt
#0  0x00007ffff59ed187 in __GI___libc_write (fd=7, buf=0xc000236100, nbytes=64) at ../sysdeps/unix/sysv/linux/write.c:27
#1  0x00007ffff717a768 in syscall.write (fd=7, p=...) at build.rel/tools/gollvm/libgo/libcalls.go:2654
#2  syscall.Write (fd=7, p=...) at llvm/tools/gollvm/gofrontend/libgo/go/syscall/syscall_unix.go:168
#3  0x00007ffff6f6eb23 in internal..z2fpoll.FD.Write (fd=0xc0000ec1e0, p=...)
    at llvm/tools/gollvm/gofrontend/libgo/go/internal/poll/fd_unix.go:268
#4  0x00007ffff70a1a62 in os.File.write (f=0xc0000f6040, b=...)
    at llvm/tools/gollvm/gofrontend/libgo/go/os/file_unix.go:290
#5  0x00007ffff70a0f4e in os.File.Write (f=0xc0000f6040, b=...)
    at llvm/tools/gollvm/gofrontend/libgo/go/os/file.go:153
#6  0x00007ffff6d10674 in bytes.Reader.WriteTo (r=0xc0000f2270, w=...)
    at llvm/tools/gollvm/gofrontend/libgo/go/bytes/reader.go:144
#7  0x00007ffff6f8ef33 in io.copyBuffer (dst=..., src=..., buf=...)
    at llvm/tools/gollvm/gofrontend/libgo/go/io/io.go:384
#8  0x00007ffff6f8ecfd in io.Copy (dst=..., src=...) at llvm/tools/gollvm/gofrontend/libgo/go/io/io.go:364
#9  0x0000000000621d87 in github.x2ecom..z2fopencontainers..z2frunc..z2flibcontainer.initProcess.start (p=0xffffffffffffffe0)
    at github_issue/runc/.gopath/src/
#10 0x0000000000624f33 in github.x2ecom..z2fopencontainers..z2frunc..z2flibcontainer.linuxContainer.start (c=0xc0000bc2d0,
    at github_issue/runc/.gopath/src/
#11 0x00000000006193a3 in github.x2ecom..z2fopencontainers..z2frunc..z2flibcontainer.linuxContainer.Start (c=0xc0000bc2d0,
    at github_issue/runc/.gopath/src/
#12 0x0000000000618e2a in github.x2ecom..z2fopencontainers..z2frunc..z2flibcontainer.linuxContainer.Run (c=0xc0000bc2d0,
    at github_issue/runc/.gopath/src/
#13 0x0000000000608235 in (r=0xffffffffffffffe0, config=0xc00010c0e0)
    at github_issue/runc/.gopath/src/
#14 0x0000000000603093 in main.startContainer (context=, spec=0xffffffffffffffe0, action=2 '\002', criuOpts=)
    at github_issue/runc/.gopath/src/
#15 0x000000000060cf9f in main.func13 (context=0xc0000ac840)
    at github_issue/runc/.gopath/src/
#16 0x000000000066eeec in github.x2ecom..z2fopencontainers..z2frunc..z2fvendor..z2fgithub.x2ecom..z2furfave..z2fcli.HandleAction (
    action=..., context=0xc0000ac840)
    at github_issue/runc/.gopath/src/
#17 0x0000000000669e6e in github.x2ecom..z2fopencontainers..z2frunc..z2fvendor..z2fgithub.x2ecom..z2furfave..z2fcli.Command.Run (
    pointer=, ctx=0xc0000ac6e0)
    at github_issue/runc/.gopath/src/
#18 0x000000000066bc19 in github.x2ecom..z2fopencontainers..z2frunc..z2fvendor..z2fgithub.x2ecom..z2furfave..z2fcli.App.Run (
---Type  to continue, or q  to quit---
    a=, arguments=...)
    at github_issue/runc/.gopath/src/
#19 0x000000000060b0f1 in main.main () at github_issue/runc/.gopath/src/


This is a runtime issue of runc built with gollvm. It doesn't reproduce for gccgo and golang 1.10.
I am sorry, I didn't know how to make a short example.

helloworld_rootfs.tar.gz contains hello-world container example created using runc manpages:

$ docker pull hello-world
$ docker export $(docker create hello-world) > hello-world.tar
$ mkdir rootfs
$ tar -C rootfs -xf hello-world.tar
Copy link

@agnivade agnivade commented Nov 30, 2019

@agnivade agnivade added this to the gollvm milestone Nov 30, 2019
@thanm thanm self-assigned this Dec 2, 2019
Copy link

@thanm thanm commented Dec 2, 2019

I'll take a look... although not sure exactly when (I am a bit swamped with other work at the moment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants