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

 
 

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

Submitted by:  Dean Ferreyra <dferreyra>
Submitted on:  Tue 09 Aug 2005 10:23:59 PM UTC  
 
Category: Scheme librarySeverity: 3 - Normal
Item Group: Run-time exceptionStatus: Fixed
Privacy: PublicAssigned to: Per Bothner <bothner>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project AdministratorIn charge of this item.
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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 4 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Wed 10 Aug 2005 07:00:32 AM UTCbothnerCategoryNone=>Scheme library
  StatusNone=>Fixed
  Assigned toNone=>bothner
  Open/ClosedOpen=>Closed

Back to the top


Powered by Savane 3.1-cleanup1