Skip to content

Conversation

@Karm
Copy link
Contributor

@Karm Karm commented Mar 2, 2025

Removed objectweb.asm for bytecode manipulation and uses JEP 484 classfile API.

Test passes on Linux amd64 so far:

TIME=`date +%s`;
mkdir -p test.${TIME}/jdk/JTwork test.${TIME}/jdk/JTreport; 
jtreg -a -ignore:quiet -w:test.${TIME}/jdk/JTwork -r:test.${TIME}/jdk/JTreport -jdk:/home/karm/workspaceRH/jdk/build/linux-x86_64-server-release/images/graal-builder-jdk/ /home/karm/workspaceRH/jdk/test/jdk/java/awt/Headless/

Test results: passed: 15

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

Issue

  • JDK-8349099: java/awt/Headless/HeadlessMalfunctionTest.java fails on CI with Compilation error (Bug - P3)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23852/head:pull/23852
$ git checkout pull/23852

Update a local copy of the PR:
$ git checkout pull/23852
$ git pull https://git.openjdk.org/jdk.git pull/23852/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 23852

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23852.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 2, 2025

👋 Welcome back Karm! 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 Mar 2, 2025

@Karm 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:

8349099: java/awt/Headless/HeadlessMalfunctionTest.java fails on CI with Compilation error

Reviewed-by: aivanov, sgehwolf, prr

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 52 new commits pushed to the master branch:

  • 64464ea: 8351673: Clean up a case of if (LockingMode == LM_LIGHTWEIGHT) in a legacy-only locking mode function
  • 9a49418: 8345940: Migrate security-related resources from Java classes to properties files
  • e71f327: 8351045: ClassValue::remove cannot ensure computation observes up-to-date state
  • cef3693: 8351656: Problemlist gc/TestAllocHumongousFragment#generational
  • da2b4f0: 8351606: Use build_platform for graphviz dependency
  • 030c85d: 8350106: [PPC] Avoid ticks_unknown_not_Java AsyncGetCallTrace() if JavaFrameAnchor::_last_Java_pc not set
  • 0ad9a10: 8351146: JFR: JavaMonitorInflate event should default to no threshold and be disabled
  • b957e5e: 8351322: Parameterize link option for pthreads
  • af9af7e: 8351145: RISC-V: only enable some crypto intrinsic when AvoidUnalignedAccess == false
  • 83de340: 8343789: Move mutable nmethod data out of CodeCache
  • ... and 42 more: https://git.openjdk.org/jdk/compare/7c9a7840ea75a9a7df3f240d063e9833f535e6ec...master

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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@jerboaa, @prrace, @aivanov-jdk) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@Karm
Copy link
Contributor Author

Karm commented Mar 2, 2025

@jerboaa FYI

@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 2, 2025
@openjdk
Copy link

openjdk bot commented Mar 2, 2025

@Karm The following label will be automatically applied to this pull request:

  • client

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the client client-libs-dev@openjdk.org label Mar 2, 2025
@mlbridge
Copy link

mlbridge bot commented Mar 2, 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.

I can confirm the test compiles and runs fine. I've reverted JDK-8336382 locally - product code only - and verified the test fails as expected. So +1 on the fix.

There is pre-existing code in the test harness, which can get removed now --add-opens java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED.

@prrace
Copy link
Contributor

prrace commented Mar 2, 2025

Once bitten and all that .. I'd like to run this through our internal test system before it is pushed.

@Karm
Copy link
Contributor Author

Karm commented Mar 2, 2025

Thanks.

@prrace
Copy link
Contributor

prrace commented Mar 3, 2025

The test fails on Windows and macOS. In other words it passes only on Linux.

stdout: [Transforming java.awt.GraphicsEnvironment.
isHeadless removed from java.awt.GraphicsEnvironment.
];
stderr: [WARNING: package jdk.internal.org.objectweb.asm not in java.base
Exception in thread "main" java.lang.NoSuchMethodError: 'boolean java.awt.GraphicsEnvironment.isHeadless()'
at java.desktop/sun.lwawt.macosx.LWCToolkit.(LWCToolkit.java:155)
at java.desktop/sun.awt.PlatformGraphicsInfo.createToolkit(PlatformGraphicsInfo.java:43)
at java.desktop/java.awt.Toolkit.getDefaultToolkit(Toolkit.java:580)
at java.desktop/sun.awt.CGraphicsEnvironment.(CGraphicsEnvironment.java:72)
at java.desktop/sun.awt.PlatformGraphicsInfo.createGE(PlatformGraphicsInfo.java:39)
at java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:89)
at java.desktop/java.awt.GraphicsEnvironment$LocalGE.(GraphicsEnvironment.java:80)
at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:102)
at HeadlessMalfunctionTest$Runner.main(HeadlessMalfunctionTest.java:69)
]
exitValue = 1

