Date: Mon, 15 Nov 1999 00:05:46 -0800 (PST) From: dlowe@pootpoot.com To: freebsd-gnats-submit@freebsd.org Subject: misc/14895: portmap bug (when run with -v flag) Message-ID: <19991115080546.8E46B14C97@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 14895 >Category: misc >Synopsis: portmap bug (when run with -v flag) >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Nov 15 00:10:01 PST 1999 >Closed-Date: >Last-Modified: >Originator: J. David Lowe >Release: 3.0-RELEASE >Organization: pootpoot >Environment: FreeBSD bertha.pootpoot.com 3.0-RELEASE FreeBSD 3.0-RELEASE #3: Sun Oct 31 16:21:08 PST 1999 dlowe@bertha.pootpoot.com:/usr/src/sys/compile/BERTHA i386 >Description: 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. >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. >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 $" *** pmap_check.c.original Sun Nov 14 23:36:54 1999 --- pmap_check.c Sun Nov 14 23:42:07 1999 *************** *** 242,248 **** if (prognum == 0) { progname = ""; ! } else if ((rpc = getrpcbynumber((int) prognum))) { progname = rpc->r_name; } else { sprintf(progname = progbuf, "%lu", prognum); --- 242,250 ---- if (prognum == 0) { progname = ""; ! /* Ironically, it's not safe to call getrpcbynumber() when ! * verboselog is true, resulting in less verbose logs. */ ! } else if ((! verboselog) && ((rpc = getrpcbynumber((int) prognum)))) { progname = rpc->r_name; } else { sprintf(progname = progbuf, "%lu", prognum); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991115080546.8E46B14C97>