veraPDF / veraPDF-library

Industry supported, open source PDF/A validation library
http://verapdf.org/software
GNU General Public License v3.0
276 stars 47 forks source link

Exception caught when validating item #1348

Closed u-fischer closed 1 year ago

u-fischer commented 1 year ago

When validating the attached pdf with the arlington-pdf-model-checker I get an java exception.

 <releaseDetails id="validation-model-arlington" version="1.23.66" buildDate="2023-06-21T07:25:00+02:00"></releaseDetails>
 <releaseDetails id="gui-arlington" version="1.23.68" buildDate="2023-06-21T07:31:00+02:00"></releaseDetails>
 <releaseDetails id="core-arlington" version="1.23.35" buildDate="2023-06-19T20:45:00+02:00"></releaseDetails>
WARNUNG: Exception caught when validating item
org.verapdf.core.ValidationException: Caught unexpected runtime exception during validation
        at org.verapdf.pdfa.validation.validators.BaseValidator.validate(BaseValidator.java:110)
        at org.verapdf.processor.ProcessorImpl.validate(ProcessorImpl.java:248)
        at org.verapdf.processor.ProcessorImpl.process(ProcessorImpl.java:124)
        at org.verapdf.processor.BatchFileProcessor.processItem(BatchFileProcessor.java:152)
        at org.verapdf.processor.BatchFileProcessor.processList(BatchFileProcessor.java:85)
        at org.verapdf.processor.AbstractBatchProcessor.process(AbstractBatchProcessor.java:102)
        at org.verapdf.cli.VeraPdfCliProcessor.processFilePaths(VeraPdfCliProcessor.java:142)
        at org.verapdf.cli.VeraPdfCliProcessor.processPaths(VeraPdfCliProcessor.java:103)
        at org.verapdf.cli.VeraPdfCli.singleThreadProcess(VeraPdfCli.java:143)
        at org.verapdf.cli.VeraPdfCli.main(VeraPdfCli.java:111)
        at org.verapdf.apps.GreenfieldCliWrapper.main(GreenfieldCliWrapper.java:54)
Caused by: org.mozilla.javascript.WrappedException: Wrapped java.lang.NullPointerException: Cannot invoke "java.util.Set.stream()" because the return value of "org.verapdf.cos.COSObject.getKeySet()" is null (unnamed script#2)
        at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1899)
        at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:160)
        at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:226)
        at org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:98)
        at org.mozilla.javascript.gen.unnamed_script_308._c_script_0(unnamed script:2)
        at org.mozilla.javascript.gen.unnamed_script_308.call(unnamed script)
        at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:412)
        at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3578)
        at org.mozilla.javascript.gen.unnamed_script_308.call(unnamed script)
        at org.mozilla.javascript.gen.unnamed_script_308.exec(unnamed script)
        at org.verapdf.pdfa.validation.validators.JavaScriptEvaluator.getTestEvalResult(JavaScriptEvaluator.java:122)
        at org.verapdf.pdfa.validation.validators.BaseValidator.checkObjWithRule(BaseValidator.java:313)
        at org.verapdf.pdfa.validation.validators.BaseValidator.firstProcessObjectWithRule(BaseValidator.java:309)
        at org.verapdf.pdfa.validation.validators.BaseValidator.checkAllRules(BaseValidator.java:282)
        at org.verapdf.pdfa.validation.validators.BaseValidator.checkNext(BaseValidator.java:195)
        at org.verapdf.pdfa.validation.validators.BaseValidator.validate(BaseValidator.java:144)
        at org.verapdf.pdfa.validation.validators.BaseValidator.validate(BaseValidator.java:108)
        ... 10 more
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.Set.stream()" because the return value of "org.verapdf.cos.COSObject.getKeySet()" is null
        at org.verapdf.gf.model.impl.arlington.GFADestXYZStructArray.getkeysStringtrailerCatalogDests(GFADestXYZStructArray.java:206)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.base/java.lang.reflect.Method.invoke(Method.java:578)
        at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138)
        ... 25 more

The pdf contains a link from the footnote marker to the footnote. If I disable this link, it works. It also works if I don't produce a pdf 2.0.

The pdf has been made with a current LaTeX and

\DocumentMetadata{uncompress,testphase=phase-III,pdfversion=2.0}
\documentclass{article}
\usepackage{hyperref}
\begin{document}
abc\footnote{a footnote}
\end{document}

test-utf8.pdf

MaximPlusov commented 1 year ago

@u-fischer thanks for reporting this issue. It was fixed in the latest dev build 1.25.1

u-fischer commented 1 year ago

@MaximPlusov Thanks. But I guess the latest dev build is now 1.25.3?

MaximPlusov commented 1 year ago

@u-fischer Yes, new versions have already been created