bugKawa - Bugs: bug #14071, Problem with use of eval in a repl

 
 

bug #14071: Problem with use of eval in a repl

Submitter:  Dean Ferreyra <dferreyra>
Submitted:  Tue 09 Aug 2005 10:23:59 PM UTC
   
 
Category:  Scheme library Severity:  3 - Normal
Item Group:  Run-time exception Status:  Fixed
Privacy:  Public Assigned to:  bothner
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 10 Aug 2005 07:00:32 AM UTC, comment #1: 

I checked in a fix.
The eval methods in Language were modfied to use stackable context methods (2003-11-09, according to the ChangeLog), but the similar code in Eval.java (that takes an SExpr rather than a string) was not fixed.  Ooops.

Per Bothner <bothner>
Group administrator
Tue 09 Aug 2005 10:23:59 PM UTC, original submission:  

We have been running into a problem using Kawa interactively.  I've got it narrowed down to this simple example:

% CLASSPATH=./kawa-1.8beta.jar java kawa.repl
#|kawa:1|# (define (fn arg) (eval arg))                         
#|kawa:2|# (invoke (fn 10) 'getClass)
java.lang.ArrayIndexOutOfBoundsException: -536870912
        at gnu.mapping.CallContext.cleanupFromContext(CallContext.java:299)
        at gnu.expr.Expression.eval(Expression.java:49)
        at gnu.expr.ApplyExp.apply(ApplyExp.java:69)
        at gnu.expr.ModuleExp.evalModule(ModuleExp.java:152)
        at kawa.Shell.run(Shell.java:229)
        at kawa.Shell.run(Shell.java:172)
        at kawa.Shell.run(Shell.java:159)
        at kawa.repl.main(repl.java:744)

There seems to be a problem with how gnu.mapping.CallContext's vstack is handled.  In all the problem cases I've seen, it seems that when cleanupFromContext() restores the consumer from the vstack, the consumer is not correct.  It seems to be related to the call to ctx.vstack.clear() in kawa.lang.Eval.eval() when that call happens between calls to startFromContext() and cleanupFromContext().

This doesn't always manifest with an exception, but in the end the repl is always disrupted; sometimes results are no longer printed, sometimes there's an exception for every expression entered.

Dean Ferreyra <dferreyra>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-08-10 bothner CategoryNone Scheme library
    StatusNone Fixed
    Assigned toNone bothner
    Open/ClosedOpen Closed

Back to the top

Powered by Savane 3.13-4b48.
Corresponding source code