RFR: 8263054: [testbug] SharedArchiveConsistency.java reuses jsa files
Ioi Lam
iklam at openjdk.java.net
Fri Mar 5 21:16:07 UTC 2021
On Fri, 5 Mar 2021 05:05:05 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> SharedArchiveConsistency.java runs a child process with a JSA file. Then, it modifies the JSA file, and then reuses this same JSA file to run another child process.
>>
>> However, on Windows, after first child process has exited, some sort of file lock is still held on the JSA file, so when we try to modify the JSA file for the second process, sometimes we get the "The requested operation cannot be performed on a file with a user-mapped section open" error.
>>
>> The fix is to always create a new JSA file for every new test case, and never modify/reuse the JSA files. (We have been following this rule for other CDS tests).
>
> test/hotspot/jtreg/runtime/cds/appcds/SharedArchiveConsistency.java line 293:
>
>> 291: }
>> 292: newJsaFile.createNewFile();
>> 293: Files.copy(orgJsaFile.toPath(), newJsaFile.toPath(), REPLACE_EXISTING);
>
> Not clear why you need to create the file if you are going to immediately replace it.
I removed the call to createNewFile and it seems to work just fine. I don't remember why the call was there before. I'll do more testing before integrating.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2839
More information about the hotspot-runtime-dev
mailing list