Project

Profile

Help

Bug #5700

closed

too many namespaces leads to ArrayIndexOutOfBoundsException

Added by Frederic Guilbeault about 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Diagnostics
Sprint/Milestone:
-
Start date:
2022-09-29
Due date:
% Done:

100%

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

Description

with Saxon-HE 9.9.1.8J from Saxonica

if using too many namespace definitions, then an ArrayIndexOutOfBoundsException is thrown

to reproduce:

java -jar saxon9he.jar -s:too.xml -xsl:id.xslt &> error_output

refer to attached files below:

too.xml

id.xslt

error_output


Files

too.xml (557 KB) too.xml Frederic Guilbeault, 2022-09-29 23:32
id.xslt (481 Bytes) id.xslt Frederic Guilbeault, 2022-09-29 23:32
error_output (821 KB) error_output Frederic Guilbeault, 2022-09-29 23:32
Actions #1

Updated by Michael Kay about 2 years ago

  • Category set to Diagnostics
  • Assignee set to Michael Kay
  • Priority changed from Low to Normal

Thanks for providing the test case.

The limit for a TinyTree is 1024 namespace prefixes used in a single document. We increased the limit in Saxon 9.8, it was previously 1024 prefixes globally.

The limit is there for a good reason and I don't propose to change it. But I'll look at whether we can produce better diagnostics when the limit is exceeded.

There used to be an application (Apache Axis?) that generated XML documents with a ludicrous number of namespace bindings, but I haven't seen the problem for many years. It would be interesting to know whether this is a real requirement.

Actions #2

Updated by Michael Kay about 2 years ago

  • Status changed from New to Resolved
  • Applies to branch 10, 11, trunk added
  • Applies to branch deleted (9.9)
  • Fix Committed on Branch 10, 11, trunk added
  • Platforms .NET, Java added

The limit is actually 2047 namespace prefixes per document.

I've patched it to fail with a slightly more informative exception.

Actions #3

Updated by Frederic Guilbeault about 2 years ago

Thanks for the prompt resolution. It is aligned with your expectations. There is no justifiable requirement for using so many (thousands) of namespace bindings. Applications that do this should be redesigned. If ever there is a justifiable requirements for this, I will inform you.

The focus here is more to improve the error, indeed, so that it is more informative. Thanks again for addressing this so promptly.

Actions #4

Updated by Community Admin almost 2 years ago

  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 12.0 added

Bug issue fix applied in the Saxon 12.0 Major Release. Leaving this bug marked as Resolved until fix applied

Actions #5

Updated by O'Neil Delpratt almost 2 years ago

  • Fixed in Maintenance Release 11.5 added

Bug fix applied in the Saxon 11.5 maintenance release.

Actions #6

Updated by O'Neil Delpratt almost 2 years ago

  • Status changed from Resolved to Closed
  • Fixed in Maintenance Release 10.9 added

Bug fix applied in the Saxon 10.9 maintenance release.

Please register to edit this issue

Also available in: Atom PDF