Skip to content

Commit e377e16

Browse files
committed
[hotfix] nsenter: refuse to build with Go 1.22 on glibc
We will almost certainly need to eventually rework nsenter to: 1. Figure out a way to make pthread_self() not break after nsenter runs (probably not possible, because the core issue is likely that we are ignoring the rules of signal-safety(7)); or 2. Do an other re-exec of /proc/self/exe to execute the Go half of "runc init" -- after we've done the nsenter setup. This would reset all of the process state and ensure we have a clean glibc state for Go, but it would make runc slower... For now, just block Go 1.22 builds to avoid having broken runcs floating around until we resolve the issue. It seems possible for musl to also have an issue, but it appears to work and so for now just block glibc builds. Note that this will only block builds for anything that uses nsenter -- so users of our (internal) libcontainer libraries should be fine. Only users that are starting containers using nsenter to actually start containers will see the error (which is precisely what we want). Signed-off-by: Aleksa Sarai <[email protected]>
1 parent ac31da6 commit e377e16

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
> **NOTE**: runc currently will not work properly when compiled with Go 1.22 or
10+
> newer. This is due to some unfortunate glibc behaviour that Go 1.22
11+
> exacerbates in a way that results in containers not being able to start on
12+
> some systems. [See this issue for more information.][runc-4233].
13+
914
### Deprecated
1015

1116
* `runc` option `--criu` is now ignored (with a warning), and the option will
@@ -47,6 +52,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4752
* Remove tun/tap from the default device rules. (#3468)
4853
* specconv: avoid mapping "acl" to MS_POSIXACL. (#3739)
4954

55+
[runc-4233]: https://github.com/opencontainers/runc/issues/4233
56+
5057
## [1.1.8] - 2023-07-20
5158

5259
> 海纳百川 有容乃大

libcontainer/nsenter/nsenter_go122.go

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//go:build go1.22
2+
3+
package nsenter
4+
5+
/*
6+
// We know for sure that glibc has issues with pthread_self() when called from
7+
// Go after nsenter has run. This is likely a more general problem with how we
8+
// ignore the rules in signal-safety(7), and so it's possible musl will also
9+
// have issues, but as this is just a hotfix let's only block glibc builds.
10+
#include <features.h>
11+
#ifdef __GLIBC__
12+
# error "runc does not currently work properly with Go >=1.22. See <https://github.com/opencontainers/runc/issues/4233>."
13+
#endif
14+
*/
15+
import "C"

0 commit comments

Comments
 (0)