java.lang.RuntimeException: 'FATAL ERROR in native method: GetStaticMethodID isHeadless failed' missing from stdout/stderr
at jdk.test.lib.process.OutputAnalyzer.shouldContain(OutputAnalyzer.java:253)
at HeadlessMalfunctionTest.main(HeadlessMalfunctionTest.java:62)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
at java.base/java.lang.Thread.run(Thread.java:1447)

JavaTest Message: Test threw exception: java.lang.RuntimeException: 'FATAL ERROR in native method: GetStaticMethodID isHeadless failed' missing from stdout/stderr
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.lang.RuntimeException: 'FATAL ERROR in native method: GetStaticMethodID isHeadless failed' missing from stdout/stderr

I see you did not remove the add-opens for "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED"

@Karm
Copy link
Contributor Author

Karm commented Mar 4, 2025

I've got my aarch64 MacMini building it and I can see that too. Gonna wire it to ci before future contributions.

Output and diagnostic info for process 76543 was saved into 'pid-76543-output.log'
Command line: [/Users/karm/tmp/JENKINS_DEMO_RUN/jdk/build/macosx-aarch64-server-release/images/graal-builder-jdk/bin/java -cp /Users/karm/tmp/JENKINS_DEMO_RUN/jdk/jtreg_results/jdk/JTwork/classes/java/awt/Headless/HeadlessMalfunctionTest.d:/Users/karm/tmp/JENKINS_DEMO_RUN/jdk/test/jdk/java/awt/Headless:/Users/karm/tmp/JENKINS_DEMO_RUN/jdk/jtreg_results/jdk/JTwork/classes/test/lib:/Users/karm/tmp/JENKINS_DEMO_RUN/jdk/test/lib:/Users/karm/tmp/JENKINS_DEMO_RUN/jtreg/build/images/jtreg/lib/javatest.jar:/Users/karm/tmp/JENKINS_DEMO_RUN/jtreg/build/images/jtreg/lib/jtreg.jar --add-opens java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED -javaagent:agent.jar HeadlessMalfunctionTest$Runner ]
[2025-03-03T23:51:31.832863Z] Gathering output for process 76544
[2025-03-03T23:51:31.832992Z] Waiting for completion for process 76544
[2025-03-03T23:51:32.309606Z] Waiting for completion finished for process 76544
Output and diagnostic info for process 76544 was saved into 'pid-76544-output.log'
----------System.err:(29/2012)----------
 stdout: [Transforming java.awt.GraphicsEnvironment.
isHeadless removed from java.awt.GraphicsEnvironment.
];
 stderr: [WARNING: package jdk.internal.org.objectweb.asm not in java.base
Exception in thread "main" java.lang.NoSuchMethodError: 'boolean java.awt.GraphicsEnvironment.isHeadless()'
	at java.desktop/sun.lwawt.macosx.LWCToolkit.<clinit>(LWCToolkit.java:155)
	at java.desktop/sun.awt.PlatformGraphicsInfo.createToolkit(PlatformGraphicsInfo.java:43)
	at java.desktop/java.awt.Toolkit.getDefaultToolkit(Toolkit.java:580)
	at java.desktop/sun.awt.CGraphicsEnvironment.<clinit>(CGraphicsEnvironment.java:72)
	at java.desktop/sun.awt.PlatformGraphicsInfo.createGE(PlatformGraphicsInfo.java:39)
	at java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:89)
	at java.desktop/java.awt.GraphicsEnvironment$LocalGE.<clinit>(GraphicsEnvironment.java:80)
	at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:102)
	at HeadlessMalfunctionTest$Runner.main(HeadlessMalfunctionTest.java:69)
]
 exitValue = 1

I realxed the output matching in the test as the log comes from a different code path on MacOS. Gonna take a look at Windows too...

@openjdk
Copy link

openjdk bot commented Mar 6, 2025

@Karm 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.

@Karm
Copy link
Contributor Author

Karm commented Mar 7, 2025

I am running the Windows, Mac and Linux CI now, will post links to test results when it completes...

@prrace
Copy link
Contributor

prrace commented Mar 7, 2025

I ran your tests, and now windows and mac pass, but Linux now fails
test result: Error. can't find jdk.test.lib.helpers.ClassFileInstaller in test directory or libraries

@prrace
Copy link
Contributor

prrace commented Mar 7, 2025

I ran your tests, and now windows and mac pass, but Linux now fails test result: Error. can't find jdk.test.lib.helpers.ClassFileInstaller in test directory or libraries

Oh. I see you just updated to fix this a few hours ago. I'll re-run.

@Karm
Copy link
Contributor Author

Karm commented Mar 7, 2025

@prrace @jerboaa

Given the different code path MacOS and Windows take to initialize the affected isHeadless part, I propose excluding Windows and MacOS from the test.

Mere relaxing the test, parsing only for "isHeadless" string in the error message, makes little sense, because such test passes both on Windows and MacOS regardless of the JDK-8336382 #20169 patch.

The current state of the PR passes test/jdk/java/awt/Headless dir on these platforms:

  • 🟢 Windows amd64, 14 PASS 1 SKIPPED (this one) REPORT, LOGS
  • 🟢 MacOS aarch64: 14 PASS 1 SKIPPED (this one) REPORT, LOGS
  • 🟢 Linux amd64: 15 PASS REPORT, LOGS
  • 🟢 Linux aarch64: 15 PASS REPORT, LOGS

@prrace I will keep using this CI I established for my future client libs contributions, to aviod platform surprises...

@prrace
Copy link
Contributor

prrace commented Mar 7, 2025

Excluding on windows and mac should be OK

@prrace
Copy link
Contributor

prrace commented Mar 7, 2025

I'll hold off re-running the tests until you have updated the PR with the exclusions.

* @summary Test that in absence of isHeadless method, the JDK throws a meaningful error message.
* @library /test/lib
* @modules java.base/jdk.internal.org.objectweb.asm
* @requires os.family == "linux"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@prrace

I'll hold off re-running the tests until you have updated the PR with the exclusions.

Doesn't this bit do the exclusion? I found out about it looking at other tests...

My Windows says:

Test results: passed: 14; did not meet platform requirements: 1
Report written to C:\workspace\workspace\mandrel-jdk-build-matrix\LABEL\w2k19\jdk\jtreg_results\jdk\JTreport\html\report.html
Results written to C:\workspace\workspace\mandrel-jdk-build-matrix\LABEL\w2k19\jdk\jtreg_results\jdk\JTwork

and MacOS also:

Test results: passed: 14; did not meet platform requirements: 1
Report written to /Users/tester/jenkins/workspace/mandrel-jdk-build-matrix/LABEL/macos_aarch64/jdk/jtreg_results/jdk/JTreport/html/report.html
Results written to /Users/tester/jenkins/workspace/mandrel-jdk-build-matrix/LABEL/macos_aarch64/jdk/jtreg_results/jdk/JTwork

Copy link
Contributor

Choose a reason for hiding this comment

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

yes it does, I thought you had not done that yet.

Copy link
Contributor

@prrace prrace left a comment

Choose a reason for hiding this comment

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

testing looks OK

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 11, 2025
Copy link
Member

@aivanov-jdk aivanov-jdk left a comment

Choose a reason for hiding this comment

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

The initial year in the copyright should be preserved; and a second one is to be added if there's no second year, or the second year needs to be bumped to the current year.

Other than that, it looks good.

@Karm
Copy link
Contributor Author

Karm commented Mar 11, 2025

Thanks for the review jerboaa, prrace.

@aivanov-jdk thx, amended the headers

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Mar 11, 2025
@Karm
Copy link
Contributor Author

Karm commented Mar 11, 2025

/integrate

@openjdk openjdk bot added ready Pull request is ready to be integrated sponsor Pull request is ready to be sponsored labels Mar 11, 2025
@openjdk
Copy link

openjdk bot commented Mar 11, 2025

@Karm
Your change (at version 27fdef7) is now ready to be sponsored by a Committer.

@aivanov-jdk
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Mar 11, 2025

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

  • 64464ea: 8351673: Clean up a case of if (LockingMode == LM_LIGHTWEIGHT) in a legacy-only locking mode function
  • 9a49418: 8345940: Migrate security-related resources from Java classes to properties files
  • e71f327: 8351045: ClassValue::remove cannot ensure computation observes up-to-date state
  • cef3693: 8351656: Problemlist gc/TestAllocHumongousFragment#generational
  • da2b4f0: 8351606: Use build_platform for graphviz dependency
  • 030c85d: 8350106: [PPC] Avoid ticks_unknown_not_Java AsyncGetCallTrace() if JavaFrameAnchor::_last_Java_pc not set
  • 0ad9a10: 8351146: JFR: JavaMonitorInflate event should default to no threshold and be disabled
  • b957e5e: 8351322: Parameterize link option for pthreads
  • af9af7e: 8351145: RISC-V: only enable some crypto intrinsic when AvoidUnalignedAccess == false
  • 83de340: 8343789: Move mutable nmethod data out of CodeCache
  • ... and 42 more: https://git.openjdk.org/jdk/compare/7c9a7840ea75a9a7df3f240d063e9833f535e6ec...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Mar 11, 2025

@aivanov-jdk @Karm Pushed as commit 1dd9cf1.

💡 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

client client-libs-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants