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

Podman 3.2.0 crash in cgroups.getAvailableControllers #10666

Closed
ocofon opened this issue Jun 12, 2021 · 2 comments · Fixed by #10668
Closed

Podman 3.2.0 crash in cgroups.getAvailableControllers #10666

ocofon opened this issue Jun 12, 2021 · 2 comments · Fixed by #10668
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@ocofon
Copy link

ocofon commented Jun 12, 2021

/kind bug

Description

podman in version 3.2.0 is crashing on "run" and "info" when a controller is in /proc/cgroups but is not mounted in cgroupRoot

Steps to reproduce the issue:

> podman run -it ubuntu bash
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xbd6528]

goroutine 1 [running]:
github.com/containers/podman/v3/pkg/cgroups.getAvailableControllers(0xc00037e780, 0xc000869200, 0x0, 0x15, 0xc0005fd500, 0x15, 0x1)
        pkg/cgroups/cgroups.go:171 +0x668
github.com/containers/podman/v3/pkg/cgroups.New(0xc0005fd500, 0x15, 0xc000450df0, 0xc0005fd500, 0x15, 0xc000000300)
        pkg/cgroups/cgroups.go:377 +0xfa
...
[pid 25251] newfstatat(AT_FDCWD, "/sys/fs/cgroup/cpuset", {st_mode=S_IFDIR|0755, st_size=60, ...}, 0) = 0
[pid 25251] newfstatat(AT_FDCWD, "/sys/fs/cgroup/cpu", {st_mode=S_IFDIR|0755, st_size=60, ...}, 0) = 0
[pid 25251] newfstatat(AT_FDCWD, "/sys/fs/cgroup/cpuacct", 0xc0004581d8, 0) = -1 ENOENT (No such file or directory)
[pid 25251] --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x18} ---

fileInfo, err := os.Stat(cgroupRoot + "/" + name)
if err != nil {
isSymLink = !fileInfo.IsDir()
}

After changing line 170 to:

if err == nil {

the commands are working again.

Output of podman version:

Version:      3.2.0
API Version:  3.2.0
Go Version:   go1.16.2
Built:        Fri Jun 11 10:20:51 2021
OS/Arch:      linux/amd64

Output of podman info --debug:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xbd6528]
@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 12, 2021
@rhatdan
Copy link
Member

rhatdan commented Jun 12, 2021

Please open a PR to fix.

@flouthoc
Copy link
Collaborator

@ocofon You can skip the entire flow when file is not mounted on CgroupRoot. Please let me know if you are picking this up.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants