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

exec: "bad file descriptor" occurs in tests #1571

Closed
cyphar opened this issue Aug 24, 2017 · 1 comment · Fixed by #1575
Closed

exec: "bad file descriptor" occurs in tests #1571

cyphar opened this issue Aug 24, 2017 · 1 comment · Fixed by #1575

Comments

@cyphar
Copy link
Member

cyphar commented Aug 24, 2017

This appears to happen on random tests (sometimes in rootless sometimes in normal mode). I started noticing it a week or so ago. The error is basically just EBADF. I'll see if I can reproduce it, it seems to only happen on runc execs.

not ok 33 mask paths [directory]
# (in test file tests/integration/mask.bats, line 46)
#   `[[ "${output}" == "" ]]' failed
# runc list (status=0):
# ID          PID         STATUS      BUNDLE      CREATED     OWNER
# runc spec (status=0):
# 
# runc run -d --console-socket /tmp/console.sock test_busybox (status=0):
# 
# runc exec test_busybox ls /testdir (status=0):
# time="2017-08-24T07:59:50Z" level=error msg="bad file descriptor" 
# runc list (status=0):
# ID             PID         STATUS      BUNDLE             CREATED                          OWNER
# test_busybox   20467       running     /tmp/busyboxtest   2017-08-24T07:59:50.815627018Z   root
# runc kill test_busybox KILL (status=0):
# 
# runc delete test_busybox (status=0):
# 
@cyphar
Copy link
Member Author

cyphar commented Aug 26, 2017

Aha! I think I figured it out, this looks like it was caused by #1560 (I still need to double check this is the case). In particular, the added handling of tty.resize() could conceivably race with the stdout being closed by the terminal -- which would result in runc outputting an error message where it doesn't make sense.

In retrospect the tty.resize part of that change doesn't make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant