public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Peterson <joe@skyrush.com>
To: Vegard Nossum <vegard.nossum@gmail.com>
Cc: Alan Cox <alan@redhat.com>, Alan Cox <alan@lxorguk.ukuu.org.uk>,
	David Newall <davidn@davidnewall.com>, Willy Tarreau <w@1wt.eu>,
	Harald Dunkel <harald.dunkel@t-online.de>,
	linux-kernel@vger.kernel.org
Subject: Re: 2.6.25.3: su gets stuck for root
Date: Sat, 14 Jun 2008 11:43:31 -0600	[thread overview]
Message-ID: <48540343.4010200@skyrush.com> (raw)
In-Reply-To: <19f34abd0806140045l259bcb93ie4b7bfa2d73bd4d@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1468 bytes --]

Vegard Nossum wrote:
> So this clearly shows what's wrong; 7036 is the "controlling process"
> group id. But only "su foo" is in this group, the bash and stty
> processes have their own group, 7037.
> 
> On my own system, when I do "su", I get this:
>  2891  2891  2892 root     su temp
>  2892  2892  2892 temp     bash
> 
> ...and here the "bash" process is in the right group, 2892, while "su"
> is the one in the background!

Hmm.

> Can you try to run strace on the su to see where things go wrong, i.e.
> 
>     $ strace -f -e trace=process su foo
> 
> ...and we're only interested in what happens up to the point where it
> hangs. That should hopefully tell us which process is doing the wrong
> thing. In either case, as Alan pointed out, this seems unlikely to be
> a kernel problem.

OK, I attached this as a text file at the end.  But (*bummer*), using
strace makes it impossible to reproduce the hang (figures, and I believe
someone earlier in the thread also had this problem).

As for whether the kernel is at fault, not sure (i.e. does this hang
behavior implicate the kernel automatically or can a user-space process
cause itself such an issue?).  But I *do* see different behavior
depending on the kernel version.  There were a couple of git kernels in
which I could not reproduce it.  Still, if it is a race or something, it
might be that the conditions were just slightly perturbed.

I attached the strace log just in case it is of help.

					-Joe

[-- Attachment #2: su_strace.log --]
[-- Type: text/x-log, Size: 2501 bytes --]

7009  execve("/bin/su", ["su", "foo"], [/* 32 vars */]) = 0
7009  clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7e3d708) = 7010
7010  execve("/bin/bash", ["bash"], [/* 31 vars */]) = 0
7010  clone( <unfinished ...>
7009  waitpid(-1,  <unfinished ...>
7010  <... clone resumed> child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7db0708) = 7011
7011  exit_group(0)                     = ?
7010  --- SIGCHLD (Child exited) @ 0 (0) ---
7010  waitpid(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WNOHANG) = 7011
7010  waitpid(-1, 0xbff58cec, WNOHANG)  = -1 ECHILD (No child processes)
7010  clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7db0708) = 7012
7012  clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7db0708) = 7013
7013  execve("/usr/bin/dircolors", ["dircolors", "-b", "/etc/DIR_COLORS"], [/* 31 vars */]) = 0
7013  exit_group(0)                     = ?
7012  --- SIGCHLD (Child exited) @ 0 (0) ---
7012  waitpid(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WNOHANG) = 7013
7012  waitpid(-1, 0xbff585ec, WNOHANG)  = -1 ECHILD (No child processes)
7012  exit_group(0)                     = ?
7010  waitpid(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0) = 7012
7010  --- SIGCHLD (Child exited) @ 0 (0) ---
7010  waitpid(-1, 0xbff5873c, WNOHANG)  = -1 ECHILD (No child processes)
7010  clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7db0708) = 7014
7014  execve("/bin/sleep", ["sleep", "2"], [/* 31 vars */]) = 0
7010  waitpid(-1,  <unfinished ...>
7014  exit_group(0)                     = ?
7010  <... waitpid resumed> [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0) = 7014
7010  --- SIGCHLD (Child exited) @ 0 (0) ---
7010  waitpid(-1, 0xbff593dc, WNOHANG)  = -1 ECHILD (No child processes)
7010  clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7db0708) = 7015
7015  execve("/bin/stty", ["stty", "-ixany"], [/* 31 vars */]) = 0
7015  exit_group(0)                     = ?
7010  --- SIGCHLD (Child exited) @ 0 (0) ---
7010  waitpid(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WNOHANG) = 7015
7010  waitpid(-1, 0xbff5936c, WNOHANG)  = -1 ECHILD (No child processes)
7010  exit_group(0)                     = ?
7009  <... waitpid resumed> [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WSTOPPED) = 7010
7009  exit_group(0)                     = ?

  reply	other threads:[~2008-06-14 17:43 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-02  1:31 2.6.25.3: su gets stuck for root Joe Peterson
2008-06-02  5:12 ` Harald Dunkel
2008-06-02  5:32   ` Willy Tarreau
2008-06-02  5:55     ` Joe Peterson
2008-06-02  8:10     ` Alan Cox
2008-06-02  9:01       ` David Newall
2008-06-02  9:20         ` Alan Cox
2008-06-02 10:16           ` Vegard Nossum
2008-06-02 10:39             ` Vegard Nossum
2008-06-02 10:52               ` Alan Cox
2008-06-02 10:57                 ` Vegard Nossum
2008-06-02 12:28                   ` Alan Cox
2008-06-02 14:31                     ` Vegard Nossum
2008-06-02 10:50             ` Alan Cox
2008-06-17 15:32               ` Joe Peterson
2008-06-02 15:26           ` Joe Peterson
2008-06-02 15:51             ` Alan Cox
2008-06-02 16:03               ` Joe Peterson
2008-06-04 14:43               ` Joe Peterson
2008-06-04 15:16                 ` Alan Cox
2008-06-04 16:52                   ` Joe Peterson
2008-06-04 17:10                     ` Alan Cox
2008-06-04 20:32                       ` Joe Peterson
2008-06-11 14:04                         ` Joe Peterson
2008-06-12 11:52                           ` Vegard Nossum
2008-06-14  1:49                             ` Joe Peterson
2008-06-14  7:45                               ` Vegard Nossum
2008-06-14 17:43                                 ` Joe Peterson [this message]
2008-06-14 20:34                                   ` Vegard Nossum
2008-06-14 20:52                                     ` Joe Peterson
2008-06-14 21:26                                       ` Vegard Nossum
2008-06-14 21:34                                         ` Joe Peterson
2008-07-02 18:03                                         ` tty session leader issue (was Re: 2.6.25.3: su gets stuck for root) Joe Peterson
2008-07-02 19:21                                           ` markus reichelt
2008-07-06 14:08                                           ` Tim Connors
2008-07-06 16:44                                             ` Alan Cox
2008-07-06 18:49                                             ` tty session leader issue [cause now known!] " Joe Peterson
2008-06-02  5:42   ` 2.6.25.3: su gets stuck for root Joe Peterson
  -- strict thread matches above, loose matches on Subject: below --
2008-05-13  6:17 Harald Dunkel
2008-05-13  6:47 ` Vegard Nossum
2008-05-13 17:43   ` Harald Dunkel
2008-05-13 19:46     ` Willy Tarreau
2008-05-14  4:55       ` Harald Dunkel
2008-05-14  5:46         ` Willy Tarreau
2008-05-14  7:34     ` Vegard Nossum
2008-05-14 17:05       ` Harald Dunkel
2008-05-14 17:17         ` Vegard Nossum
2008-05-14 17:35           ` Alan Cox
2008-05-18 17:56             ` Harald Dunkel
2008-05-18 17:51               ` Alan Cox
2008-05-20 19:01                 ` Harald Dunkel
2008-05-20 19:12                   ` david
2008-05-20 20:26                     ` Harald Dunkel
2008-05-20 20:38                       ` Willy Tarreau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48540343.4010200@skyrush.com \
    --to=joe@skyrush.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=alan@redhat.com \
    --cc=davidn@davidnewall.com \
    --cc=harald.dunkel@t-online.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vegard.nossum@gmail.com \
    --cc=w@1wt.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox