You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2022/12/18 23:19:10 UTC

[GitHub] [daffodil] jadams-tresys opened a new pull request, #896: Add custom error handler for CLI EXI encode/decode

jadams-tresys opened a new pull request, #896:
URL: https://github.com/apache/daffodil/pull/896

   Adding custom error handler that implements SAX ErrorHandler and Transform ErrorListener helps contain some of the error messages that were getting printed to stderr and were polluting the output of our integration tests.
   
   There is still an issue with one of the tests causing a stack trace from an IllegalArgumentException to be printed that occurs when decoding a schema aware encoded EXI file with a non-schema aware decoder. This appears to be getting printed directly to stderr from within Exificient.
   
   DAFFODIL-2750


-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil] jadams-tresys merged pull request #896: Add custom error handler for CLI EXI encode/decode

Posted by GitBox <gi...@apache.org>.
jadams-tresys merged PR #896:
URL: https://github.com/apache/daffodil/pull/896


-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil] stevedlawrence commented on pull request #896: Add custom error handler for CLI EXI encode/decode

Posted by GitBox <gi...@apache.org>.
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil] stevedlawrence commented on pull request #896: Add custom error handler for CLI EXI encode/decode

Posted by GitBox <gi...@apache.org>.
stevedlawrence commented on PR #896:
URL: https://github.com/apache/daffodil/pull/896#issuecomment-1357812866

   In fact, now that I think about it, that's probably also the reason why we need this code:
   
   https://github.com/apache/daffodil/blob/main/daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala#L1306-L1312
   
   So what we thought was a generic exception was more likely an exificient bug.
   
   Once Exifcient fixes this issue, we can change that from catching an Exception to whatever SAX exception they end up throwing.


-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil] mbeckerle commented on pull request #896: Add custom error handler for CLI EXI encode/decode

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on PR #896:
URL: https://github.com/apache/daffodil/pull/896#issuecomment-1357982000

   Suggest: If you have a ticket URL for Exificient you could cite that in the comment just before the catch of e:Exception. 


-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil] jadams-tresys commented on pull request #896: Add custom error handler for CLI EXI encode/decode

Posted by GitBox <gi...@apache.org>.
jadams-tresys commented on PR #896:
URL: https://github.com/apache/daffodil/pull/896#issuecomment-1357802991

   Ah, I had stopped digging through the stack trace after the Exificient code and had assumed that something was just holding onto the stacktrace and printing it out from a different context or something.  Didn't think it would be Saxon actually printing it out directly to stderr.  Glad to see that there is a fix for it in Saxon.
   
   I'll add a bug to Exificient recommending that they catch this exception and throw it as some other exception type (likely going to be an EXIException if I had to guess).


-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org