Project

General

Profile

Bug #10215

ant rpt fails when running only conversion.front

Added by Stefan Vieru about 1 year ago. Updated about 1 year ago.

Status:
Test
Priority:
Normal
Assignee:
Paul Bodale
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
production:
No
env_name:
topics:

Related issues

Related to Base Language - Feature #6490: DYNAMIC-INVOKE which returns an extent Closed

History

#2 Updated by Stefan Vieru about 1 year ago

Regression when running ant rpt:
Tested with trunk 15918, no issues here.
With trunk 15960 and onward the following error appears (on hotel_gui)


Update: this might be caused by r15921, I reverted it and rpt passed.

#3 Updated by Stefan Vieru about 1 year ago

While testing rpt I've found the following behavior: (clean hotel and clean trunk r16001)
  • ant rpt fails
  • ant convert.front.zset rpt fails
  • ant convert.front.zset rpt-no-front fails
  • ant convert.middle.zset rpt fails
  • ant convert.zset rpt passes
  • ant deploy rpt passes

#4 Updated by Alexandru Lungu about 1 year ago

  • Related to Feature #6490: DYNAMIC-INVOKE which returns an extent added

#5 Updated by Alexandru Lungu about 1 year ago

  • Assignee set to Paul Bodale

#6 Updated by Paul Bodale about 1 year ago

  • Status changed from New to WIP

#7 Updated by Paul Bodale about 1 year ago

  • Status changed from WIP to Review
  • % Done changed from 0 to 100
  • reviewer Alexandru Lungu added

The problem comes from one modified function located in rules/include/common-progress.rules, precisely the is_extent_lvalue_ref function.
This function was updated in rev. 15921 with the merge of the branch implementing the DYNAMIC-INVOKE returning extents feature because I found that it was not returning the correct results. See #6490-29.

Even if the function was returning the wrong results as per its documentation (the commentary right above the function declaration), the generation of one report is depending on this wrong result, to avoid the error that was found when running the ant target.


