-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
runtime: don't spawn threads from locked Ms #20676
Comments
CL https://golang.org/cl/46033 mentions this issue. |
Instead of switching into the container namespace and getting the IP addresses from the device, lookup the container metadata in our own datastore. This avoids switching namespaces and simplifies the IFB delete code a bit. See also: golang/go#20676 [#145244693]
cc @LK4D4 just figured you would be curious |
This is related to #13164, which was solved a different way. Looks like the proposed solution has the same idea, just using an entire spare thread as the "known good" state instead of just initSigmask, which is likely to be redundant after this fix goes in. (Because ensureSigM calls LockOSThread already.) |
Move to golang version 1.10.4 -- the oldest stable golang release at the time of writing -- since golang 1.10+ is needed to make namespace handling safe. See: - golang/go#20676 - golang/go@2595fe7 Also bumped `languages.golang.meta.newest-version` to golang version 1.11, which is the newest stable release at the time of writing. Fixes kata-containers#148. Signed-off-by: James O. D. Hunt <[email protected]>
Just wanted to note this related message on golang-dev, as the notion of "clean thread" may be manipulated anyway via scheduling inheritance via pthread_attr or chrt linux and the like. Seems to me like a necessary and useful feature to isolate thread properties from threads created via package "C", but not via the OS. |
Move to golang version 1.10.4 -- the oldest stable golang release at the time of writing -- since golang 1.10+ is needed to make namespace handling safe. Re-ordered a couple of structs (moved `sync.WaitGroup` fields) to keep the `maligned` linter happy. Previously: `` virtcontainers/pkg/mock/cc_proxy_mock.go:24:18:warning: struct of size 160 could be 152 (maligned) virtcontainers/monitor.go:15:14:warning: struct of size 80 could be 72 (maligned) ``` See: - golang/go#20676 - golang/go@2595fe7 Also bumped `languages.golang.meta.newest-version` to golang version 1.11, which is the newest stable release at the time of writing. Fixes kata-containers#148. Signed-off-by: James O. D. Hunt <[email protected]>
Move to golang version 1.10.4 -- the oldest stable golang release at the time of writing -- since golang 1.10+ is needed to make namespace handling safe. Re-ordered a couple of structs (moved `sync.WaitGroup` fields) to keep the `maligned` linter happy. Previously: `` virtcontainers/pkg/mock/cc_proxy_mock.go:24:18:warning: struct of size 160 could be 152 (maligned) virtcontainers/monitor.go:15:14:warning: struct of size 80 could be 72 (maligned) ``` See: - golang/go#20676 - golang/go@2595fe7 Also bumped `languages.golang.meta.newest-version` to golang version 1.11, which is the newest stable release at the time of writing. Fixes kata-containers#148. Signed-off-by: James O. D. Hunt <[email protected]>
Move to golang version 1.10.4 -- the oldest stable golang release at the time of writing -- since golang 1.10+ is needed to make namespace handling safe. Re-ordered a couple of structs (moved `sync.WaitGroup` fields) to keep the `maligned` linter happy. Previously: `` virtcontainers/pkg/mock/cc_proxy_mock.go:24:18:warning: struct of size 160 could be 152 (maligned) virtcontainers/monitor.go:15:14:warning: struct of size 80 could be 72 (maligned) ``` See: - golang/go#20676 - golang/go@2595fe7 Also bumped `languages.golang.meta.newest-version` to golang version 1.11, which is the newest stable release at the time of writing. Fixes kata-containers#148. Signed-off-by: James O. D. Hunt <[email protected]>
Move to golang version 1.10.4 -- the oldest stable golang release at the time of writing -- since golang 1.10+ is needed to make namespace handling safe. Re-ordered a couple of structs (moved `sync.WaitGroup` fields) to keep the `maligned` linter happy. Previously: `` virtcontainers/pkg/mock/cc_proxy_mock.go:24:18:warning: struct of size 160 could be 152 (maligned) virtcontainers/monitor.go:15:14:warning: struct of size 80 could be 72 (maligned) ``` See: - golang/go#20676 - golang/go@2595fe7 Also bumped `languages.golang.meta.newest-version` to golang version 1.11, which is the newest stable release at the time of writing. Fixes kata-containers#148. Signed-off-by: James O. D. Hunt <[email protected]>
Move to golang version 1.10.4 -- the oldest stable golang release at the time of writing -- since golang 1.10+ is needed to make namespace handling safe. Re-ordered a couple of structs (moved `sync.WaitGroup` fields) to keep the `maligned` linter happy. Previously: `` virtcontainers/pkg/mock/cc_proxy_mock.go:24:18:warning: struct of size 160 could be 152 (maligned) virtcontainers/monitor.go:15:14:warning: struct of size 80 could be 72 (maligned) ``` See: - golang/go#20676 - golang/go@2595fe7 Also bumped `languages.golang.meta.newest-version` to golang version 1.11, which is the newest stable release at the time of writing. Fixes kata-containers#148. Signed-off-by: James O. D. Hunt <[email protected]>
Move to golang version 1.10.4 -- the oldest stable golang release at the time of writing -- since golang 1.10+ is needed to make namespace handling safe. Re-ordered a couple of structs (moved `sync.WaitGroup` fields) to keep the `maligned` linter happy. Previously: `` virtcontainers/pkg/mock/cc_proxy_mock.go:24:18:warning: struct of size 160 could be 152 (maligned) virtcontainers/monitor.go:15:14:warning: struct of size 80 could be 72 (maligned) ``` See: - golang/go#20676 - golang/go@2595fe7 Also bumped `languages.golang.meta.newest-version` to golang version 1.11, which is the newest stable release at the time of writing. Fixes kata-containers#148. Signed-off-by: James O. D. Hunt <[email protected]>
Move to golang version 1.10.4 -- the oldest stable golang release at the time of writing -- since golang 1.10+ is needed to make namespace handling safe. Re-ordered a couple of structs (moved `sync.WaitGroup` fields) to keep the `maligned` linter happy. Previously: `` virtcontainers/pkg/mock/cc_proxy_mock.go:24:18:warning: struct of size 160 could be 152 (maligned) virtcontainers/monitor.go:15:14:warning: struct of size 80 could be 72 (maligned) ``` See: - golang/go#20676 - golang/go@2595fe7 Also bumped `languages.golang.meta.newest-version` to golang version 1.11, which is the newest stable release at the time of writing. Fixes kata-containers#148. Signed-off-by: James O. D. Hunt <[email protected]>
This prevents netns from being used on older Go runtimes on which it's not safe to perform any state manipulations of a scheduling thread (golang/go#20676). Signed-off-by: Martynas Pumputis <[email protected]>
Currently the runtime can spawn a new OS thread from essentially any M. This is bad if it attempts to spawn from a locked M that's locked because the goroutine on that M put the OS thread into a strange state. The new thread will inherit this state and start running other goroutines.
For example, this blog post describes the effects of this when trying to manipulate Linux namespaces from within a goroutine: https://www.weave.works/blog/linux-namespaces-and-go-don-t-mix
We should instead make sure we never spawn new threads from locked Ms. If we need to start a new thread while running on a locked M, we should forward the clone operation to a known-clean thread. We could either keep around a thread specifically for this purpose, or use the existing
sysmon
thread.This is related to #20395, which is the other way a tainted thread can wind up back in the runtime's thread pool.
The text was updated successfully, but these errors were encountered: