Skip to content

Conversation

@RealCLanger
Copy link
Contributor

@RealCLanger RealCLanger commented Jan 26, 2025

This basically reverts 78e35ea to restore old behavior with regards to headless handling on Windows.


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-8348625 needs maintainer approval

Issue

  • JDK-8348625: [21u, 17u] Revert JDK-8185862 to restore old java.awt.headless behavior on Windows (Bug - P2 - Approved)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1359

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 26, 2025

👋 Welcome back clanger! 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 Jan 26, 2025

@RealCLanger This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8348625: [21u, 17u] Revert JDK-8185862 to restore old java.awt.headless behavior on Windows

Reviewed-by: sgehwolf

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 9 new commits pushed to the master branch:

  • 95e4bc9: 8332494: java/util/zip/EntryCount64k.java failing with java.lang.RuntimeException: '\A\Z' missing from stderr
  • 83b8d31: 8343378: Exceptions in javax/management DeadLockTest.java do not cause test failure
  • ce188fd: 8327986: ASAN reports use-after-free in DirectivesParserTest.empty_object_vm
  • fe77607: 8328387: Convert java/awt/Frame/FrameStateTest/FrameStateTest.html applet test to main
  • c0242c7: 8327098: GTest needs larger combination limit
  • c8d993d: 8315486: vmTestbase/nsk/jdwp/ThreadReference/ForceEarlyReturn/forceEarlyReturn002/forceEarlyReturn002.java timed out
  • be245be: 8347129: cpuset cgroups controller is required for no good reason
  • 5d21a2b: 8347965: (tz) Update Timezone Data to 2025a
  • 554292a: 8211851: (ch) java/nio/channels/AsynchronousSocketChannel/StressLoopback.java times out (aix)

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 26, 2025
@mlbridge
Copy link

mlbridge bot commented Jan 26, 2025

Webrevs

Copy link
Contributor

@jerboaa jerboaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Differences to a revert of 78e35ea are:

  • src/java.desktop/share/classes/java/awt/GraphicsEnvironment.java unused import isn't back re-introduced. OK
  • src/java.desktop/windows/classes/sun/awt/Win32GraphicsEnvironment.java extra space in comment not back re-introduced. OK.
  • src/java.desktop/windows/native/libawt/windows/awt_Win32GraphicsDevice.cpp: VERIFY statements kept. Basically an assert, which should be fine.
  • src/java.desktop/windows/native/libawt/windows/awt_Win32GraphicsEnv.cpp the return in the failure case is not re-introduced. We are done with the method anyway. OK.

Seems fine to me. But it would be good if a windows person could take a look and test it as well. @fthevenet perhaps?

@jerboaa
Copy link
Contributor

jerboaa commented Jan 27, 2025

@RealCLanger Please fix the title mismatch. Thanks!

@fthevenet
Copy link
Member

@jerboaa I'm going to look into reverting the changes made to our internal test infra following the introduction of the original patch in 17.0.12 and verify the tests that failed at the time now pass with this PR.

@jerboaa
Copy link
Contributor

jerboaa commented Jan 28, 2025

@jerboaa I'm going to look into reverting the changes made to our internal test infra following the introduction of the original patch in 17.0.12 and verify the tests that failed at the time now pass with this PR.

Thanks. Since this is a 21u-dev PR it should be tested by the tests prior to the 21.0.4 release (which introduced this regression).

@RealCLanger RealCLanger changed the title 8348625: [21u, 17u, 11u] Revert JDK-8185862 to restore old java.awt.headless behavior on Windows 8348625: [21u, 17u] Revert JDK-8185862 to restore old java.awt.headless behavior on Windows Jan 28, 2025
@fthevenet
Copy link
Member

Of course, you're right. What I really meant to say was introduced in the July 24 update (21.0.4 and 17.0.12).

@openjdk
Copy link

openjdk bot commented Jan 28, 2025

⚠️ @RealCLanger This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@RealCLanger
Copy link
Contributor Author

RealCLanger commented Jan 28, 2025

I fixed the title and I added an exclusion of the test jdk/java/awt/font/JNICheck/FreeTypeScalerJNICheck.java for Windows debug builds because these could bring up the assertions in headless test environments.

This kind:
*********************
AWT Assertion Failure
*********************
hBM != 0
File '...\\openjdk-21u-dev-windows_x86_64-dbg\\jdk\\src\\java.desktop\\windows\\native\\libawt\\windows\\awt_Win32GraphicsDevice.cpp', at line 185 GetLastError() is 6 : The handle is invalid.

Do you want to break into the debugger?
*********************

Copy link
Contributor

@jerboaa jerboaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.

@fthevenet
Copy link
Member

I figured a quick and easy way to reproduce the issue locally, by using this srvany clone to run a sample swing application as a Windows service.
When running this with a 21.0.3 JDK, the application runs but fails in 21.0.6 with a java.awt.HeadlessException, as expected.
When attempting the same thing with an image that includes this PR, the application runs again.

@jerboaa
Copy link
Contributor

jerboaa commented Jan 28, 2025

When attempting the same thing with an image that includes this PR, the application runs again.

Thanks for testing it, @fthevenet!

@openjdk openjdk bot added approval Requires approval; will be removed when approval is received ready Pull request is ready to be integrated and removed approval Requires approval; will be removed when approval is received labels Jan 30, 2025
@RealCLanger
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Jan 31, 2025

Going to push as commit e1967d5.
Since your change was applied there have been 10 commits pushed to the master branch:

  • b79136f: 8347427: JTabbedPane/8134116/Bug8134116.java has no license header
  • 95e4bc9: 8332494: java/util/zip/EntryCount64k.java failing with java.lang.RuntimeException: '\A\Z' missing from stderr
  • 83b8d31: 8343378: Exceptions in javax/management DeadLockTest.java do not cause test failure
  • ce188fd: 8327986: ASAN reports use-after-free in DirectivesParserTest.empty_object_vm
  • fe77607: 8328387: Convert java/awt/Frame/FrameStateTest/FrameStateTest.html applet test to main
  • c0242c7: 8327098: GTest needs larger combination limit
  • c8d993d: 8315486: vmTestbase/nsk/jdwp/ThreadReference/ForceEarlyReturn/forceEarlyReturn002/forceEarlyReturn002.java timed out
  • be245be: 8347129: cpuset cgroups controller is required for no good reason
  • 5d21a2b: 8347965: (tz) Update Timezone Data to 2025a
  • 554292a: 8211851: (ch) java/nio/channels/AsynchronousSocketChannel/StressLoopback.java times out (aix)

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jan 31, 2025
@openjdk openjdk bot closed this Jan 31, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jan 31, 2025
@openjdk
Copy link

openjdk bot commented Jan 31, 2025

@RealCLanger Pushed as commit e1967d5.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants