Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StrictXmir throws Premature end of file #3760

Closed
volodya-lombrozo opened this issue Dec 25, 2024 · 6 comments
Closed

StrictXmir throws Premature end of file #3760

volodya-lombrozo opened this issue Dec 25, 2024 · 6 comments

Comments

@volodya-lombrozo
Copy link
Member

I've updated eo version up to 0.49.3 and now I'm getting the following exception:

Caused by: org.xml.sax.SAXParseException: Premature end of file.
    at org.apache.xerces.jaxp.validation.Util.toSAXParseException (Unknown Source)
    at org.apache.xerces.jaxp.validation.DOMValidatorHelper.validate (Unknown Source)
    at org.apache.xerces.jaxp.validation.ValidatorImpl.validate (Unknown Source)
    at javax.xml.validation.Validator.validate (Validator.java:124)
    at com.jcabi.xml.XMLDocument.validate (XMLDocument.java:475)
    at com.jcabi.xml.XMLDocument.validate (XMLDocument.java:461)
    at com.jcabi.xml.StrictXML.lambda$new$0 (StrictXML.java:79)
    at com.jcabi.xml.StrictXML.lambda$new$2 (StrictXML.java:102)
    at org.cactoos.scalar.Sticky.lambda$new$0 (Sticky.java:73)
    at org.cactoos.func.StickyFunc.lambda$new$0 (StickyFunc.java:70)
    at org.cactoos.func.StickyBiFunc.apply (StickyBiFunc.java:93)
    at org.cactoos.func.StickyFunc.apply (StickyFunc.java:77)
    at org.cactoos.scalar.Sticky.value (Sticky.java:79)
    at org.cactoos.scalar.Checked.value (Checked.java:75)
    at org.cactoos.scalar.IoChecked.value (IoChecked.java:63)
    at org.cactoos.scalar.Unchecked.value (Unchecked.java:56)
    at com.jcabi.xml.StrictXML.inner (StrictXML.java:170)
    at org.eolang.parser.StrictXmir.inner (StrictXmir.java:142)
    at com.jcabi.xml.XSLDocument.transformInto (XSLDocument.java:437)
    at com.jcabi.xml.XSLDocument.transform (XSLDocument.java:400)
    at org.eolang.lints.MeasuredXsl.transform (MeasuredXsl.java:81)
    at org.eolang.lints.LtByXsl.defects (LtByXsl.java:97)
    at org.eolang.lints.LtByXsl.defects (LtByXsl.java:45)
    at org.eolang.lints.Program.defects (Program.java:102)
    at org.eolang.jeo.representation.VerifiedEo.asXml (VerifiedEo.java:71)
    at org.eolang.jeo.representation.MeasuredEo.asXml (MeasuredEo.java:58)
    at org.eolang.jeo.representation.BytecodeRepresentation.toEO (BytecodeRepresentation.java:117)
    at org.eolang.jeo.Disassembling.transform (Disassembling.java:86)
    at org.eolang.jeo.Caching.tryTransform (Caching.java:93)
    at org.eolang.jeo.Caching.transform (Caching.java:63)
    at org.eolang.jeo.Logging.transform (Logging.java:83)
    at org.eolang.jeo.Disassembler.disassemble (Disassembler.java:113)
    at org.eolang.jeo.ParallelTranslator.translate (ParallelTranslator.java:70)
    at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:197)
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining (ArrayList.java:1708)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:509)
    at java.util.stream.ForEachOps$ForEachTask.compute (ForEachOps.java:291)
    at java.util.concurrent.CountedCompleter.exec (CountedCompleter.java:754)
    at java.util.concurrent.ForkJoinTask.doExec (ForkJoinTask.java:387)
    at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec (ForkJoinPool.java:1312)
    at java.util.concurrent.ForkJoinPool.scan (ForkJoinPool.java:1843)
    at java.util.concurrent.ForkJoinPool.runWorker (ForkJoinPool.java:1808)
    at java.util.concurrent.ForkJoinWorkerThread.run (ForkJoinWorkerThread.java:188)

Full log:
build.log.txt

You can find the filed pipeline here:
https://github.com/objectionary/jeo-maven-plugin/actions/runs/12492715546/job/34860344624?pr=942#logs

Filesystem snippet is here:
https://github.com/objectionary/jeo-maven-plugin/actions/runs/12492715546/artifacts/2361347598

@volodya-lombrozo
Copy link
Member Author

@maxonfjvipon @yegor256 Please, have a look

@maxonfjvipon
Copy link
Member

maxonfjvipon commented Dec 25, 2024

@volodya-lombrozo could you please provide a couple of details about how do you use StrictXmir in terms of concurrency

@maxonfjvipon
Copy link
Member

maxonfjvipon commented Dec 25, 2024

@volodya-lombrozo I'm asking because we've already made a couple of concurrency tests for StrictXmir that in theory should cover your scenario and they pass. So I can't figure out in which way your scenario of usage StrictXmir is different from the scenarios in our tests -> can't reproduce the problem

@volodya-lombrozo
Copy link
Member Author

@maxonfjvipon Sure. I have the VerifiedEo class that uses the following construction:

final Collection<Defect> defects = new Program(new StrictXmir(res)).defects()
                .stream()
                .filter(defect -> defect.severity() == Severity.ERROR)
                .collect(Collectors.toList());

It's the exact place where the problem occurs. I create many VerifiedEo objects in parallel. I don't share VerifiedEo across threads though.

maxonfjvipon added a commit to maxonfjvipon/eo that referenced this issue Dec 25, 2024
maxonfjvipon added a commit to maxonfjvipon/eo that referenced this issue Dec 25, 2024
github-merge-queue bot pushed a commit that referenced this issue Dec 25, 2024
…ict-classpath

bug(#3760): Synchronized `StrictXmir`
@yegor256
Copy link
Member

@volodya-lombrozo try version 0.49.4 please

@volodya-lombrozo
Copy link
Member Author

@yegor256 Amazing news! We have managed to update eo:0.49.4 version in jeo-maven-plugin objectionary/jeo-maven-plugin#942

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants