[jdk8u-dev] RFR: 8345358: Some DLL Files are missing Windows Properties
Alexey Bakhtin
abakhtin at openjdk.org
Tue Aug 19 18:35:42 UTC 2025
On Tue, 19 Aug 2025 05:31:10 GMT, Taizo Kurashige <tkurashige at openjdk.org> wrote:
>>> Hi, @alexeybakhtin The reported issue doesn't seem to be resolved yet. Would you please move forward with this pull request?
>>
>> There is a request to make a test. I'm not sure how to make jtreg test for this issue.
>
> Hi, @alexeybakhtin
>
> I propose the following code, which I made based on tkiriyama`s comment, as a test for this PR fix.
>
> jdk/test/lib/property/CheckWindowsProperty.java
>
> /*
> * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
> * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
> *
> * This code is free software; you can redistribute it and/or modify it
> * under the terms of the GNU General Public License version 2 only, as
> * published by the Free Software Foundation.
> *
> * This code is distributed in the hope that it will be useful, but WITHOUT
> * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
> * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
> * version 2 for more details (a copy is included in the LICENSE file that
> * accompanied this code).
> *
> * You should have received a copy of the GNU General Public License version
> * 2 along with this work; if not, write to the Free Software Foundation,
> * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
> *
> * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
> * or visit www.oracle.com if you need additional information or have any
> * questions.
> */
>
> /*
> * @test
> * @summary file property check for Windows .exe/.dll
> * @requires os.family == "windows"
> */
>
> import java.io.BufferedReader;
> import java.io.InputStreamReader;
>
> public class CheckWindowsProperty {
> public static void main(String[] args) throws Exception {
> String targetDir = System.getProperty("test.jdk") + "\";
> String psCommand = String.format(
> "Get-ChildItem -Path '%s' -include *.exe,*.dll -Recurse -File | " +
> "ForEach-Object { " +
> "$vi = $_.VersionInfo; " +
> "@($vi.FileName, $vi.CompanyName, $vi.FileDescription, $vi.FileVersion, " +
> "$vi.InternalName, $vi.Language, $vi.LegalCopyright, $vi.OriginalFilename, " +
> "$vi.ProductName, $vi.ProductVersion) -join ';'" +
> "}",
> targetDir
> );
>
> ProcessBuilder pb = new ProcessBuilder("powershell", "-NoLogo", "-NoProfile",
> "-Command", psCommand).redirectErrorStream(true);
> Process p = pb.start();
> p.getOutputStream().close();
>
> try (BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()))) {
> for (String line = br.readLine(); line != null; line = br.readLine()) {
> checkFileProperty(line);
> }
> }
> p.waitFor();
> int exitCode = p.exitValue();
> ...
Hi @kurashige23,
Thank you for the proposed test.
I have a small comment about freetype.dll and sawindbg.dll
I don't think it's correct that all the fields for these libraries should be empty. I tested several VMs from different vendors, and the fields are not always empty
I would suggest relaxing the test and allow empty fields for "freetype.dll" and"sawindbg.dll" libraries:
for (int i = 1; i < data.length; i++) {
if (data[i] == null || data[i].isEmpty()) {
if (!filename.equals("freetype.dll") && !filename.equals("sawindbg.dll")) {
throw new RuntimeException("data[" + i + "] should not be empty for " + filename);
}
}
}
I would also add
* @bug 8345358
to the header of the test
What do you think?
-------------
PR Comment: https://git.openjdk.org/jdk8u-dev/pull/611#issuecomment-3201779448
More information about the jdk8u-dev
mailing list