quattor / pan

Pan Language Compiler and Tools
www.quattor.org
Apache License 2.0
13 stars 20 forks source link

Tests fail with invalid xpath expressions on recent Java versions #259

Open jrha opened 1 week ago

jrha commented 1 week ago

As noted in #258.

e.g. (line-breaks added for readability):

[ERROR] Failures: 
[ERROR]   JavaCompilerTest.javaFunctionalTests:244
function6.pan: invalid xpath expression count(/nlist[@name='profile']/list[@name='s1']/*)=7
  and  count(/nlist[@name='profile']/list[@name='s2']/*)=7
  and  count(/nlist[@name='profile']/list[@name='s3']/*)=7
  and  count(/nlist[@name='profile']/list[@name='s4']/*)=4
  and  count(/nlist[@name='profile']/list[@name='s5']/*)=4
  and  count(/nlist[@name='profile']/list[@name='s6']/*)=4
  and  count(/nlist[@name='profile']/list[@name='s7']/*)=4
  and  /nlist[@name='profile']/list[@name='s1']/*[1]='1'
  and  /nlist[@name='profile']/list[@name='s2']/*[6]='1'
  and  /nlist[@name='profile']/list[@name='s3']/*[3]='1'
  and  /nlist[@name='profile']/list[@name='s4']/*[1]='b'
  and  /nlist[@name='profile']/list[@name='s5']/*[4]='d'
  and  /nlist[@name='profile']/list[@name='s6']/*[4]='e'
  and  /nlist[@name='profile']/list[@name='s7']/*[3]='XXX'
key5.pan: invalid xpath expression /nlist[@name='profile']/list[@name='test1_list']/*[1]='012'
  and  /nlist[@name='profile']/list[@name='test1_list']/*[2]='aaabbbccc'
  and  /nlist[@name='profile']/list[@name='test1_nlist']/*[1]='abc'
  and  /nlist[@name='profile']/list[@name='test1_nlist']/*[2]='111222333'
  and  /nlist[@name='profile']/list[@name='test2_list']/*[1]='012'
  and  /nlist[@name='profile']/list[@name='test2_list']/*[2]='aaabbbccc'
  and  /nlist[@name='profile']/list[@name='test2_nlist']/*[1]='abc'
  and  /nlist[@name='profile']/list[@name='test2_nlist']/*[2]='111222333'
list1.pan: invalid xpath expression /nlist[@name='profile']/list[@name='l1']/*[1]='first'
  and  /nlist[@name='profile']/list[@name='l2']/*[1]='first'
  and  /nlist[@name='profile']/list[@name='l3']/*[1]='first'
  and  /nlist[@name='profile']/list[@name='l1']/*[2]='second'
  and  /nlist[@name='profile']/list[@name='l2']/*[2]='second'
  and  /nlist[@name='profile']/list[@name='l3']/*[2]='second'
  and  /nlist[@name='profile']/list[@name='l1']/*[3]='third'
  and  /nlist[@name='profile']/list[@name='l2']/*[3]='third'
  and  /nlist[@name='profile']/list[@name='l3']/*[3]='third'
operator1.pan: invalid xpath expression /nlist[@name='profile']/list[@name='t']/*[1]='true'
  and  /nlist[@name='profile']/list[@name='t']/*[2]='true'
  and  /nlist[@name='profile']/list[@name='t']/*[3]='true'
  and  /nlist[@name='profile']/list[@name='t']/*[4]='true'
  and  /nlist[@name='profile']/list[@name='t']/*[5]='true'
  and  /nlist[@name='profile']/list[@name='t']/*[6]='true'
  and  /nlist[@name='profile']/list[@name='t']/*[7]='true'
  and  /nlist[@name='profile']/list[@name='t']/*[8]='true'
  and  /nlist[@name='profile']/list[@name='t']/*[9]='true'
  and  /nlist[@name='profile']/list[@name='f']/*[1]='false'
  and  /nlist[@name='profile']/list[@name='f']/*[2]='false'
  and  /nlist[@name='profile']/list[@name='f']/*[3]='false'
  and  /nlist[@name='profile']/list[@name='f']/*[4]='false'
  and  /nlist[@name='profile']/list[@name='f']/*[5]='false'
  and  /nlist[@name='profile']/list[@name='f']/*[6]='false'
  and  /nlist[@name='profile']/list[@name='f']/*[7]='false'
  and  /nlist[@name='profile']/list[@name='f']/*[8]='false'
  and  /nlist[@name='profile']/list[@name='f']/*[9]='false'
regexp1.pan: invalid xpath expression /nlist[@name='profile']/boolean[@name='s1']='true'
  and  /nlist[@name='profile']/boolean[@name='s2']='false'
  and  count(/nlist[@name='profile']/list[@name='s3']/*)=5
  and  count(/nlist[@name='profile']/list[@name='s4']/*)=3
  and  /nlist[@name='profile']/list[@name='s4']/*[2]='16.'
  and  /nlist[@name='profile']/boolean[@name='s5']='false'
  and  /nlist[@name='profile']/boolean[@name='s6']='true'
  and  count(/nlist[@name='profile']/list[@name='s7']/*)=3
  and  /nlist[@name='profile']/list[@name='s7']/*[2]='dd'
jrha commented 1 week ago

openjdk version "14.0.2" 2020-07-14 → pass :white_check_mark: openjdk version "15.0.2" 2021-01-19 → pass :white_check_mark: openjdk version "16.0.2" 2021-07-20 → pass :white_check_mark: openjdk version "17-ea" 2021-09-14 → pass :white_check_mark: openjdk version "17.0.2" 2022-01-18 → pass :white_check_mark: openjdk version "18.0.2.1" 2022-08-18 → fail :x: openjdk version "11.0.16" 2022-07-19 → fail :x: openjdk version "1.8.0_342" → fail :x:

jrha commented 1 week ago

Looks like we're hitting the "New XML Processing Limits" introduced in 2022. Disabling jdk.xml.xpathExprOpLimit allows the tests to pass.

jrha commented 1 week ago

The default value of jdk.xml.xpathExprOpLimit is 10, a quick binary search shows that 233 is the lowest value that allows the xpath expressions to be used and the tests to pass.