stevedlawrence commented on PR #896:
URL: https://github.com/apache/daffodil/pull/896#issuecomment-1357673944
> There is still an issue with one of the tests causing a stack trace from
an IllegalArgumentException to be printed
I did a little digging, and I think I found the cause. For reference, here's
the stack trace:
```
java.lang.IllegalArgumentException
| => dat
java.lang.AbstractStringBuilder.appendCodePoint(AbstractStringBuilder.java:800)
at java.lang.StringBuilder.appendCodePoint(StringBuilder.java:240)
at
com.siemens.ct.exi.core.io.channel.AbstractDecoderChannel.decodeStringOnlySupplementaryCodePoints(AbstractDecoderChannel.java:111)
at
com.siemens.ct.exi.core.io.channel.AbstractDecoderChannel.decodeStringOnly(AbstractDecoderChannel.java:89)
at
com.siemens.ct.exi.core.coder.AbstractEXIBodyDecoder.decodeLocalName(AbstractEXIBodyDecoder.java:170)
at
com.siemens.ct.exi.core.coder.AbstractEXIBodyDecoder.decodeQName(AbstractEXIBodyDecoder.java:133)
at
com.siemens.ct.exi.core.coder.AbstractEXIBodyDecoder.decodeStartElementGenericStructure(AbstractEXIBodyDecoder.java:484)
at
com.siemens.ct.exi.core.coder.EXIBodyDecoderInOrder.decodeStartElement(EXIBodyDecoderInOrder.java:126)
at
com.siemens.ct.exi.main.api.sax.SAXDecoder.parseEXIEvents(SAXDecoder.java:313)
at com.siemens.ct.exi.main.api.sax.SAXDecoder.parse(SAXDecoder.java:250)
at
net.sf.saxon.resource.ActiveSAXSource.deliver(ActiveSAXSource.java:190)
at net.sf.saxon.event.Sender.send(Sender.java:105)
at
net.sf.saxon.jaxp.IdentityTransformer.transform(IdentityTransformer.java:364)
at org.apache.daffodil.Main$.runIgnoreExceptions(Main.scala:1307)
at org.apache.daffodil.Main$.run(Main.scala:1433)
at org.apache.daffodil.CLI.Util$CLIThread.run(Util.scala:281)
```
The issue is that `appendCodePoint` can throw an IllegalArgumentException if
the code point isn't valid unicode (this isn't really documented except for the
fact that it is "exactly like Characters.toChars" which does document throwing
this exception). Exificient doesn't catch this, so if this happens it bubbles
all the way up to the `deliver` function in Saxon and is finally caught (and
printed) here:
https://saxonica.plan.io/projects/saxonmirrorhe/repository/he/entry/src/main/java/net/sf/saxon/resource/ActiveSAXSource.java?utf8=%E2%9C%93&rev=he_mirror_saxon_11_4#L233
Looking at the latest dev branch of Saxon, this call to printStrackTrace has
been removed, but still exists in the 11.4 release we use. So this will likely
be fixed in the next version of Saxon. However, I *think* this is a bug in
Exificient since it shouldn't throw an IllegalArgumentException, but should
probably validate the codepoint and throw a SAX exception instead?
Does this sound right? Maybe we should open a ticket with efficient?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]