Please review the following:
  • Old is_extent_lvalue_ref function:
          <function name="is_extent_lvalue_ref">
             <parameter name="target" type="com.goldencode.ast.Aast" />
             <parameter name="noSub"  type="java.lang.Boolean" />
             <variable  name="ref"    type="com.goldencode.ast.Aast" />
             <variable  name="ttype"  type="java.lang.Integer" />
             <variable  name="extent" type="java.lang.Long" />
             <return    name="match"  type="java.lang.Boolean" />
    
             <rule>ttype = target.type</rule>
             <rule>match = false</rule>
    
             <rule>
                (ttype &gt; prog.begin_vartypes and ttype &lt; prog.end_vartypes) or
                (ttype &gt; prog.begin_fieldtypes and ttype &lt; prog.end_fieldtypes)
    
                <rule>!noSub and target.descendant(prog.lbracket, 1)
                   <rule>match = true</rule>
                </rule>
                <rule>!match
                   <action>ref = execLib("dereference", target)</action>
                   <rule>ref != null and ref.isAnnotation("extent")
                      <action>extent = ref.getAnnotation("extent")</action>
                      <rule>extent &gt; 0 or extent == -1
                         <rule>match = true</rule>
                      </rule>
                   </rule>
                </rule>
             </rule>
          </function>
    
  • Current (updated) rule:
          <function name="is_extent_lvalue_ref">
             <parameter name="target" type="com.goldencode.ast.Aast" />
             <parameter name="noSub"  type="java.lang.Boolean" />
             <variable  name="ref"    type="com.goldencode.ast.Aast" />
             <variable  name="ttype"  type="java.lang.Integer" />
             <variable  name="extent" type="java.lang.Long" />
             <return    name="match"  type="java.lang.Boolean" />
    
             <rule>ttype = target.type</rule>
             <rule>match = false</rule>
    
             <rule>
                (ttype &gt; prog.begin_vartypes and ttype &lt; prog.end_vartypes) or
                (ttype &gt; prog.begin_fieldtypes and ttype &lt; prog.end_fieldtypes)
    
                <rule>ttype &gt; prog.begin_fieldtypes and 
                      ttype &lt; prog.end_fieldtypes
                   <action>ref = target</action>
                   <action on="false">ref = execLib("dereference", target)</action>
                </rule>
                <rule>ref != null and ref.isAnnotation("extent")
                   <action>extent = ref.getAnnotation("extent")</action>
                   <rule>extent &gt; 0 or extent == -1
                      <rule>noSub
                         <!-- Checking for a subscripted reference -->
                         <rule>target.firstChild == null or target.firstChild.type != prog.lbracket
                            <!-- Target is not subscripted -->
                            <action>match = true</action>
                            </rule>
    
                         <!-- No need to check for subscript -->
                         <action on="false">match = true</action>
                      </rule>
                   </rule>
                </rule>
             </rule>
          </function>
    

  • Results with the old rule:
         [java] ==============================================================================================================
         [java] = [ASSIGN]:21474836533 @6:3
         [java]    a [VAR_INT]:21474836536 @6:1
         [java]          (oldtype=2988, refid=21474836483, support_level=16400)
         [java]    expression [EXPRESSION]:21474836537 @0:0
         [java]          (support_level=16400)
         [java]       1 [NUM_LITERAL]:21474836538 @6:5
         [java]             (use64bit=false, support_level=16400, is-literal=true)
         [java] 
         [java] **************************************************************************************************************
         [java] Rule: evalLib("is_extent_lvalue_ref", this.firstChild, true) returned: FALSE
         [java] Rule: evalLib("is_extent_lvalue_ref", this.firstChild, false) returned: FALSE
         [java] ==============================================================================================================
         [java] ==============================================================================================================
         [java] = [ASSIGN]:21474836542 @8:10
         [java]    aExt3 [VAR_INT]:21474836546 @8:1
         [java]          (extent=3, oldtype=2988, refid=21474836499, support_level=16400)
         [java]       [ [LBRACKET]:21474836547 @8:6
         [java]           [EXPRESSION]:21474836595 @0:0
         [java]                (support_level=16400)
         [java]             1 [NUM_LITERAL]:21474836548 @8:7
         [java]                   (use64bit=false, support_level=16400, is-literal=true)
         [java]    expression [EXPRESSION]:21474836549 @0:0
         [java]          (support_level=16400)
         [java]       2 [NUM_LITERAL]:21474836550 @8:12
         [java]             (use64bit=false, support_level=16400, is-literal=true)
         [java] 
         [java] **************************************************************************************************************
         [java] Rule: evalLib("is_extent_lvalue_ref", this.firstChild, true) returned: TRUE
         [java] Rule: evalLib("is_extent_lvalue_ref", this.firstChild, false) returned: TRUE
         [java] ==============================================================================================================
         [java] ==============================================================================================================
         [java] = [ASSIGN]:21474836554 @10:10
         [java]    aExt3 [VAR_INT]:21474836558 @10:1
         [java]          (extent=3, oldtype=2988, refid=21474836499, support_level=16400)
         [java]       [ [LBRACKET]:21474836559 @10:6
         [java]           [EXPRESSION]:21474836596 @0:0
         [java]                (support_level=16400)
         [java]             2 [NUM_LITERAL]:21474836560 @10:7
         [java]                   (use64bit=false, support_level=16400, is-literal=true)
         [java]    expression [EXPRESSION]:21474836561 @0:0
         [java]          (support_level=16400)
         [java]       3 [NUM_LITERAL]:21474836562 @10:12
         [java]             (use64bit=false, support_level=16400, is-literal=true)
         [java] 
         [java] **************************************************************************************************************
         [java] Rule: evalLib("is_extent_lvalue_ref", this.firstChild, true) returned: TRUE
         [java] Rule: evalLib("is_extent_lvalue_ref", this.firstChild, false) returned: TRUE
         [java] ==============================================================================================================
         [java] ==============================================================================================================
         [java] = [ASSIGN]:21474836566 @12:7
         [java]    aExtD [VAR_INT]:21474836569 @12:1
         [java]          (extent=-1, oldtype=2988, refid=21474836517, support_level=16400)
         [java]    expression [EXPRESSION]:21474836570 @0:0
         [java]          (support_level=16400)
         [java]       aExt3 [VAR_INT]:21474836571 @12:9
         [java]             (extent=3, oldtype=2988, refid=21474836499, support_level=16400)
         [java] 
         [java] **************************************************************************************************************
         [java] Rule: evalLib("is_extent_lvalue_ref", this.firstChild, true) returned: TRUE
         [java] Rule: evalLib("is_extent_lvalue_ref", this.firstChild, false) returned: TRUE
         [java] ==============================================================================================================
         [java] ==============================================================================================================
         [java] = [ASSIGN]:21474836575 @14:10
         [java]    aExtD [VAR_INT]:21474836579 @14:1
         [java]          (extent=-1, oldtype=2988, refid=21474836517, support_level=16400)
         [java]       [ [LBRACKET]:21474836580 @14:6
         [java]           [EXPRESSION]:21474836597 @0:0
         [java]                (support_level=16400)
         [java]             1 [NUM_LITERAL]:21474836581 @14:7
         [java]                   (use64bit=false, support_level=16400, is-literal=true)
         [java]    expression [EXPRESSION]:21474836582 @0:0
         [java]          (support_level=16400)
         [java]       4 [NUM_LITERAL]:21474836583 @14:12
         [java]             (use64bit=false, support_level=16400, is-literal=true)
         [java] 
         [java] **************************************************************************************************************
         [java] Rule: evalLib("is_extent_lvalue_ref", this.firstChild, true) returned: TRUE
         [java] Rule: evalLib("is_extent_lvalue_ref", this.firstChild, false) returned: TRUE
         [java] ==============================================================================================================
         [java] ==============================================================================================================
         [java] = [ASSIGN]:21474836587 @16:7
         [java]    aExt3 [VAR_INT]:21474836590 @16:1
         [java]          (extent=3, oldtype=2988, refid=21474836499, support_level=16400)
         [java]    expression [EXPRESSION]:21474836591 @0:0
         [java]          (support_level=16400)
         [java]       aExtD [VAR_INT]:21474836592 @16:9
         [java]             (extent=-1, oldtype=2988, refid=21474836517, support_level=16400)
         [java] 
         [java] **************************************************************************************************************
         [java] Rule: evalLib("is_extent_lvalue_ref", this.firstChild, true) returned: TRUE
         [java] Rule: evalLib("is_extent_lvalue_ref", this.firstChild, false) returned: TRUE
         [java] ==============================================================================================================
    
  • Results with the current (updated) rule:
         [java] ==============================================================================================================
         [java] = [ASSIGN]:21474836533 @6:3
         [java]    a [VAR_INT]:21474836536 @6:1
         [java]          (oldtype=2988, refid=21474836483, support_level=16400)
         [java]    expression [EXPRESSION]:21474836537 @0:0
         [java]          (support_level=16400)
         [java]       1 [NUM_LITERAL]:21474836538 @6:5
         [java]             (use64bit=false, support_level=16400, is-literal=true)
         [java] 
         [java] **************************************************************************************************************
         [java] Rule: evalLib("is_extent_lvalue_ref", this.firstChild, true) returned: FALSE
         [java] Rule: evalLib("is_extent_lvalue_ref", this.firstChild, false) returned: FALSE
         [java] ==============================================================================================================
         [java] ==============================================================================================================
         [java] = [ASSIGN]:21474836542 @8:10
         [java]    aExt3 [VAR_INT]:21474836546 @8:1
         [java]          (extent=3, oldtype=2988, refid=21474836499, support_level=16400)
         [java]       [ [LBRACKET]:21474836547 @8:6
         [java]           [EXPRESSION]:21474836595 @0:0
         [java]                (support_level=16400)
         [java]             1 [NUM_LITERAL]:21474836548 @8:7
         [java]                   (use64bit=false, support_level=16400, is-literal=true)
         [java]    expression [EXPRESSION]:21474836549 @0:0
         [java]          (support_level=16400)
         [java]       2 [NUM_LITERAL]:21474836550 @8:12
         [java]             (use64bit=false, support_level=16400, is-literal=true)
         [java] 
         [java] **************************************************************************************************************
         [java] Rule: evalLib("is_extent_lvalue_ref", this.firstChild, true) returned: FALSE
         [java] Rule: evalLib("is_extent_lvalue_ref", this.firstChild, false) returned: TRUE
         [java] ==============================================================================================================
         [java] ==============================================================================================================
         [java] = [ASSIGN]:21474836554 @10:10
         [java]    aExt3 [VAR_INT]:21474836558 @10:1
         [java]          (extent=3, oldtype=2988, refid=21474836499, support_level=16400)
         [java]       [ [LBRACKET]:21474836559 @10:6
         [java]           [EXPRESSION]:21474836596 @0:0
         [java]                (support_level=16400)
         [java]             2 [NUM_LITERAL]:21474836560 @10:7
         [java]                   (use64bit=false, support_level=16400, is-literal=true)
         [java]    expression [EXPRESSION]:21474836561 @0:0
         [java]          (support_level=16400)
         [java]       3 [NUM_LITERAL]:21474836562 @10:12
         [java]             (use64bit=false, support_level=16400, is-literal=true)
         [java] 
         [java] **************************************************************************************************************
         [java] Rule: evalLib("is_extent_lvalue_ref", this.firstChild, true) returned: FALSE
         [java] Rule: evalLib("is_extent_lvalue_ref", this.firstChild, false) returned: TRUE
         [java] ==============================================================================================================
         [java] ==============================================================================================================
         [java] = [ASSIGN]:21474836566 @12:7
         [java]    aExtD [VAR_INT]:21474836569 @12:1
         [java]          (extent=-1, oldtype=2988, refid=21474836517, support_level=16400)
         [java]    expression [EXPRESSION]:21474836570 @0:0
         [java]          (support_level=16400)
         [java]       aExt3 [VAR_INT]:21474836571 @12:9
         [java]             (extent=3, oldtype=2988, refid=21474836499, support_level=16400)
         [java] 
         [java] **************************************************************************************************************
         [java] Rule: evalLib("is_extent_lvalue_ref", this.firstChild, true) returned: TRUE
         [java] Rule: evalLib("is_extent_lvalue_ref", this.firstChild, false) returned: TRUE
         [java] ==============================================================================================================
         [java] ==============================================================================================================
         [java] = [ASSIGN]:21474836575 @14:10
         [java]    aExtD [VAR_INT]:21474836579 @14:1
         [java]          (extent=-1, oldtype=2988, refid=21474836517, support_level=16400)
         [java]       [ [LBRACKET]:21474836580 @14:6
         [java]           [EXPRESSION]:21474836597 @0:0
         [java]                (support_level=16400)
         [java]             1 [NUM_LITERAL]:21474836581 @14:7
         [java]                   (use64bit=false, support_level=16400, is-literal=true)
         [java]    expression [EXPRESSION]:21474836582 @0:0
         [java]          (support_level=16400)
         [java]       4 [NUM_LITERAL]:21474836583 @14:12
         [java]             (use64bit=false, support_level=16400, is-literal=true)
         [java] 
         [java] **************************************************************************************************************
         [java] Rule: evalLib("is_extent_lvalue_ref", this.firstChild, true) returned: FALSE
         [java] Rule: evalLib("is_extent_lvalue_ref", this.firstChild, false) returned: TRUE
         [java] ==============================================================================================================
         [java] ==============================================================================================================
         [java] = [ASSIGN]:21474836587 @16:7
         [java]    aExt3 [VAR_INT]:21474836590 @16:1
         [java]          (extent=3, oldtype=2988, refid=21474836499, support_level=16400)
         [java]    expression [EXPRESSION]:21474836591 @0:0
         [java]          (support_level=16400)
         [java]       aExtD [VAR_INT]:21474836592 @16:9
         [java]             (extent=-1, oldtype=2988, refid=21474836517, support_level=16400)
         [java] 
         [java] **************************************************************************************************************
         [java] Rule: evalLib("is_extent_lvalue_ref", this.firstChild, true) returned: TRUE
         [java] Rule: evalLib("is_extent_lvalue_ref", this.firstChild, false) returned: TRUE
         [java] ==============================================================================================================
    

#8 Updated by Greg Shah about 1 year ago

Why not just put some protection code in describe_extent_lvalue? Better yet, make sure that describe_extent_lvalue handles things properly.

#9 Updated by Constantin Asofiei about 1 year ago

Paul, previously is_extent_lvalue_ref was not matching on fields (the descedent(prog.lbracket, 1) was wrong, first arg is level, second arg is type). Now, it matches on a field, also. So is not an AST problem, but a problem with the fact that describe_extent_lvalue is not handling fields properly:

      <function name="describe_extent_lvalue">
         <parameter name="target" type="com.goldencode.ast.Aast" />
         <variable  name="ref"    type="com.goldencode.ast.Aast" />
         <variable  name="ext"    type="java.lang.Long" />
         <return    name="tname"  type="java.lang.String" />
         <rule>ref = execLib("dereference", target)</rule>
         <rule>ref == null
            <action>ref = target</action>
         </rule>
         <rule>tname = execLib("describe_extent", ref)</rule>
      </function>

As in current trunk, ref will be null for fields. Adding the above solves the issue (if null, use target).

#10 Updated by Paul Bodale about 1 year ago

  • reviewer Constantin Asofiei added
  • reviewer deleted (Alexandru Lungu)

Committed rev. 16014 on branch 10125a that introduces the fix made by Constantin above:

=== modified file 'rules/include/report.rules'
--- old/rules/include/report.rules    2025-01-09 18:50:12 +0000
+++ new/rules/include/report.rules    2025-07-01 11:55:44 +0000
@@ -995,6 +995,9 @@
          <return    name="tname"  type="java.lang.String" />

          <rule>ref = execLib("dereference", target)</rule>
+         <rule>ref == null
+            <action>ref = target</action>
+         </rule>
          <rule>tname = execLib("describe_extent", ref)</rule>
       </function>

#11 Updated by Stefan Vieru about 1 year ago

Tested ant rpt with and without #5586 on top of 10215a on hotel_gui and both passed.
Also looked through analytics and nothing suspicious seen there.

#12 Updated by Greg Shah about 1 year ago

Is #6490-29 still fixed with the 10125a? If so, this seems pretty low risk to merge.

#13 Updated by Greg Shah about 1 year ago

  • Status changed from Review to Internal Test

#14 Updated by Paul Bodale about 1 year ago

Greg Shah wrote:

Is #6490-29 still fixed with the 10125a? If so, this seems pretty low risk to merge.

Yes, the fix doesn't affect existing implementation. For #6490 we only use the is_extent_lvalue_ref function from common-progress.rules.

#15 Updated by Constantin Asofiei about 1 year ago

Paul, please add history entry and update copyright year.

#16 Updated by Paul Bodale about 1 year ago

Committed rev. 16015 on branch 10215a that addresses the feedback received.

#17 Updated by Constantin Asofiei about 1 year ago

  • Status changed from Internal Test to Merge Pending

Please merge now.

#18 Updated by Paul Bodale about 1 year ago

  • Status changed from Merge Pending to Test

Branch 10215a was merged into trunk as rev. 16017 and archived.

Also available in: Atom PDF