Object required exception during serialization of an abstract Object (script: Tests-Units/Variables/assignations-tests.abstrasy)

Bug #1003896 reported by Luc Bruninx
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
abstrasy
Fix Released
Critical
Luc Bruninx
1.0
Fix Released
Critical
Luc Bruninx

Bug Description

The unit testing script Abstrasy-Exemples/exemples/Tests-Units/Variables/assignations-tests.abstrasy finish with error at the line #682:

Log:

### NEW INTERPRETER INSTANCE STARTING...
  #
  # SUPERVISOR-THREAD -> register Thread[__Supervisor__,6,main]
  #
  # PARSING:
  # . Parsing source code : 13480 characters...
  # . Parsing time : 25ms.
  # . Generate AST of 2097 nodes:
       . (
       . (display "Données primitives:")
       . (display "-------------------")
       . (display)
       . (display "Affectations NUMBER:")
       . (display "-------------------")
       . (perform 'Code {
       . (define 'x 10)
       . (define 'y 10)
       . (set! y 11)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x 10)
       . (define 'y x)
       . (set! y 11)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x 10)
       . (define 'y (deref x))
       . (set! y 11)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'X 10)
       . (define 'y X)
       . (set! y 11)
       . (display Code)
       . (display "X=" X)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (display "Affectations NUMBER: (post-affectation par set!)")
       . (perform 'Code {
       . (define 'x 10)
       . (define 'y)
       . (set! y x)
       . (incr! y)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x 10)
       . (define 'y)
       . (set! y (deref x))
       . (incr! x)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'X 10)
       . (define 'y)
       . (set! y X)
       . (incr! y)
       . (display Code)
       . (display "X=" X)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (display)
       . (display "Affectations STRING:")
       . (display "-------------------")
       . (perform 'Code {
       . (define 'x "toto")
       . (define 'y "toto")
       . (set! y "taty")
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x "toto")
       . (define 'y x)
       . (set! y "taty")
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x "toto")
       . (define 'y (deref x))
       . (set! y "taty")
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'X "toto")
       . (define 'y X)
       . (set! y "taty")
       . (display Code)
       . (display "X=" X)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (display "Utilisations de fonctions statiques:")
       . (perform 'Code {
       . (define 'x "toto")
       . (define 'y "toto")
       . (store! "a" in y at 1)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x "toto")
       . (define 'y x)
       . (store! "a" in y at 1)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x "toto")
       . (define 'y (deref x))
       . (store! "a" in y at 1)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'X "toto")
       . (define 'y X)
       . (store! "a" in y at 1)
       . (display Code)
       . (display "X=" X)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (display "Affectations STRING: (post-affectation par set!)")
       . (perform 'Code {
       . (define 'x "toto")
       . (define 'y)
       . (set! y "toto")
       . (store! "a" in y at 1)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x "toto")
       . (define 'y)
       . (set! y x)
       . (store! "a" in y at 1)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x "toto")
       . (define 'y)
       . (set! y (deref x))
       . (store! "a" in y at 1)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'X "toto")
       . (define 'y)
       . (set! y X)
       . (store! "a" in y at 1)
       . (display Code)
       . (display "X=" X)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (display)
       . (display "Données composites:")
       . (display "-------------------")
       . (display)
       . (display "Affectations LIST:")
       . (display "-----------------")
       . (perform 'Code {
       . (define 'x [1 2 3])
       . (define 'y [1 2 3])
       . (set! y [4 5 6])
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x [1 2 3])
       . (define 'y x)
       . (set! y [4 5 6])
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x [1 2 3])
       . (define 'y (deref x))
       . (set! y [4 5 6])
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x [1 2 3])
       . (define 'y (clone x))
       . (set! y [4 5 6])
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'X [1 2 3])
       . (define 'y X)
       . (set! y [4 5 6])
       . (display Code)
       . (display "X=" X)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (display "Utilisation de fonctions statiques:")
       . (perform 'Code {
       . (define 'x [1 2 3])
       . (define 'y [4 5 6])
       . (set! (@ y 1) 88)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x [1 2 3])
       . (define 'y x)
       . (set! (@ y 1) 88)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x [1 2 3])
       . (define 'y (deref x))
       . (set! (@ y 1) 88)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x [1 2 3])
       . (define 'y (clone x))
       . (set! (@ y 1) 88)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'X [1 2 3])
       . (define 'y X)
       . (set! (@ y 1) 88)
       . (display Code)
       . (display "X=" X)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x [1 2 3])
       . (define 'y [4 5 6])
       . (append! 88 to y)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x [1 2 3])
       . (define 'y x)
       . (append! 88 to y)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x [1 2 3])
       . (define 'y (deref x))
       . (append! 88 to y)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x [1 2 3])
       . (define 'y (clone x))
       . (append! 88 to y)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'X [1 2 3])
       . (define 'y X)
       . (append! 88 to y)
       . (display Code)
       . (display "X=" X)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (display "Affectations LIST: (post-affectation par set!)")
       . (perform 'Code {
       . (define 'x [1 2 3])
       . (define 'y)
       . (set! y [4 5 6])
       . (set! (@ y 1) 88)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x [1 2 3])
       . (define 'y)
       . (set! y x)
       . (set! (@ y 1) 88)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x [1 2 3])
       . (define 'y)
       . (set! y (deref x))
       . (set! (@ y 1) 88)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x [1 2 3])
       . (define 'y)
       . (set! y (clone x))
       . (set! (@ y 1) 88)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'X [1 2 3])
       . (define 'y)
       . (set! y X)
       . (set! (@ y 1) 88)
       . (display Code)
       . (display "x=" X)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x [1 2 3])
       . (define 'y)
       . (set! y [4 5 6])
       . (append! 88 to y)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x [1 2 3])
       . (define 'y)
       . (set! y x)
       . (append! 88 to y)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x [1 2 3])
       . (define 'y)
       . (set! y (deref x))
       . (append! 88 to y)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x [1 2 3])
       . (define 'y)
       . (set! y (clone x))
       . (append! 88 to y)
       . (display Code)
       . (display "x=" x)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'X [1 2 3])
       . (define 'y)
       . (set! y X)
       . (append! 88 to y)
       . (display Code)
       . (display "x=" X)
       . (display "y=" y)
       . }
       . )
       . (display)
       . (display)
       . (display "Affectations OBJECT:")
       . (perform 'Code {
       . (define 'x (new Object))
       . (x:set! "toto")
       . (define 'y (new Object))
       . (y:set! "taty")
       . (display Code)
       . (display "(x:get)=" (x:get))
       . (display "(y:get)=" (y:get))
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x (new Object))
       . (x:set! "toto")
       . (define 'y x)
       . (y:set! "taty")
       . (display Code)
       . (display "(x:get)=" (x:get))
       . (display "(y:get)=" (y:get))
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x (new Object))
       . (x:set! "toto")
       . (define 'y (deref x))
       . (y:set! "taty")
       . (display Code)
       . (display "(x:get)=" (x:get))
       . (display "(y:get)=" (y:get))
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x (new Object))
       . (x:set! "toto")
       . (define 'y (clone x))
       . (y:set! "taty")
       . (display Code)
       . (display "(x:get)=" (x:get))
       . (display "(y:get)=" (y:get))
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'X (new final Object using {:set! "toto"}))
       . (define 'y X)
       . (y:set! "taty")
       . (display Code)
       . (display "(X:get)=" (X:get))
       . (display "(y:get)=" (y:get))
       . }
       . )
       . (display)
       . (display "Affectations OBJECT: (post-affectation par set!)")
       . (perform 'Code {
       . (define 'x (new Object))
       . (x:set! "toto")
       . (define 'y)
       . (set! y (new Object))
       . (y:set! "taty")
       . (display Code)
       . (display "(x:get)=" (x:get))
       . (display "(y:get)=" (y:get))
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x (new Object))
       . (x:set! "toto")
       . (define 'y)
       . (set! y x)
       . (y:set! "taty")
       . (display Code)
       . (display "(x:get)=" (x:get))
       . (display "(y:get)=" (y:get))
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x (new Object))
       . (x:set! "toto")
       . (define 'y)
       . (set! y (deref x))
       . (y:set! "taty")
       . (display Code)
       . (display "(x:get)=" (x:get))
       . (display "(y:get)=" (y:get))
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'x (new Object))
       . (x:set! "toto")
       . (define 'y)
       . (set! y (clone x))
       . (y:set! "taty")
       . (display Code)
       . (display "(x:get)=" (x:get))
       . (display "(y:get)=" (y:get))
       . }
       . )
       . (display)
       . (perform 'Code {
       . (define 'X (new final Object using {:set! "toto"}))
       . (define 'y)
       . (set! y X)
       . (y:set! "taty")
       . (display Code)
       . (display "(X:get)=" (X:get))
       . (display "(y:get)=" (y:get))
       . }
       . )
       . (display)
       . (display)
       . (display "Test d\'intégrité sur une fonction")
       . (display "---------------------------------")
       . (display)
       . (display "Affectations FUNCTION:")
       . (function 'fx {
       . (define 'x [1 2 3])
       . (display "x = " x)
       . (set! (@ x 1) 88)
       . (display "x = " x)
       . }
       . )
       . (display fx)
       . (fx)
       . (display fx)
       . (fx)
       . (display)
       . (display)
       . (display)
       . (display "Test de portée et d\'intégritée référentielle des objets et primitifs dans les listes")
       . (display "====================================================================================")
       . (display)
       . (perform 'Code {
       . (define 'l0 [1 (new Object) 2 (new Object)])
       . ((@ l0 1) ':set! "toto")
       . (define 'l1 (reverse l0))
       . ((@ l1 0) ':set! "taty")
       . (set! (@ l1 3) 1000)
       . (display Code)
       . (display "l0=" (serialize l0))
       . (display "l1=" (serialize l1))
       . }
       . )
       . (display "Le déréférencement des primitifs entraîne leur dupplication, par contre les objets")
       . (display "sont simplement liés.")
       . (display)
       . (display)
       . )
  #
  # RUNNING AST:
  # Try direct cloning...
  # Try direct cloning...
  # Try direct cloning...
  # Try direct cloning...
  # Try direct cloning...
  # Try direct cloning...
  # Try direct cloning...
  # ERROR: abstrasy.interpreter.InterpreterException: @000675> Trace: (perform 'Code{ ...
@000682> Trace: (display "l0=" (serialize l0)) ...
@000001> Trace: (:set! "toto")
@000001> Object required
  #
  # Resource Counters :
  # ------------------------:--------------------------
  # Heaps : maximum use of : 9
  # : created : 6
  # : reused : 215
  # : cleared : 172
  # ------------------------:--------------------------
  # Nodes : created : 4403
  # : cloned : 501
  #
  #
  # SUPERVISOR-THREAD -> consume shutdown hooks.
  # SUPERVISOR-THREAD -> emptying list of messages.
  # SUPERVISOR-THREAD -> emptying list of signals.
  # SUPERVISOR-THREAD -> unregister Thread[__Supervisor__,6,main]
  # SUPERVISOR-THREAD -> END.

Native Exception:
abstrasy.interpreter.InterpreterException: Object required
        at abstrasy.Heap.require_VObject_(Heap.java:437)
        at abstrasy.Heap.get_uo_(Heap.java:679)
        at abstrasy.Heap.getAlways_uo_(Heap.java:829)
        at abstrasy.Heap._getv_(Heap.java:1060)
        at abstrasy.Heap.getv(Heap.java:1094)
        at abstrasy.Node.getSymbolicValue_(Node.java:2263)
        at abstrasy.Node.eval_q(Node.java:4629)
        at abstrasy.Node.exec_q(Node.java:2394)
        at abstrasy.Node.exec_q_evalArgs_(Node.java:2323)
        at abstrasy.Node.exec_q(Node.java:2534)
        at abstrasy.Node.exec_q_evalArgs_(Node.java:2323)
        at abstrasy.Node.exec_q(Node.java:2372)
        at abstrasy.Node.exec(Node.java:2577)
        at abstrasy.interpreter.ContextualCall.call(ContextualCall.java:32)
        at abstrasy.Node.evalFxInstanceFromObject_unsafe(Node.java:3476)
        at abstrasy.Node.access$700(Node.java:47)
        at abstrasy.Node$VObject.evalMethod(Node.java:3679)
        at abstrasy.Node.nodeToSerializedString(Node.java:1794)
        at abstrasy.Node.nodeToSerializedString(Node.java:1737)
        at abstrasy.Node.nodeToSerializedString(Node.java:1894)
        at abstrasy.Node.nodeToSerializedString(Node.java:1737)
        at abstrasy.Node.toSerialized(Node.java:1727)
        at abstrasy.pcfx.PCFx_serialize.eval(PCFx_serialize.java:47)
...

Revision history for this message
Luc Bruninx (luc2005) wrote :
Changed in abstrasy:
status: New → Confirmed
Revision history for this message
Luc Bruninx (luc2005) wrote :

If we change the call process in ContextualCall.call() and ContextualCall.call_unary() to force the refreshing of SELF.

Revision history for this message
Luc Bruninx (luc2005) wrote :

--- ContextualCall.java Thu May 24 14:02:25 2012
+++ ContextualCall.java Thu May 24 14:02:25 2012
@@ -8 +8,2 @@
- Node callback = null;
+ Node symbol;
+ Node object;
@@ -10,2 +11,3 @@
- public ContextualCall(Node call) {
- this.callback = call;
+ public ContextualCall(Node object, String symbol) {
+ this.symbol = Node.createSymbol(symbol);
+ this.object = object;
@@ -14,8 +15,0 @@
- public void setCallback(Node call) {
- this.callback = call;
- }
-
- public Node getCallback() {
- return callback;
- }
-
@@ -29 +23 @@
- Node expr=Node.createExpr().append(callback);
+ Node expr=Node.createExpr().append(symbol);
@@ -31,2 +25,5 @@
- //System.out.println("objH:"+this.callback.getObjHeap());
- return expr.exec(true);
+ Heap.push();
+ Heap.setSELF(object);
+ Node result=expr.exec(true);
+ Heap.pull();
+ return result;
@@ -46 +43 @@
- Node expr=Node.createExpr().append(callback);
+ Node expr=Node.createExpr().append(symbol);
@@ -48 +45,5 @@
- return expr.exec(true);
+ Heap.push();
+ Heap.setSELF(object);
+ Node result=expr.exec(true);
+ Heap.pull();
+ return result;
@@ -63 +64 @@
- return new ContextualCall(Heap.gets(vObject,symbole));
+ return new ContextualCall(vObject,symbole);

Revision history for this message
Luc Bruninx (luc2005) wrote :

Fix commited for revision 6335.0.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.