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

Rootless podman ps segfault on refresh when containers are present #2894

Closed
mheon opened this issue Apr 10, 2019 · 2 comments · Fixed by #2896
Closed

Rootless podman ps segfault on refresh when containers are present #2894

mheon opened this issue Apr 10, 2019 · 2 comments · Fixed by #2896
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. rootless

Comments

@mheon
Copy link
Member

mheon commented Apr 10, 2019

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Segfault stack trace: https://paste.fedoraproject.org/paste/ClFhuW2MYXIW2qESPyQ4Mg

When rootless podman runs the refresh command when containers are present, it will segfault.

Nearest I can tell, the sequence of events goes like this:
Podman's main creates a fresh libpod.Runtime to search for user namespaces to join
We haven't joined a user namespace yet, so GetEUID() != 0, so the storage.Store is not configured
A refresh is requested, so the code attempts to call into the store to create the container's temporary directories. The store has not yet been configured, so we segfault. Podman becomes unusable because refresh is impossible.

We need to do a refresh, though. Otherwise we won't properly reset container states after reboot.

Steps to reproduce the issue:

  1. Create at least one container e.g. podman create -t -i fedora bash

  2. Reboot the system

  3. Run any podman command that is not podman version

Describe the results you received:

Podman segfaults

Describe the results you expected:

Podman does not segfault

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

Current master on F29, originally noticed with Rawhide packages

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 10, 2019
@mheon mheon added the rootless label Apr 10, 2019
@mheon
Copy link
Member Author

mheon commented Apr 10, 2019

@giuseppe PTAL

giuseppe added a commit to giuseppe/libpod that referenced this issue Apr 10, 2019
create immediately a namespace if we need a refresh.  This is
necessary to access the rootless storage.

Closes: containers#2894

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
@giuseppe
Copy link
Member

I've opened a PR here: #2896

muayyad-alsadi pushed a commit to muayyad-alsadi/libpod that referenced this issue Apr 21, 2019
create immediately a namespace if we need a refresh.  This is
necessary to access the rootless storage.

Closes: containers#2894

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
@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 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 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. rootless
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants