Skip to content

Conversation

@plummercj
Copy link
Contributor

@plummercj plummercj commented Jan 23, 2025

If you run hotspot with -XX:+DeoptimizeObjectsALot, it will create one or more DeoptimizeObjectsALotThread threads. This is one of many JavaThread subclasses that SA needs to know about, but in this case it does not. When SA tries to create a mirror of one of these threads, it fails with:

 stderr: [java.lang.RuntimeException: Unable to deduce type of thread from address 0x0000ffff34144e30 (expected type JavaThread, CompilerThread, MonitorDeflationThread, AttachListenerThread, StringDedupThread, NotificationThread, ServiceThread or JvmtiAgentThread)
at jdk.hotspot.agent/sun.jvm.hotspot.runtime.Threads.createJavaThreadWrapper(Threads.java:196)
at jdk.hotspot.agent/sun.jvm.hotspot.runtime.Threads.getJavaThreadAt(Threads.java:178)

The following can be used to reproduce this failure. Most SA tests will fail:

make test TEST=serviceability/sa TEST_VM_OPTS=-XX:+DeoptimizeObjectsALot

I had to move the native DeoptimizeObjectsALotThread declaration to compileBroker.hpp to make it visible to vmStructs.cpp.

I tested with the above "make test" command and ran all svc tier1, tier2, tier3, and tier5 tests.


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-8348239: SA does not know about DeoptimizeObjectsALotThread (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 23279

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 23, 2025

👋 Welcome back cjplummer! 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 23, 2025

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

8348239: SA does not know about DeoptimizeObjectsALotThread

Reviewed-by: kevinw, dlong, dholmes, lmesnik

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

  • dec9367: 8347498: JDK 24 RDP2 L10n resource files update
  • bef5f56: 8291027: Some of TimeZone methods marked 'synchronized' unnecessarily
  • 8e8f800: 8344943: Mark not subclassable classes final in java.base exported classes
  • 76f792b: 8348203: [JVMCI] Make eager JVMCI initialization observable in the debugger
  • 909cef5: 8339891: Several sun/security/ssl/SSLSessionImpl/* tests override test.java.opts
  • 56a1877: 8348170: Unnecessary Hashtable usage in CSS.styleConstantToCssMap
  • 9768f60: 8345249: Apply some conservative cleanups in FileURLConnection
  • c5a69b6: 8331723: Serial: Remove the unused parameter of the method SerialHeap::gc_prologue
  • 9c55e25: 8347981: RISC-V: Add Zfa zli imm loads
  • e20bd01: 8344361: Restore null return for invalid services from legacy providers
  • ... and 53 more: https://git.openjdk.org/jdk/compare/7a6ff9206a0a4d116dec542819d51daa558d200d...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.

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

@openjdk openjdk bot changed the title 8348239 8348239: SA does not know about DeoptimizeObjectsALotThread Jan 23, 2025
@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 23, 2025
@openjdk
Copy link

openjdk bot commented Jan 23, 2025

@plummercj The following labels will be automatically applied to this pull request:

  • hotspot
  • serviceability

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

@openjdk openjdk bot added serviceability serviceability-dev@openjdk.org hotspot hotspot-dev@openjdk.org labels Jan 23, 2025
@mlbridge
Copy link

mlbridge bot commented Jan 23, 2025

Webrevs

public boolean isServiceThread() { return false; }
public boolean isMonitorDeflationThread() { return false; }
public boolean isAttachListenerThread() { return false; }
public boolean isDeoptimizeObjectsALotThread() { return false; }
Copy link
Member

Choose a reason for hiding this comment

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

Is this method used anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, but I added it to be consistent with all the other JavaThread subclasses. Actually none of these are used except for isCompilerThread and isCodeCacheSweeperThread. The latter reference is irrelevant since there is no longer a CodeCacheSweeperThread, and the former reference should be replaced with isHiddenFromExternalView(). These are all things documented to fix as part of JDK-8348347, but in the meantime I though it best to be consistent with existing code.

Copy link
Member

@dean-long dean-long left a comment

Choose a reason for hiding this comment

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

Overall the changes seem fine, however it would be nice if the vmStructs.cpp registration mechanism was modular and extensible, instead of monolithic. That would make it easier to register private types, or even types outside of libjvm.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 23, 2025
@plummercj
Copy link
Contributor Author

Overall the changes seem fine, however it would be nice if the vmStructs.cpp registration mechanism was modular and extensible, instead of monolithic. That would make it easier to register private types, or even types outside of libjvm.

I'm not too sure what you are suggesting here.

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Okay as a quick fix but I look forward to all this going away.

Thanks

StringDedupThread, AttachListenerThread and ServiceThread.
The latter seven subclasses of the former. Most operations
StringDedupThread, AttachListenerThread, DeoptimizeObjectsALotThread and
ServiceThread. The latter seven subclasses of the former. Most operations
Copy link
Contributor

Choose a reason for hiding this comment

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

The latter eight are subclasses of the former? 8-) Or just "JavaThread, or its subclasses..."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it should be updated to eight, but I think what would be better is "returns objects of type JavaThraed or one of its subclasses..."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, it's fixed now. I stuck with a somewhat minimal update mostly just to resolve the incorrect count. This comment may have further cleanup as part of JDK-8348347.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Jan 24, 2025
@dean-long
Copy link
Member

Overall the changes seem fine, however it would be nice if the vmStructs.cpp registration mechanism was modular and extensible, instead of monolithic. That would make it easier to register private types, or even types outside of libjvm.

I'm not too sure what you are suggesting here.

For example, instead of a single table, allow multiple tables. They could be registered with with an API similar to JNI RegisterNatives.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 24, 2025
@plummercj
Copy link
Contributor Author

Overall the changes seem fine, however it would be nice if the vmStructs.cpp registration mechanism was modular and extensible, instead of monolithic. That would make it easier to register private types, or even types outside of libjvm.

I'm not too sure what you are suggesting here.

For example, instead of a single table, allow multiple tables. They could be registered with with an API similar to JNI RegisterNatives.

I don't see how that relates to this change. It sounds more like a general suggestion to overhaul of how vmStructs is implemented.

@dean-long
Copy link
Member

I don't see how that relates to this change. It sounds more like a general suggestion to overhaul of how vmStructs is implemented.

It relates because if something like that was available then we could register types that are local to a .cpp file without moving them to a .hpp first.

@plummercj
Copy link
Contributor Author

Thanks for the reviews David, Leonid, Dean, and Kevin

/integrate

@openjdk
Copy link

openjdk bot commented Jan 27, 2025

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

  • 8cc1304: 8287788: Implement a better allocator for downcalls
  • 039e73f: 8346736: Java Security Standard Algorithm Names spec should include key algorithm names
  • aba60a9: 8189441: Define algorithm names for keys derived from KeyAgreement
  • 03106eb: 8344119: CUPSPrinter does not respect PostScript printer definition specification in case of reading ImageableArea values from PPD files
  • ad01dfb: 8346920: Serial: Support allocation in old generation when heap is almost full
  • 1d8ccb8: 8342465: Improve API documentation for java.lang.classfile
  • 7d6055a: 8348429: Update cross-compilation devkits to Fedora 41/gcc 13.2
  • f1e0797: 8348586: Optionally silence make warnings about non-control variables
  • ffeb9b5: 8342807: Update links in java.base to use https://
  • afcc2b0: 8348562: ZGC: segmentation fault due to missing node type check in barrier elision analysis
  • ... and 75 more: https://git.openjdk.org/jdk/compare/7a6ff9206a0a4d116dec542819d51daa558d200d...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jan 27, 2025

@plummercj Pushed as commit 21feef3.

💡 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

hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated serviceability serviceability-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

5 participants