Subject: Re: kern/28952
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Matthew Mondor <mm_lists@pulsar-zone.net>
List: netbsd-bugs
Date: 08/10/2005 09:08:01
The following reply was made to PR kern/28952; it has been noted by GNATS.

From: Matthew Mondor <mm_lists@pulsar-zone.net>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/28952
Date: Wed, 10 Aug 2005 05:07:17 -0400

 An extremely ugly hack, which doesn't solve the problem at all, but
 which at least allows the box to remain up :)
 
 
 --- uvm_amap.c  2005-08-10 04:59:39.000000000 -0400
 +++ /tmp/uvm_amap.c     2005-08-10 04:59:28.000000000 -0400
 @@ -1154,8 +1154,25 @@
                         len = stopslot - lcv;
                 }
                 ref += adjval;
 -               if (ref < 0)
 -                       panic("amap_pp_adjref: negative reference count");
 +
 +               /*
 +                * XXX Negative reference counts shouldn't happen, and this
 +                * section used to cause a panic if it happens.
 +                * However, we want to avoid those annoying crashes,
 +                * noone seems to know why they happen yet apparently,
 +                * but they do when running amule after approximately 3-5
 +                * days of uptime.  This avoids the panics and the system
 +                * at least remains up.  Obviously, it could cause other
 +                * side effects, but considering that negative reference
 +                * counts do happen, and that I can't fix this condition
 +                * for the moment, this seems more reasonable for now for
 +                * the stable branch.
 +                */
 +               if (ref < 0) {
 +                       (void) printf("amap_pp_adjref: negative reference "
 +                           "count (%d)", ref);
 +                       ref = 0;
 +               }
 +
                 if (lcv == prevlcv + prevlen && ref == prevref) {
                         pp_setreflen(ppref, prevlcv, ref, prevlen + len);
                 } else {
 
 
 Matt
 
 -- 
 Note: Please only reply on the list, other mail is blocked by default.
 Private messages from your address can be allowed by first asking.