RFR: 8190753: (zipfs): Accessing a large entry (> 2^31 bytes) leads to a negative initial size for ByteArrayOutputStream
Jaikiran Pai
jai.forums2013 at gmail.com
Mon Jun 28 08:30:49 UTC 2021
Hello Alan,
On 28/06/21 1:00 pm, Alan Bateman wrote:
>
> I didn't study the test too closely but just to mention that tests with zip entries > 2GB can be problematic to test. The test will probably need the @requires tag to limit it to 64-bit systems and maybe some minimum memory size. It may also need testing on a wide range of systems to get some idea of run time. Test machines with spinning rust (HDDs) come to mind.
>
That's a good point and I had completely overlooked it. There's an
existing test test/jdk/java/util/zip/ZipFile/Zip64SizeTest.java
(unrelated to this issue) which uses a 5GB sized entry in the zips. In
fact, the idea of creating the zip entry in this manner was borrowed
from there. That one doesn't have any @requires for it. However, taking
a closer look at that existing test, that one just creates these large
entries but never loads (nor tries to load) those entries into memory
and probably explains why it doesn't need special care when it comes to
running the test.
I'll take a look at some other existing tests to see what kind of
@requires I can add here to make it a bit more selective on where it
gets run. Thank you for that input.
-Jaikiran
More information about the core-libs-dev
mailing list