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 exec --preserve-fds=2: panic #6653

Closed
edsantiago opened this issue Jun 17, 2020 · 7 comments · Fixed by #7125
Closed

podman exec --preserve-fds=2: panic #6653

edsantiago opened this issue Jun 17, 2020 · 7 comments · Fixed by #7125
Assignees
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. stale-issue

Comments

@edsantiago
Copy link
Member

I know, I know, this is undefined, but it probably shouldn't panic:

$ ./bin/podman run --name test -d alpine top
3e96d0911deb459b8549fcc31b0124a13d18340b5dfbcc7c68791723acc0696c
$ ./bin/podman exec --preserve-fds=2 -i test date
runtime: epollwait on fd 4 failed with 9
fatal error: runtime: netpoll failed

runtime stack:
runtime.throw(0x1a568ef, 0x17)
        /usr/lib/golang/src/runtime/panic.go:1116 +0x72
runtime.netpoll(0x0, 0x0)
        /usr/lib/golang/src/runtime/netpoll_epoll.go:123 +0x363
runtime.findrunnable(0xc00005f800, 0x0)
        /usr/lib/golang/src/runtime/proc.go:2126 +0xc60
runtime.schedule()
        /usr/lib/golang/src/runtime/proc.go:2520 +0x2fc
runtime.park_m(0xc0005a2300)
        /usr/lib/golang/src/runtime/proc.go:2690 +0x9d
runtime.mcall(0x800000)
        /usr/lib/golang/src/runtime/asm_amd64.s:318 +0x5b
[lots and lots more]

With just 1, behavior is inconsistent:

$ ./bin/podman exec --preserve-fds=1 -i test date
Wed Jun 17 17:08:50 UTC 2020
Error: read /home/esm/.local/share/containers/storage/overlay-containers/3e96d0911deb459b8549fcc31b0124a13d18340b5dfbcc7c68791723acc0696c/userdata/bb1ef4c6c8a7b4ab51338ec78fe8f5696cdf3d36a3b00665d5bb229cb2801933/exit/3e96d0911deb459b8549fcc31b0124a13d18340b5dfbcc7c68791723acc0696c: bad file descriptor

or

$ ./bin/podman exec --preserve-fds=1 -i test date
Wed Jun 17 17:09:09 UTC 2020
2020/06/17 11:09:09 bolt.Close(): funlock error: bad file descriptor
ERRO[0000] failed to close libpod db: "db file close: close /home/esm/.local/share/containers/storage/libpod/bolt_state.db: bad file descriptor"

or sometimes even no error at all

$ ./bin/podman exec --preserve-fds=1 -i test date
Wed Jun 17 17:09:10 UTC 2020

master @ f293606

@mheon mheon added the kind/bug Categorizes issue or PR as related to a bug. label Jun 17, 2020
@QiWang19
Copy link
Contributor

QiWang19 commented Jun 18, 2020

Is the same issue appearing again? #5769

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Jul 20, 2020

@edsantiago @QiWang19 Is this still an issue?

@edsantiago
Copy link
Member Author

Still present in 17f9b80

@edsantiago
Copy link
Member Author

Still present

@edsantiago
Copy link
Member Author

edsantiago commented Jul 28, 2020

Even simpler:

$ ./bin/podman run --preserve-fds=2 alpine date
runtime: epollwait on fd 4 failed with 9
fatal error: runtime: netpoll failed

@rhatdan
Copy link
Member

rhatdan commented Jul 28, 2020

ls /proc/self/fd
0 1 2 3

int fd_is_valid(int fd)
{
return fcntl(fd, F_GETFD) != -1 || errno != EBADF;
}

@QiWang19 QiWang19 linked a pull request Aug 3, 2020 that will close this issue
@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 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 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. stale-issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants