Skip to content

Conversation

alexeybakhtin
Copy link
Contributor

@alexeybakhtin alexeybakhtin commented Dec 10, 2024

Add missing properties for the j2gss.dll and sspi_bridge.dll files


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • JDK-8345358 needs maintainer approval

Issue

  • JDK-8345358: Some DLL Files are missing Windows Properties (Bug - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk8u-dev.git pull/611/head:pull/611
$ git checkout pull/611

Update a local copy of the PR:
$ git checkout pull/611
$ git pull https://git.openjdk.org/jdk8u-dev.git pull/611/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 611

View PR using the GUI difftool:
$ git pr show -t 611

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk8u-dev/pull/611.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 10, 2024

👋 Welcome back abakhtin! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Dec 10, 2024

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 10, 2024
@mlbridge
Copy link

mlbridge bot commented Dec 10, 2024

Webrevs

@alexeybakhtin
Copy link
Contributor Author

CI Failures are not related to the changes.

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 8, 2025

@alexeybakhtin This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@alexeybakhtin
Copy link
Contributor Author

Keep it open

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 5, 2025

@alexeybakhtin This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@alexeybakhtin
Copy link
Contributor Author

Please review

@mrserb
Copy link
Member

mrserb commented Feb 25, 2025

Is it possible to create a new test to verify this change?

@tkiriyama
Copy link
Member

Thank you for fixing.
I found this bug by verifying some Windows Properties of the .dll and .exe files in the binary with the PowerShell and reported it to JBS.

powershell -ExecutionPolicy Remotesigned .\PropsList.ps1 .\jdk
  • PropsList.ps1
$path = $Args[0]

$files = Get-ChildItem -Path $path -include *.exe,*.dll -Recurse

foreach($f in $files) {

  $out = $f.VersionInfo.FileName

  $out += ";" + $f.VersionInfo.LegalCopyright
  $out += ";" + $f.VersionInfo.CompanyName
  $out += ";" + $f.VersionInfo.FileDescription
  $out += ";" + $f.VersionInfo.FileVersion
  $out += ";" + $f.VersionInfo.ProductName
  $out += ";" + $f.VersionInfo.ProductVersion
  
  Write-Host $out
}

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 2, 2025

@alexeybakhtin This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@tkiriyama
Copy link
Member

This fix should be integrated.

@bridgekeeper
Copy link

bridgekeeper bot commented May 8, 2025

@alexeybakhtin This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@mrserb
Copy link
Member

mrserb commented May 9, 2025

keep open

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 6, 2025

@alexeybakhtin This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@tkiriyama
Copy link
Member

/touch

@openjdk
Copy link

openjdk bot commented Jun 16, 2025

@tkiriyama The pull request is being re-evaluated and the inactivity timeout has been reset.

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 14, 2025

@alexeybakhtin This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@tkiriyama
Copy link
Member

Hi, @alexeybakhtin
The reported issue doesn't seem to be resolved yet. Would you please move forward with this pull request?

@alexeybakhtin
Copy link
Contributor Author

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.

@kurashige23
Copy link
Member

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();
    if (exitCode != 0) {
        throw new RuntimeException("ExitCode is " + exitCode + ". PowerShell command failed.");
    }
  }

  static void checkFileProperty(String line) {
    // line format
    // FileName;CompanyName;FileDescription;FileVersion;InternalName;Language;LegalCopyright;
    // OriginalFilename;ProductName;ProductVersion
    String[] data = line.split(";", -1);
    String filename = data[0].substring(data[0].lastIndexOf(System.getProperty("file.separator")) + 1);

    // skip Microsoft redist dll
    if (filename.startsWith("api-ms-win") ||
        filename.startsWith("msvcp") ||
        filename.startsWith("ucrtbase") ||
        filename.startsWith("vcruntime")) {
        return;
    }

    if (filename.equals("freetype.dll") || filename.equals("sawindbg.dll")) {
        for (int i = 1; i < data.length; i++) {
            if (data[i] == null || !data[i].isEmpty()) {
                throw new RuntimeException(data[i] +" is set in data[" + i + "]. data[" + i + "] should be empty for " + filename);
            }
        }
    } else {
        for (int i = 1; i < data.length; i++) {
            if (data[i] == null || data[i].isEmpty()) {
                throw new RuntimeException("data[" + i + "] should not be empty for " + filename);
            }
        }
    }
  }
}

I confirmed that the test result is as follows:

when this PR fix is not applied

FAILED: lib/property/CheckWindowsProperty.java
Test results: failed: 1
----------System.err:(13/752)----------
java.lang.RuntimeException: data[1] should not be empty for j2gss.dll
	at CheckWindowsProperty.checkFileProperty(CheckWindowsProperty.java:88)
	at CheckWindowsProperty.main(CheckWindowsProperty.java:54)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:312)
	at java.lang.Thread.run(Thread.java:750)

when this PR fixis applied

Passed: lib/property/CheckWindowsProperty.java
Test results: passed: 1

I hope this is helpful.

@alexeybakhtin
Copy link
Contributor Author

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?

@kurashige23
Copy link
Member

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:

Thank you for checking with VMs from other vendors. I understand that the "freetype.dll" and "sawindbg.dll" properties change depending on the vendor, so I agree with your suggestion.

I would also add

* @bug 8345358

to the header of the test

I think it's good.

@openjdk
Copy link

openjdk bot commented Aug 20, 2025

@alexeybakhtin Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information.

@alexeybakhtin
Copy link
Contributor Author

@mrserb @tkiriyama could you please review the test provided by @kurashige23

@tkiriyama
Copy link
Member

LGTM.
@mrserb
Could you please confirm before ramp down phase on August 29?

@alexeybakhtin
Copy link
Contributor Author

alexeybakhtin commented Aug 25, 2025

LGTM. @mrserb Could you please confirm before ramp down phase on August 29?

@mrserb could you please approve the review? Without it, I can not make a fix request. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

4 participants