> I would like to know the cause and general pattern that lead to 
> crash so that I can workaround it in J601 code.

See the msg appended below.



----- Original Message -----
From: bill lam <[EMAIL PROTECTED]>
Date: Monday, November 26, 2007 7:55
Subject: [Jgeneral] lock script crash in J601
To: General forum <[email protected]>

> The crash report mentioned in
> http://www.jsoftware.com/pipermail/programming/2006-
> November/004145.htmlwas fixed in J602 beta.  However I 
> found a similar crash in J601
> 
> NB. =========================================================
> cs=: 4 : 0
> a=. x ,&(<@(a.&i.)) y
> )
> 3 : 0''
> 11!:0'mb testing'
> try.
> (0$a:) (cs&>)("0) <'120'
> NB. (0$a:) ((,&(<@(a.&i.)))&>)("0) <'120'
> catch. end.
> 11!:0'mb finish'
> )
> 2!:55 [0
> NB. =========================================================
> 
> that seemed to be fixed in J602 too.
> 
> I would like to know the cause and general pattern that lead to 
> crash so that I
> can workaround it in J601 code.


____________________________________________________________

>From   Roger Hui <[EMAIL PROTECTED]> 
Sent    Tuesday, February 13, 2007 10:48 pm
To      Eric Iverson <[EMAIL PROTECTED]> 
Subject         Re: Bill Lam locked script bug

I reproduced the crash in the VC++ debugger
by resurrecting the J6.01 source and I have
solved the problem.  Actually I solved the
problem earlier today (Tuesday morning) when I
found and fixed a problem reported by Henry Rich. 
A simple demonstration of Henry's crash was:

   f=: f
   0: :. f " 0 ~ i.0

The problem was in the rank operator when it
is given a zero frame in the expression foo"r .
It does  foo f.  before proceeding, but in
this case  foo f.  is just foo itself by
the way it is defined (0: :. f  with f being
not fixable).  It led to an infinite recursion.

Likewise in the Bill Lam's example, test.ijs
and lock.ijs have the expression:

   dtb"1 (0 1$'')

This is an instance of zero frame and so it's
going to do  dtb f. .  This is not a problem in
the unlocked script but in the locked script the
result of  dtb f.  is dtb itself (can not fix a
locked verb/adv/conj else locking is compromised)
and leads to an infinite recursion and stack
overflow.  J does not handle this stack overflow
because it is not expecting there to be any
recursion in the zero frame handler of the rank
operator.  You can sometimes get an "out of memory"
error depending on where in the recursion it runs
into trouble.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to