On Tue, 25 Jan 2022 22:07:37 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:

> It's possible for an address to be in the codecache but not in any CodeBlob. 
> Don't assert in this case.
> 
> Also I ran into a couple of other asserts listed below. It looks like since 
> dumping the threadcontext can result in using PointerFinder with fairly 
> random addresses, it is doing a much better job of stress testing 
> PointerFinder than is done by other tests. The root issue in all these 
> asserts is that a random address in the codecache can either be outside of 
> any CodeBlob, or can map to a CodeBlob that is not yet initialized or could 
> even have been freed. PointerFinder and PointerLocation need to be prepared 
> to handled these asserts, and any other exception thrown. 
> 
> sun.jvm.hotspot.utilities.AssertionFailure: found wrong CodeBlob
> at jdk.hotspot.agent/sun.jvm.hotspot.utilities.Assert.that(Assert.java:32)
> at 
> jdk.hotspot.agent/sun.jvm.hotspot.code.CodeCache.findBlobUnsafe(CodeCache.java:140)
> at 
> jdk.hotspot.agent/sun.jvm.hotspot.utilities.PointerFinder.find(PointerFinder.java:138)
> at 
> jdk.hotspot.agent/sun.jvm.hotspot.runtime.JavaThread.printThreadContextOn(JavaThread.java:493)
> at 
> jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor$46.doit(CommandProcessor.java:1702)
> at 
> jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor.executeCommand(CommandProcessor.java:2215)
> at 
> jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor.executeCommand(CommandProcessor.java:2185)
> at 
> jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor.run(CommandProcessor.java:2056)
> at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.run(CLHSDB.java:112)
> at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.main(CLHSDB.java:44)
> at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runCLHSDB(SALauncher.java:281)
> at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:500)
> 
> sun.jvm.hotspot.utilities.AssertionFailure: Should have found CodeBlob
> at jdk.hotspot.agent/sun.jvm.hotspot.utilities.Assert.that(Assert.java:32)
> at 
> jdk.hotspot.agent/sun.jvm.hotspot.utilities.PointerFinder.find(PointerFinder.java:140)
> at 
> jdk.hotspot.agent/sun.jvm.hotspot.runtime.JavaThread.printThreadContextOn(JavaThread.java:493)
> at 
> jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor$46.doit(CommandProcessor.java:1702)
> at 
> jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor.executeCommand(CommandProcessor.java:2215)
> at 
> jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor.executeCommand(CommandProcessor.java:2185)
> at 
> jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor.run(CommandProcessor.java:2056)
> at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.run(CLHSDB.java:112)
> at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.main(CLHSDB.java:44)
> at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runCLHSDB(SALauncher.java:281)
> at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:500)

This pull request has now been integrated.

Changeset: 85d839fb
Author:    Chris Plummer <cjplum...@openjdk.org>
URL:       
https://git.openjdk.java.net/jdk/commit/85d839fb4f3f820d130ea95f9a54ae137a95c20a
Stats:     34 lines in 2 files changed: 20 ins; 5 del; 9 mod

8280601: ClhsdbThreadContext.java test is triggering codecache related asserts

Reviewed-by: kevinw, sspitsyn

-------------

PR: https://git.openjdk.java.net/jdk/pull/7217

Reply via email to