From fenner@parc.xerox.com  Mon Feb 16 23:50:49 1998
Received: from alpha.xerox.com (firewall-user@alpha.Xerox.COM [13.1.64.93])
          by hub.freebsd.org (8.8.8/8.8.8) with SMTP id XAA27263
          for <FreeBSD-gnats-submit@freebsd.org>; Mon, 16 Feb 1998 23:50:49 -0800 (PST)
          (envelope-from fenner@parc.xerox.com)
Received: from fenestro.parc.xerox.com ([13.0.208.199]) by alpha.xerox.com with SMTP id <51891(3)>; Mon, 16 Feb 1998 23:50:44 PST
Received: (from fenner@localhost)
          by fenestro.parc.xerox.com (8.8.5/8.8.4)
	  id XAA07143; Mon, 16 Feb 1998 23:50:49 -0800 (PST)
Message-Id: <199802170750.XAA07143@fenestro.parc.xerox.com>
Date: Mon, 16 Feb 1998 23:50:49 PST
From: Bill Fenner <fenner@parc.xerox.com>
Reply-To: fenner@parc.xerox.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: man leaves partially formatted cat pages when fork fails
X-Send-Pr-Version: 3.2

>Number:         5767
>Category:       gnu
>Synopsis:       man leaves partially formatted cat pages when fork fails
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    phantom
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 17 00:00:01 PST 1998
>Closed-Date:    Mon Apr 24 05:14:08 PDT 2000
>Last-Modified:  Mon Apr 24 05:15:00 PDT 2000
>Originator:     Bill Fenner
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
Xerox
>Environment:

Some limited number of processes.

>Description:

man can fail to format a man page, but not notice:

% man rs
Formatting page, please wait.../usr/bin/groff:fatal error: fork: Resource temporarily unavailable
Done.
%

It then puts this "formatted" page in /usr/share/man/cat1:

-rw-r--r--  1 man  bin  20 Feb 16 23:37 /usr/share/man/cat1/rs.1.gz

and there's no obvious way to make man use the original source if the
cat file exists and is newer.  I ended up removing the cat file as root,
but if I wasn't root I'd be helpless to read this man page even after
exiting some processes.

>How-To-Repeat:

Run "man" when you're near your process limit.

>Fix:
	
There are two things to fix:
1. Make man notice failures like this.  This presumably requires not using
   popen().
2. Add a switch to force formatting from source even if the cat page exists.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: phantom 
State-Changed-When: Tue Dec 28 04:56:17 PST 1999 
State-Changed-Why:  
Problem fixed in -CURRENT (src/gnu/usr.bin/man/man/man.c rev. 1.37) 


Responsible-Changed-From-To: freebsd-bugs->phantom 
Responsible-Changed-By: phantom 
Responsible-Changed-When: Tue Dec 28 04:56:17 PST 1999 
Responsible-Changed-Why:  
I'll remember to MFC. 
State-Changed-From-To: feedback->suspended 
State-Changed-By: asmodai 
State-Changed-When: Sat Feb 5 03:04:17 PST 2000 
State-Changed-Why:  
Awaiting MFC, tests indicate the fixes worked. 
State-Changed-From-To: suspended->closed 
State-Changed-By: phantom 
State-Changed-When: Mon Apr 24 05:14:08 PDT 2000 
State-Changed-Why:  
MFC'ed. Thanks for report! 
>Unformatted:
