Skip to content

Commit 4641f17

Browse files
authored
Merge pull request #4234 from cyphar/go122
[hotfix] nsenter: refuse to build with Go 1.22
2 parents ea38465 + e377e16 commit 4641f17

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ jobs:
146146
- name: install go
147147
uses: actions/setup-go@v5
148148
with:
149-
go-version: 1.x # Latest stable
149+
go-version: 1.21.x # TODO: switch to 1.x (latest stable) once Go 1.22 vs glibc issue is fixed.
150150

151151
- name: unit test
152152
env:

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)