Hi Gang,

Alert user Todd Bowers recently reported a bug in Jess which could
repeatably elicit the quixotic error message 'Corrupted negcnt (< 0)'
from Jess 4.1. He provided a small example program that would cause
the error message to appear, and (thankfully) some of his observations
about trying to reproduce it. In any case, the bug turned out  to be
in the function 'retract' when it is applied to a
definstance. 'retract' would actually call 'undefinstance', which
would call the internal version of 'retract'; but then 'retract' would
call this internal form too. This caused no harm (except a bit of
inefficiency, I suppose) unless the definstance in question was
matched on the LHS of a rule in a 'not' CE. The double-retract would
then cause the error message to appear.

Anyhow, this fix will be in the 4.1.1 release, when that appears. For
now, the patch is incredibly simple. In jess/Funcall.java, near line
486:

                {
                    Fact fact = new Fact(f, engine);
                    Value ov = fact.findValue("OBJECT");
                    Funcall fc = new Funcall("undefinstance", engine);
                    fc.add(ov);
                    Funcall.simpleExecute(fc, engine.globalContext());
                    return Funcall.s_true; /// <<<--- ADD THIS LINE
                }

Thanks very much, Todd. This error was reported once before, by Lars
Rasmussen, I believe, but he wasn't able to zero in on it for me.

---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (510) 294-2154
Sandia National Labs                FAX:   (510) 294-2234
Org. 8920, MS 9214                  [EMAIL PROTECTED]
PO Box 969                  http://herzberg.ca.sandia.gov
Livermore, CA 94550

---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to