Project

Profile

Help

Bug #6042

closed

Xerces occasionally throws ArrayIndexOutOfBoundsException

Added by Norm Tovey-Walsh 12 months ago. Updated 13 days ago.

Status:
Won't fix
Priority:
Low
Assignee:
Category:
Third-party product
Sprint/Milestone:
-
Start date:
2023-05-21
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
10, 11, 12, trunk
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:
Java

Description

Can't reproduce this locally and debugging through the narrow opening provided by CI is awfully painful, but FYI:

This is xspec.bat (slightly hacked) from the DocBook xslTNG project running on Windows CI in GitHub. I've instrumented the batch file with:

    echo "XSLT:"
    echo %*

The full command is:

    java ^
        -Dfile.encoding=UTF-8 ^
        -Dxspec.coverage.ignore="%TEST_DIR%" ^
        -Dxspec.coverage.xml="%COVERAGE_XML%" ^
        -Dxspec.home="%XSPEC_HOME%" ^
        -Dxspec.xspecfile="%XSPEC%" ^
        -Dorg.docbook.xsltng.extensions.pygmentize="%PYGMENTIZE%" ^
        -Dorg.docbook.xsltng.verbose="%VERBOSE%" ^
        -cp "%CP%" net.sf.saxon.Transform %CATALOG% ^
        -init:org.docbook.xsltng.extensions.Register %*

With Saxon 11.5:

Formatting Report...
"XSLT:"
-o:"D:\a\xslTNG\xslTNG\build\default-result.html"     -s:"D:\a\xslTNG\xslTNG\build\default-result.xml"     -xsl:"D:\a\xslTNG\xslTNG\build\xspec-2.2.4\bin\..\src\reporter\format-xspec-report.xsl"     inline-css=true
java.lang.IllegalStateException: java.lang.ArrayIndexOutOfBoundsException: 2048
	at net.sf.saxon.resource.ActiveSAXSource.deliver(ActiveSAXSource.java:233)
	at net.sf.saxon.resource.ActiveStreamSource.deliver(ActiveStreamSource.java:65)
	at net.sf.saxon.event.Sender.send(Sender.java:105)
	at net.sf.saxon.Configuration.buildDocumentTree(Configuration.java:4138)
	at net.sf.saxon.s9api.DocumentBuilder.build(DocumentBuilder.java:334)
	at net.sf.saxon.Transform.processFile(Transform.java:1346)
	at net.sf.saxon.Transform.doTransform(Transform.java:871)
	at net.sf.saxon.Transform.main(Transform.java:81)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 2048
	at org.apache.xerces.impl.io.UTF8Reader.read(Unknown Source)
	at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
	at org.apache.xerces.impl.XMLEntityScanner.scanContent(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanContent(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)

	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at net.sf.saxon.resource.ActiveSAXSource.deliver(ActiveSAXSource.java:190)
	... 7 more
Fatal error during transformation: java.lang.IllegalStateException: java.lang.ArrayIndexOutOfBoundsException: 2048
*** Error formatting the report

with Saxon 12.2:

Formatting Report...
"XSLT:"
-o:"D:\a\xslTNG\xslTNG\build\default-result.html"     -s:"D:\a\xslTNG\xslTNG\build\default-result.xml"     -xsl:"D:\a\xslTNG\xslTNG\build\xspec-2.2.4\bin\..\src\reporter\format-xspec-report.xsl"     inline-css=true
java.lang.ArrayIndexOutOfBoundsException: 2048
	at org.apache.xerces.impl.io.UTF8Reader.read(Unknown Source)
	at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
	at org.apache.xerces.impl.XMLEntityScanner.scanContent(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanContent(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at net.sf.saxon.resource.ActiveSAXSource.deliver(ActiveSAXSource.java:190)
	at net.sf.saxon.resource.ActiveStreamSource.deliver(ActiveStreamSource.java:65)
	at net.sf.saxon.event.Sender.send(Sender.java:104)
	at net.sf.saxon.Configuration.buildDocumentTree(Configuration.java:4210)
	at net.sf.saxon.s9api.DocumentBuilder.build(DocumentBuilder.java:334)
	at net.sf.saxon.Transform.processFile(Transform.java:1345)
	at net.sf.saxon.Transform.doTransform(Transform.java:879)
	at net.sf.saxon.Transform.main(Transform.java:83)
Fatal error during transformation: java.lang.ArrayIndexOutOfBoundsException: 2048
*** Error formatting the report

It's particularly annoying that this looks like an encoding issue but I have explicitly specified the file.encoding and the same code on my local Windows machine does not fail.

Please register to edit this issue

Also available in: Atom PDF