simon-git: puzzles (main): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Thu Jan 6 09:05:21 GMT 2022


TL;DR:
  1600818 Try to fix flakiness in the NestedVM build.

Repository:     https://git.tartarus.org/simon/puzzles.git
On the web:     https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: main
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2022-01-06 09:05:21

commit 1600818848fc99eb53e0de240670b598ac490fdc
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=1600818848fc99eb53e0de240670b598ac490fdc;hp=b56c994b721f7cb5c5bcf09c5d695d4ae07d3052
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Jan 6 09:03:28 2022 +0000

    Try to fix flakiness in the NestedVM build.
    
    I've had a lot of Puzzles nightly builds fail recently in the NestedVM
    stage, with a 'jar' command producing a message along these lines:
    
    java.util.zip.ZipException: attempt to write past end of STORED entry
            at java.base/java.util.zip.ZipOutputStream.write(ZipOutputStream.java:337)
            at jdk.jartool/sun.tools.jar.Main.copy(Main.java:1250)
            at jdk.jartool/sun.tools.jar.Main.copy(Main.java:1263)
            at jdk.jartool/sun.tools.jar.Main.addFile(Main.java:1211)
            at jdk.jartool/sun.tools.jar.Main.create(Main.java:879)
            at jdk.jartool/sun.tools.jar.Main.run(Main.java:319)
            at jdk.jartool/sun.tools.jar.Main.main(Main.java:1681)
            Suppressed: java.util.zip.ZipException: invalid entry size (expected 0 but got 786 bytes)
                    at java.base/java.util.zip.ZipOutputStream.closeEntry(ZipOutputStream.java:288)
                    at java.base/java.util.zip.ZipOutputStream.finish(ZipOutputStream.java:361)
                    at java.base/java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:238)
                    at java.base/java.util.zip.ZipOutputStream.close(ZipOutputStream.java:378)
                    at jdk.jartool/sun.tools.jar.Main.create(Main.java:854)
                    ... 2 more
    
    It's hard to work out exactly what this error dump means, and
    web-searching for the error message isn't much help because the same
    exception can occur in application code using java.util.zip, and most
    mentions on the web are about that, and not about what I want to know,
    which is why it might happen in the 'jar' program in particular.
    
    However, the clues visible in that message suggest that 'jar' had
    somehow got confused about the size of one of the files it was adding
    to the jar archive, in that it initially decided it was 0 bytes long
    and later found it was longer. That suggests a problem of excessive
    parallelism between the build steps, perhaps due to a missing
    dependency in the makefile, which might plausibly cause the 'jar' step
    to be running already while some file it needs to read is still being
    written. (Which would also explain why it doesn't happen every time.)
    
    An eyeball review of cmake/platforms/nestedvm.cmake didn't find any
    obvious missing dependencies. But I vaguely remembered that in some
    other context I'd had trouble with cmake 'add_custom_command'. So in
    this commit I replace all those custom commands with custom _targets_,
    listing the previous OUTPUT files as BYPRODUCTS. And then the
    dependencies are written using the target names, instead of the file
    names.
    
    I don't fully understand why this should make a difference. But it
    seems more reliable in a soak test, and still builds the right things,
    so I'll commit it and see if it makes the flakiness in the actual
    nightly builds stop happening.

 cmake/platforms/nestedvm.cmake | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)



More information about the tartarus-commits mailing list