From nobody@FreeBSD.org  Fri Oct 29 00:28:41 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 51A9516A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 29 Oct 2004 00:28:41 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 25AA143D1F
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 29 Oct 2004 00:28:41 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i9T0SesQ060360
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 29 Oct 2004 00:28:40 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id i9T0SeIM060359;
	Fri, 29 Oct 2004 00:28:40 GMT
	(envelope-from nobody)
Message-Id: <200410290028.i9T0SeIM060359@www.freebsd.org>
Date: Fri, 29 Oct 2004 00:28:40 GMT
From: "J. Porter Clark" <jpc@drum.msfc.nasa.gov>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Suspending su sometimes hangs
X-Send-Pr-Version: www-2.3

>Number:         73261
>Category:       bin
>Synopsis:       Suspending su(1) sometimes hangs
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jilles
>State:          feedback
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 29 00:30:33 GMT 2004
>Closed-Date:    
>Last-Modified:  Sun Apr 06 11:42:48 UTC 2014
>Originator:     J. Porter Clark
>Release:        5.3-STABLE
>Organization:
NASA MSFC
>Environment:
FreeBSD hammer.msfc.nasa.gov 5.3-STABLE FreeBSD 5.3-STABLE #0: Thu Oct 28 08:40:49 CDT 2004     jpc@hammer.msfc.nasa.gov:/usr/obj/usr/src/sys/HAMMER  i386
>Description:
If I run "su", then enter "suspend", sometimes the terminal becomes nonresponsive.  The same thing happens if I su to my own userid.  I have not seen it happen by running "csh" instead.  This is on a fast SMP machine.

The problem rarely happens when I'm tracing su, but here's what it looks like when it does:
(output of strace)
sigprocmask(SIG_BLOCK, NULL, [INT])     = 0
sigprocmask(SIG_BLOCK, [], [STOP CONT CHLD WINCH]) = 0
sigprocmask(SIG_SETMASK, [], [])        = 0
close(0)                                = -1 EBADF (Bad file descriptor)
dup(19)                                 = 0
fcntl(0, F_SETFD, 0)                    = 0
close(1)                                = -1 EBADF (Bad file descriptor)
dup(17)                                 = 1
fcntl(1, F_SETFD, 0)                    = 0
close(2)                                = -1 EBADF (Bad file descriptor)
dup(18)                                 = 2
fcntl(2, F_SETFD, 0)                    = 0
syscall_416(0x12, 0xbfbfa4f0, 0xbfbfa4d0) = 0
kill(0, SIGTSTP

Yes, it stops right there, with the cursor right at the end of the P.
If I kill the su PID, it picks up:
)                        = 0
--- SIGHUP (Hangup) ---
--- SIGHUP (Hangup) ---
--- SIGTERM (Terminated) ---
sigprocmask(SIG_BLOCK, [], [])          = 0

and it starts writing out root's csh .history file.

When hung, ps axlww looks like this:

  UID   PID  PPID CPU PRI NI   VSZ  RSS MWCHAN STAT  TT       TIME COMMAND
    0 65182 57246   0   8  0  1600 1284 wait   S     p1    0:00.01 /usr/bin/su
    0 65183 65182   0  96  0  2288 1800 -      T+    p1    0:00.03 _su (csh)


>How-To-Repeat:
Run "su".  Then enter "suspend."  Sometimes I get a shell prompt back, sometimes I don't get anything.  If I don't, control-C, etc., doesn't clear the condition, although I do get character echo.  Killing su from another tty works.  If you do get a shell prompt back, enter "fg" and repeat "suspend" again.  About half the time, I get the hanging condition.
>Fix:
Unknown.      
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-i386->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Oct 30 06:25:45 GMT 2004 
Responsible-Changed-Why:  
This does not sound i386-specific. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=73261 
State-Changed-From-To: open->feedback 
State-Changed-By: jilles 
State-Changed-When: Sun Apr 6 11:40:55 UTC 2014 
State-Changed-Why:  
Does this problem still occur? 
I think the combination of r153964, r153966 and r153985 should fix this. 
All these are from 2006. 


Responsible-Changed-From-To: freebsd-bugs->jilles 
Responsible-Changed-By: jilles 
Responsible-Changed-When: Sun Apr 6 11:40:55 UTC 2014 
Responsible-Changed-Why:  
Track replies. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=73261 
>Unformatted:
