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

[bug] exec with -u nouser hang #1151

Closed
Letty5411 opened this issue Apr 17, 2018 · 2 comments · Fixed by #1605
Closed

[bug] exec with -u nouser hang #1151

Letty5411 opened this issue Apr 17, 2018 · 2 comments · Fixed by #1605
Assignees
Labels
kind/bug This is bug report for project priority/P2

Comments

@Letty5411
Copy link
Contributor

Ⅰ. Issue Description

pouch exec -u admin hangs when there is no user admin.

Ⅱ. Describe what happened

#pouch run -d busybox sleep 100000e17ebb8a2f9487aa30b62982739e337b594029953dfc3f5bc0700ef0bcc5fecf


#pouch inspect e17ebb8a2f9487aa30b62982739e337b594029953dfc3f5bc0700ef0bcc5fecf|grep -i user
#pouch exec -u admin e17ebb8a2f9487aa30b62982739e337b594029953dfc3f5bc0700ef0bcc5fecf  dd if=/dev/zero of=/tmp/test/test/test bs=1024k count=1 &
[2] 35410

#pouch inspect e17ebb8a2f9487aa30b62982739e337b594029953dfc3f5bc0700ef0bcc5fecf|grep -i user
            "User": "admin"

#cat /proc/35410/stack
[<ffffffff810e1f65>] futex_wait_queue_me+0xc5/0x130
[<ffffffff810e2ae9>] futex_wait+0x179/0x280
[<ffffffff810e4b7e>] do_futex+0xfe/0x5b0
[<ffffffff810e50b0>] SyS_futex+0x80/0x180
[<ffffffff81646489>] system_call_fastpath+0x16/0x1b
[<ffffffffffffffff>] 0xffffffffffffffff

#pouch run -d busybox sleep 100000c7ca0c9cefaeb31e6ab9a975dc043bf999b6abe66383633544823b13cb0aafa5

#pouch exec c7ca0c9cefaeb31e6ab9a975dc043bf999b6abe66383633544823b13cb0aafa5 cat /etc/passwd
root:x:0:0:root:/root:/bin/sh
daemon:x:1:1:daemon:/usr/sbin:/bin/false
bin:x:2:2:bin:/bin:/bin/false
sys:x:3:3:sys:/dev:/bin/false
sync:x:4:100:sync:/bin:/bin/sync
mail:x:8:8:mail:/var/spool/mail:/bin/false
www-data:x:33:33:www-data:/var/www:/bin/false
operator:x:37:37:Operator:/var:/bin/false
nobody:x:65534:65534:nobody:/home:/bin/false

Ⅲ. Describe what you expected to happen

Ⅳ. How to reproduce it (as minimally and precisely as possible)

Ⅴ. Anything else we need to know?

Ⅵ. Environment:

  • pouch version (use pouch version):
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:
@pouchrobot pouchrobot added the kind/bug This is bug report for project label Apr 17, 2018
@Ace-Tang
Copy link
Contributor

The bug is not cause by user not exist, root cause is exec process can not exited when exec got error.

@Ace-Tang
Copy link
Contributor

when daemon deal with exec process get error, process will get stuck,
since http connection has been hijacked, it won't finish and return
with error message. Fix it by write error message into hijacked
connection, close io when process get error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This is bug report for project priority/P2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants