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

Go 1.24 breaks runc exec #4602

Closed
kolyshkin opened this issue Jan 22, 2025 · 9 comments
Closed

Go 1.24 breaks runc exec #4602

kolyshkin opened this issue Jan 22, 2025 · 9 comments

Comments

@kolyshkin
Copy link
Contributor

Description

I opened #4598 to check if runc works with Go 1.24 (currently using go1.24rc2) and found out that runc exec is badly broken.

The cause is allegedly a bug in the kernel, which is reported in https://lore.kernel.org/linux-fsdevel/20250122020850.2175427-1-kolyshkin@gmail.com/T/#u

I've also reported a Go bug to golang/go#71375

We can work around it by reimplementing io.Copy but first let's see what kernel and Go developers have to say.

Steps to reproduce the issue

See reproducers in the links above. You can also compile runc with Go 1.24 and run runc exec in the foreground.

Describe the results you received and expected

See above links.

What version of runc are you using?

I belive that any and all versions of runc are affected, when using Go 1.24rc2 (or rc1). The code introducing the use of io.Copy to copy from os.Stdin to a process' stdin is introduced in the very first runc commit 9fac183 aka "Initial commit of runc binary".

Host OS information

No response

Host kernel information

No response

@fuweid
Copy link
Member

fuweid commented Jan 22, 2025

cc @Burning1020 @abel-von

If I remember it correctly, rust io copy uses splice by default and run into tty copy issue in shim side. Just tag you if it can help.

@abel-von
Copy link

@fuweid Yes, and we replaced the std::io::copy by a copy function imlemented ourselves.

@kolyshkin
Copy link
Contributor Author

@fuweid Yes, and we replaced the std::io::copy by a copy function imlemented ourselves.

Was it the same issue (the pipe being locked in the kernel so its other end can't be closed)? Can you point out to the discussion you were having?

@abel-von
Copy link

It is a different issue but I think the root cause is the same. containerd/rust-extensions#79

@abel-von
Copy link

Does this bug only effect runc? as there are also many calls of io.Copy in containerd.

@akhilerm
Copy link
Contributor

akhilerm commented Jan 23, 2025

Does this bug only effect runc? as there are also many calls of io.Copy in containerd.

I had ran the containerd CI on 1.24rc1 and 1.24rc2 here containerd/containerd#11211. But couldnt see any failures or we may be missing tests for this case.

@kolyshkin
Copy link
Contributor Author

It is a different issue but I think the root cause is the same. containerd/rust-extensions#79

Yes, looks like it's the same underlying issue. @fuweid did you end up reporting this to the kernel folks?

@fuweid
Copy link
Member

fuweid commented Jan 23, 2025

@kolyshkin @abel-von sorry, I forgot to report it to kernel community. 😢

@kolyshkin
Copy link
Contributor Author

This is now fixed in Go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants