RFR: 8020962: dump loaded java classes when vm crash

David Holmes david.holmes at oracle.com
Sun Aug 11 22:56:29 PDT 2013


Hi Yumin,

Note that the SA is only present in a full JDK, not a JRE (full or 
compact profile).

I have quite a few concerns with this:

We already do a lot of things that are not valid to be done from a 
signal handling context but this really takes that to an extreme. Doing 
fork-exec from a signal handler seems like a recipe for disaster (Note 
the existing onError facility is typically used for synchronous failures.)

The idea of launching a second VM to try and query a VM that has crashed 
also seems somewhat problematic:
- What mechanism will the SA try to use to query the VM?
- What if the state of the crashed VM stops the SA from being able to 
attach properly (ie both processes hang)?
- What if it the SA also crashes, will it launch a third VM then a 
fourth etc?

Also what is the nature of this dump? How big is it? Where will it go?

Thanks,
David

On 12/08/2013 9:36 AM, Yumin Qi wrote:
> Hi, all
>
>    I would like to have your review for
>
> http://cr.openjdk.java.net/~minqi/8020962/webrev0/
> <http://cr.openjdk.java.net/%7Eminqi/8020962/webrev0/>
>
> Description: When JVM crashed, we also want to check the application
> class files especially we got core file from customers.  The aftermath
> analysis will benefit from all loaded java classes available. In this
> change, spawn another process running SA to do the job when JVM crashes,
> this way also avoid further messing up with the error report which
> already in
> signal handler.
>
> Note: The test has done with following two bugs worked around:
>    8022655: ClassDump ignored jarStream setting (This will be fixed and
> integrated by Kevin Walls soon)
>    8011888: sa.js: TypeError: [object JSAdapter] has no such function
> "__has__" (Not know when it will be integrated)
>    That is, without those two fixed, the jars of loaded classes will not
> be successfully dumped.
>    Also, on MacOS it requires security access permission to attach to
> another process, so omit doing so. To get loaded jar file
> s, with core file available (on all platforms), one can (only after this
> change) do
>
>    $JAVA_HOME/bin/java [-d64] -cp $JAVA_HOME/lib/sa-jdi.jar
> sun.jvm.hotspot.DumpLoadedClasses $JAVA_HOME/bin/java corefile
>
>
> Thanks
> Yumin


More information about the hotspot-runtime-dev mailing list