Request for review 7053130: hs_err file does not record specified CLASSPATH

Krystal Mo krystal.mo at oracle.com
Tue Oct 16 14:25:16 PDT 2012


Hi Harold,

I'm okay with the change as-is, but wonder if this is a good-enough 
tradeoff when Java agents are in the picture.

There's a method in Java agent that could change the effective system 
class path, namely 
java.lang.instrument.Instrumentation.appendToSystemClassLoaderSearch(JarFile 
file). It's ultimately implemented by 
JvmtiEnv::AddToSystemClassLoaderSearch(const char* segment), in 
prims/jvmtiEng.cpp. As you can see from the example of this function, 
the effective system class path doesn't have to be the one stored in 
Arguments::_java_class_path; in fact, after java.lang.System class is 
initialized, the copy in Arguments::_java_class_path doesn't matter anymore.
I'd like to hear other people's opinion on this issue.

Nitpicking: Why did you use PropertyList_get_value() to get the value of 
_java_class_path, instead of just calling _java_class_path->value()?
If you're going to use PropertyList_get_value() then you don't need to 
do the null check upfront because PropertyList_get_value() does that for 
you already.

- Kris

On 2012/10/17 4:43, harold seigel wrote:
> Summary:  Added code to write the value of the java.class.path 
> property to the hs_err file.  The new text in the hs_err file would 
> look like this:
>
>                  ...
>     VM Arguments:
>     jvm_args: -XX:+CrashGCForDumpingJavaThread
>     java_command: Queens
>     java_class_path: .:/root/dir:/home
>     Launcher Type: SUN_STANDARD
>
>     Environment Variables:
>     JAVA_HOME=/java/udrt/jdk1.8.0/
>     CLASSPATH=.:/home/:/some/where
>                       ....
>
>
> Open webrev at http://cr.openjdk.java.net/~coleenp/Bug7053130 
> <http://cr.openjdk.java.net/%7Ecoleenp/Bug7053130>
>
> Bug link at http://bugs.sun.com/view_bug.do?bug_id=7053130
>
> Tested by generating hs_err files and looking at their contents.
>
> Thanks, Harold
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20121017/809d7b64/attachment.html 


More information about the hotspot-runtime-dev mailing list