Bug 14895

Summary: portmap bug (when run with -v flag)
Product: Base System Reporter: dlowe <dlowe>
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.0-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description dlowe 1999-11-15 08:10:01 UTC
Under certain circumstances, portmap forks endlessly.  This was also
reported in PR misc/12607, but mistakenly listed as a ypbind() bug.

Here's the set of things that cause this problem:

portmap actually fork()s before calling getrpcbynumber() and syslog(),
to log.  Thus the main portmap process can answer requests while a
child writes log output.

When portmap is run with the -v flag, it logs every incoming request.

Under certain circumstances, getrpcent(), called several times by
getrpcbynumber(), will call _yp_check(), which in turn may call
ypbind(), which in turn talks to portmap.

Doh!

portmap eventually fills up the process table with logging children.

Fix: This is a workaround patch to pmap_check.c, not very nice because it
removes one level of verbosity from the supposedly more verbose output
of portmap -v.  However, it should prevent this from happening, and it
illustrates the problem area.  As a simpler workaround, don't run
portmap with the -v flag, or don't run NIS.  Neither solution is
perfect.  This patch is against "$Id: pmap_check.c,v 1.3 1997/10/09
07:17:11 charnier Exp $"

How-To-Repeat: /etc/rc.conf:

nisdomainname="FOO"
nis_server_enable="YES"

portmap_enable="YES"
portmap_flags="-v"

You'll need to go into single user mode in order to get the machine
back, since rc can't seem to finish with a full process table.
Comment 1 Mike Barcroft freebsd_committer freebsd_triage 2001-07-21 04:04:20 UTC
State Changed
From-To: open->feedback


Does this problem still occur in newer versions of FreeBSD, 
such as 4.3-RELEASE?
Comment 2 Mike Barcroft freebsd_committer freebsd_triage 2001-07-24 01:42:34 UTC
On Mon, Jul 23, 2001 at 03:11:31PM -0700, David Lowe wrote:
> Mike -
> 
> The latest version I have installed is 4.2-RELEASE, and the problem is
> still exactly the same and easy to duplicate, and the original patch I
> supplied (though not a great solution) still applies and fixes the
> problem, for some definition of fixes...

Would you mind trying a newer version?  PR: misc/12607, which you
reference in this PR, says it was fixed shortly after 4.2-RELEASE.

Best regards,
Mike Barcroft
Comment 3 dlowe 2001-07-24 01:45:40 UTC
Mike -

I really don't have any machines more recent than 4.2-RELEASE to play with
at the moment.  It's very predictable and easy to duplicate, if you have
access to such a machine.

I am building a new machine within the next month or so, so I will test it
again once it's done if you are unable to do so.

misc/12607 doesn't mention (in the fix) whether they explicitly ran
portmap with the -v flag in testing, nor does it explain *why* the bug
would go away under post-4.2.  So I suspect that it's just that nobody has
tried it, but would be happy to be proven wrong.

: : : J. David Lowe :: dlowe@pootpoot.com :: http://pootpoot.com : : :
::            "Oh the morning sun in all its glory                  ::
:              Greets the day with hope and comfort too              :
:              And you fill my life with laughter"                   :
::                        -Van Morrison, "Have I told you Lately"   ::
 :: fingerprint: 79 1D 66 9F 35 A1 2D ED   81 98 26 E1 F8 D5 3F 29 ::

On Mon, 23 Jul 2001, Mike Barcroft wrote:

> On Mon, Jul 23, 2001 at 03:11:31PM -0700, David Lowe wrote:
> > Mike -
> > 
> > The latest version I have installed is 4.2-RELEASE, and the problem is
> > still exactly the same and easy to duplicate, and the original patch I
> > supplied (though not a great solution) still applies and fixes the
> > problem, for some definition of fixes...
> 
> Would you mind trying a newer version?  PR: misc/12607, which you
> reference in this PR, says it was fixed shortly after 4.2-RELEASE.
> 
> Best regards,
> Mike Barcroft
>
Comment 4 Mike Barcroft freebsd_committer freebsd_triage 2001-07-26 04:35:31 UTC
On Mon, Jul 23, 2001 at 05:45:40PM -0700, David Lowe wrote:
> Mike -
> 
> I really don't have any machines more recent than 4.2-RELEASE to play with
> at the moment.  It's very predictable and easy to duplicate, if you have
> access to such a machine.
> 
> I am building a new machine within the next month or so, so I will test it
> again once it's done if you are unable to do so.
> 
> misc/12607 doesn't mention (in the fix) whether they explicitly ran
> portmap with the -v flag in testing, nor does it explain *why* the bug
> would go away under post-4.2.  So I suspect that it's just that nobody has
> tried it, but would be happy to be proven wrong.

I don't have a 4.3-RELEASE or 4.3-STABLE box available for testing
this, and 5.0-CURRENT seems to be using a new mechanism for RPC which
doesn't exhibit this behaviour.

Best regards,
Mike Barcroft
Comment 5 Sheldon Hearn freebsd_committer freebsd_triage 2002-01-18 16:14:39 UTC
State Changed
From-To: feedback->closed

Automatic feedback timeout.  If additional feedback that warrants 
the re-opening of this PR is available but not included in the 
audit trail, please include the feedback in a reply to this message 
(preserving the Subject line) and ask that the PR be re-opened.