Project

Profile

Help

Bug #3927

closed

Multi-threading problems using Saxon-EE xsl:result-document with calls on last()

Added by roland civet about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Multithreading
Sprint/Milestone:
-
Start date:
2018-10-01
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.8, 9.9
Fix Committed on Branch:
9.8, 9.9
Fixed in Maintenance Release:
Platforms:

Description

The issue I'm facing to occurs only if the licence is detected ('Using license serial number XYZ'). If I remove the licence from the folder, everything is fine ('running with licensable features disabled'). Using -opt:0 makes no difference.

The error is twofold:

  • Java.lang.IllegalArgumentException: Attempting to treat a parent pointer as a node at net.sf.saxon.tree.tiny.TinyTree.getNode(TinyTree.java:956)
  • Some child xsl:result-document threads have not finished Error in xsl:result-document/@href on line 96 column 60 of ss4.xsl: XTDE1490: Cannot write more than one result document to the same URI:

It's a pet project. I generate the xml using a dummy template that I iterate n times. After hours of troubleshooting, I have noticed that:

  • It always works fine (with licence and without licence) if the number of nodes is less than 2000
  • If the number of nodes is greater than 2000, it works if licence is not present and fails if the licence is present. I found out the instruction that causes Saxon to crash:
check if position() < last(), then ../item[position() + 1]/@id

If I comment that instruction and licence is present, it works. If no licence, that line is processed okay whatever the number of nodes.

The error "Cannot write more than one result document to the same URI" is impossible. I double checked the xml; there is no risk of collision. I use xsl:result-document/. Href use the position() of current node.

Sadly, using the flag -t does not output the file that is written (it was the case with the prior version 9.8). I noticed with the prior version that files were written file: item_1.html, item_3.html, item_2.html, etc. This is only possible with some parallel processing as my xml is purely sequential (from id 1 to id n) and I use position() to write file.

My questions are:

  • Are you aware of the "bug"?
  • To bypass that bug, how can I disable the parallel processing if the licence is active?

Saxon-EE 9.9.0.1J from Saxonica Java version 10.0.2 Mac OS High Sierra 10.13.6


Files

ss5.xsl (1.67 KB) ss5.xsl stylesheet roland civet, 2018-10-01 11:29
items.xml (5.08 MB) items.xml xml source roland civet, 2018-10-01 11:29
error.txt (3.17 KB) error.txt exceptions: v9.9 and v9.8 roland civet, 2018-10-01 23:03

Please register to edit this issue

Also available in: Atom PDF