Hi Tomas,

The fix looks good.
Thank you for discovering, tracking down and fixing the issue!

Thanks,
Serguei

On 6/28/13 6:29 AM, Tomas Hurka wrote:
Hi All,
I would like to ask for review of JDK-8009204 
<http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8009204>

Description of the problem:
jstack() returns corrupted method signatures on Solaris. The issue can be 
easily reproduce using the following DTrace script:

dtrace -x jstackstrsize=2048 -Z \
        -n 'hotspot_jni$target::: /0/{}' \
        -n 'syscall::write:entry /pid==$target/{jstack(1024)}' \
        -c 'java -version'

With Java 6, the output is roughly:

              java/io/FileOutputStream.writeBytes([BII)V
              java/io/FileOutputStream.write([BII)V
              java/io/BufferedOutputStream.flushBuffer()V
              java/io/BufferedOutputStream.flush()V
              java/io/PrintStream.write([BII)V

With Java 7 and Java 8, the output is roughly:

              java/io/FileOutputStream.riteBytes
              java/io/FileOutputStream.rite
              java/io/BufferedOutputStream.lushBuffer
              java/io/BufferedOutputStream.lush
              java/io/PrintStream.rite

Evaluation:
The problem is caused by SymbolTable changes JDK-6990754. jhelper.d was never 
updated with changes for CPSlot, so the low bit of the address of the Symbol is 
set, which causes the off by 1-ness of the output. The klass name uses a 
untagged constant pool entry, which is why it doesn't have the problem in the 
output. There is a very similar bug JDK-7019165 reported against pstack output 
and the proposed fix is basically backport of JDK-7019165 to jhelper.d.

Webrev:
<http://cr.openjdk.java.net/~thurka/8009204/webrev.00/>

I tested the fix using above D-script on latest JDK 8 and JDK 7u sources.
Thanks,
--
Tomas Hurka   <mailto:[email protected]>
NetBeans Profiler http://profiler.netbeans.org
VisualVM http://visualvm.java.net
Software Developer
Oracle, Praha Czech Republic


Reply via email to