<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>119890</bug_id>
          
          <creation_ts>2006-01-22 00:55 0000</creation_ts>
          <short_desc>Procmail&apos;s formail incorrectly implements maxprocs</short_desc>
          <delta_ts>2006-05-12 00:05:08 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Applications</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>ahbritto@iat.com</reporter>
          <assigned_to>net-mail@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>ahbritto@iat.com</who>
            <bug_when>2006-01-22 00:55:10 0000</bug_when>
            <thetext>Procmail&apos;s formail command&apos;s &quot;-n X&quot; creates too many jobs.  This can hang the machine by: (1) causing processess to be killed due to out of memory errors, (2) causing thrashing by forcing jobs to swap, (3) prevent new processes from spawning.

Steps to reproduce:
In a window:
watch -n .1 pgrep &apos;[s]leep&apos;

In another window:
formail -n 2 -s sleep 2 &lt; AN_MBOX_WITH_AT_LEAST_10_MESSAGES

Actual results: more than two processes show up in watch command.

Expected results: two processes show up at most in watch command.

Procmail version:
mail-filter/procmail-3.22-r7</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ahbritto@iat.com</who>
            <bug_when>2006-01-22 00:59:18 0000</bug_when>
            <thetext>Created an attachment (id=77783)
Fix for bug.

Obvious fix.

Previously, each time there were too many children, the code would allow one more child to be created the next time there were too many children.

This fix removes the extra decrement on a variable containing the number of outstanding children.  Such that, a decrement only occurs once per child reaped.

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ferdy@gentoo.org</who>
            <bug_when>2006-05-12 00:05:08 0000</bug_when>
            <thetext>Done, thanks and sorry for the looooong delay.

- ferdy</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>77783</attachid>
            <date>2006-01-22 00:59 0000</date>
            <desc>Fix for bug.</desc>
            <filename>procmail_formail_maxprocs_fix.diff</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIHNyYy9mb3JtaXNjLmMub3JpZwkyMDA2LTAxLTIyIDAwOjM1OjMwLjAwMDAwMDAwMCAtMDgw
MAorKysgc3JjL2Zvcm1pc2MuYwkyMDA2LTAxLTIyIDAwOjM1OjU1LjAwMDAwMDAwMCAtMDgwMApA
QCAtMTgzLDcgKzE4Myw3IEBACiAJCSByZXR2YWw9ZXhjb2RlOwogCSAgICB9CQkJCQkgICAgICAg
LyogcmVhcCBzb21lIGNoaWxkcmVuICovCiAJd2hpbGUoY2hpbGRsaW1pdCYmY2hpbGRyZW4+PWNo
aWxkbGltaXR8fChjaGlsZD1mb3JrKCkpPT0tMSYmY2hpbGRyZW4pCi0JICAgZm9yKC0tY2hpbGRy
ZW47KGV4Y29kZT13YWl0Zm9yKChwaWRfdCkwKSkhPU5PX1BST0NFU1M7KQorCSAgIGZvcig7KGV4
Y29kZT13YWl0Zm9yKChwaWRfdCkwKSkhPU5PX1BST0NFU1M7KQogCSAgICB7IGlmKGV4Y29kZSE9
RVhJVF9TVUNDRVNTKQogCQkgcmV0dmFsPWV4Y29kZTsKIAkgICAgICBpZigtLWNoaWxkcmVuPD1t
YXhjaGlsZCkK
</data>        

          </attachment>
    </bug>

</bugzilla>