United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7039447 java profiling is broken in build 139 (garbage in function name)
JDK-7039447 : java profiling is broken in build 139 (garbage in function name)

Details
Type:
Bug
Submit Date:
2011-04-25
Status:
Closed
Updated Date:
2011-07-29
Project Name:
JDK
Resolved Date:
2011-05-16
Component:
hotspot
OS:
generic
Sub-Component:
jvmti
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
hs21
Fixed Versions:
hs21 (b12)

Related Reports
Backport:

Sub Tasks

Description
To reproduce a problem.

% uname -a
SunOS gellman 5.10 Generic_141445-09 i86pc i386 i86pc


   Copy sources to your directory and run make:
% cd /tmp
% ( cd 
/shared/dp/sstrunk/latest/inst/intel-S2/examples/analyzer; tar cf - jsynprog ) | tar xf -
% cd jsynprog

% /usr/ccs/bin/make all 'CCTYPE=DEFAULT' 'COMP_BIN=/shared/dp/sstrunk/latest/inst/intel-S2/bin' 'WSIZE=32'  'JAVABIN=/java/re/jdk/7/promoted/all/b139/binaries/solaris-amd64/bin' 'JCOPTS=' 'OPTS=-V  -O  -g -xdebugformat=dwarf' 'LD=/usr/ccs/bin/ld'
% /shared/dp/sstrunk/latest/inst/intel-S2/bin/collect  -v  -j on -p on /java/re/jdk/7/promoted/all/b139/binaries/solaris-amd64/bin/java -server jsynprog


 Run collect:
% /shared/dp/sstrunk/latest/inst/intel-S2/bin/collect  -v  -j on -p on /java/re/jdk/7/promoted/all/b139/binaries/solaris-amd64/bin/java -server jsynprog


 See a map file in experiment:
% grep name test.1.er/map.xml  | grep % | sed 's/^.*name=/name=/'
name="SafepointBlob%40%0xf902d660" />
name="SafepointBlob%40%0xf902d860" />
name="DeoptimizationBlob%40%0xf902da80" />
name="UncommonTrapBlob%40%0xf902c700" />
name="I2C/C2I adapters%28%%29%%40%0xf902cb40" />
name="I2C/C2I adapters%28%0x0000000a%29%%40%0xf902ca40" />
name="I2C/C2I adapters%28%0x00000abe%29%%40%0xf902c900" />
name="I2C/C2I adapters%28%0x0000abea%29%%40%0xf9034700" />
name="I2C/C2I adapters%28%0x000000aa%29%%40%0xf9034800" />
name="I2C/C2I adapters%28%0x0000aaaa0x000000aa%29%%40%0xf9034900" />
name="I2C/C2I adapters%28%0x0000aaaa%29%%40%0xf9034a40" />
name="I2C/C2I adapters%28%0x00000aaa%29%%40%0xf9034b40" />
name="I2C/C2I adapters%28%0x0000aaaa0x0000000a%29%%40%0xf9034c40" />
name="I2C/C2I adapters%28%0x0000aaaa0x0000aaaa0x0000aaaa%29%%40%0xf9034d80" />
name="I2C/C2I adapters%28%0x0000aaaa0x0000aaaa%29%%40%0xf9034f00" />
name="I2C/C2I adapters%28%0x0000aaaa0x0000aaaa0x0000000a%29%%40%0xf9035040" />
name="I2C/C2I adapters%28%0x0000aaaa0x00000aaa%29%%40%0xf9035180" />
name="I2C/C2I adapters%28%0x0000007e%29%%40%0xf903aa40" />
name="I2C/C2I adapters%28%0x00000006%29%%40%0xf903a900" />
name="I2C/C2I adapters%28%0x000000be%29%%40%0xf903b140" />
name="I2C/C2I adapters%28%0x00000bea%29%%40%0xf90436c0" />
name="I2C/C2I adapters%28%0x0000aaaa0x000000be%29%%40%0xf90437c0" />
name="I2C/C2I adapters%28%0x00000aa6%29%%40%0xf9043900" />
name="I2C/C2I adapters%28%0x00000066%29%%40%0xf9043a00" />
name="I2C/C2I adapters%28%0x000000a6%29%%40%0xf9043b00" />
name="I2C/C2I adapters%28%0x00000a7e%29%%40%0xf9043c00" />
name="I2C/C2I adapters%28%0x0000abeb0x000000ea%29%%40%0xf9043d00" />
name="I2C/C2I adapters%28%0x0000aabe0x00000bea%29%%40%0xf9043e40" />
name="I2C/C2I adapters%28%0x0000abeb0x0000000e%29%%40%0xf9043f80" />
name="I2C/C2I adapters%28%0x0000aabe0x0000007e%29%%40%0xf90440c0" />
name="I2C/C2I adapters%28%0x0000aaa70x0000000e%29%%40%0xf90441c0" />
name="I2C/C2I adapters%28%0x0000abe70x0000000e%29%%40%0xf90442c0" />
name="I2C/C2I adapters%28%0x0000aabe%29%%40%0xf90443c0" />
name="I2C/C2I adapters%28%0x0000aaa6%29%%40%0xf90444c0" />
name="I2C/C2I adapters%28%0x0000abe6%29%%40%0xf90445c0" />
name="I2C/C2I adapters%28%0x0000aabe0x00000006%29%%40%0xf90446c0" />
name="I2C/C2I adapters%28%0x0000aaab0x0000000e%29%%40%0xf90447c0" />
name="I2C/C2I adapters%28%0x0000aabe0x000000be%29%%40%0xf9044900" />
name="I2C/C2I adapters%28%0x0000aabe0x0000000a%29%%40%0xf9044a40" />
name="I2C/C2I adapters%28%0x0000abeb0x00000ebe%29%%40%0xf9044b80" />
name="I2C/C2I adapters%28%0x0000aabe0x0000abeb0x0000000e%29%%40%0xf9044cc0" />
name="I2C/C2I adapters%28%0x0000aabe0x000000aa%29%%40%0xf9044e00" />
name="I2C/C2I adapters%28%0x0000aabe0x0000bebe%29%%40%0xf9044f40" />
name="I2C/C2I adapters%28%0x0000067e%29%%40%0xf9045080" />
name="I2C/C2I adapters%28%0x00007e7e%29%%40%0xf9045180" />
name="I2C/C2I adapters%28%0x0000006a%29%%40%0xf9045280" />
name="I2C/C2I adapters%28%0x000007ea%29%%40%0xf9045380" />
name="I2C/C2I adapters%28%0x0000bebe%29%%40%0xf9045480" />
name="I2C/C2I adapters%28%0x0000aa7e%29%%40%0xf90455c0" />
name="I2C/C2I adapters%28%0x0000aa66%29%%40%0xf90456c0" />
name="I2C/C2I adapters%28%0x0000aa660x0000000a%29%%40%0xf90457c0" />
name="I2C/C2I adapters%28%0x00000be6%29%%40%0xf90458c0" />
name="I2C/C2I adapters%28%0x0000be7e%29%%40%0xf90459c0" />
name="I2C/C2I adapters%28%0x0000beab0x00000ebe%29%%40%0xf9045ac0" />
name="I2C/C2I adapters%28%0x0000beab0x0000ebeb0x0000000e%29%%40%0xf9045c00" />
name="I2C/C2I adapters%28%0x0000abeb0x0000ebeb0x0000000e%29%%40%0xf9045d80" />
name="I2C/C2I adapters%28%0x0000aa7e0x0000000a%29%%40%0xf9045f00" />
name="I2C/C2I adapters%28%0x0000be7e0x0000000a%29%%40%0xf9046000" />
name="I2C/C2I adapters%28%0x0000be6a%29%%40%0xf9046100" />
name="I2C/C2I adapters%28%0x0000aa6a%29%%40%0xf9046200" />
name="I2C/C2I adapters%28%0x0000bebe0x0000000a%29%%40%0xf9046300" />
name="I2C/C2I adapters%28%0x0000beaa%29%%40%0xf9046440" />
name="I2C/C2I adapters%28%0x0000aaaa0x0000aaaa0x000000aa%29%%40%0xf9046d40" />
name="I2C/C2I adapters%28%0x0000abeb0x0000ebea%29%%40%0xf9046ec0" />
name="I2C/C2I adapters%28%0x0000abeb0x0000ebea%29%%40%0xf9046ec0" />
name="I2C/C2I adapters%28%0x0000aabe0x0000bebe0x0000000a%29%%40%0xf9047000" />
name=",9%df%%fc%%8c%9%df%%fc%%fc%_%06%%08%%de%9%e0%%b4%%b8%" />
name="I2C/C2I adapters%28%0x0000bebe0x0000beaa0x0000000a%29%%40%0xf9047140" />
name="I2C/C2I adapters%28%0x0000bebe0x0000beaa0x0000000a%29%%40%0xf9047140" />
name="I2C/C2I adapters%28%0x0000abea0x000000aa%29%%40%0xf9047280" />
name="I2C/C2I adapters%28%0x0000beaa0x0000000a%29%%40%0xf90473c0" />
name="I2C/C2I adapters%28%0x0000beaa0x0000000a%29%%40%0xf90473c0" />
name="I2C/C2I adapters%28%0x0000beaa0x0000000a%29%%40%0xf90473c0" />
name="I2C/C2I adapters%28%0x0000abea0x0000000a%29%%40%0xf9047500" />
name="I2C/C2I adapters%28%0x0000a7ea0x0000000a%29%%40%0xf9047640" />
name="I2C/C2I adapters%28%0x0000a7ea0x0000000a%29%%40%0xf9047640" />
name="I2C/C2I adapters%28%0x0000a7ea0x0000000a%29%%40%0xf904764%01%" />
name="I2C/C2I adapters%28%0x0000aa7e0x000000aa%29%%40%0xf9047740" />
name="I2C/C2I adapters%28%0x0000aa7e0x000000aa%29%%40%0xf904774%01%" />
name="I2C/C2I adapters%28%0x0000aaaa0x0000aabe%29%%40%0xf9047840" />
name="I2C/C2I adapters%28%0x0000aaaa0x0000aabe%29%%40%0xf9047840" />
name="I2C/C2I adapters%28%0x00007e7e0x00007e7e%29%%40%0xf9047980" />
name="I2C/C2I adapters%28%0x00007e7e0x00007e7e%29%%40%0xf904798%01%" />
name="ExceptionBlob%40%0xf9047e00" />

                                    

Comments
EVALUATION

The fix for the following bug:

    7017640 2/3 Fix for 6766644 deadlocks on some NSK tests when
                running with -Xcomp

moved the posting of DynamicCodeGenerated events from the
originating thread to the ServiceThread. This move assumes
that the "name" of the DynamicCodeGenerated event is stable,
but it may not be.
                                     
2011-04-26
EVALUATION

Deferring reporting DynamicCodeGenerated events may also affect quality of performance profiles as such dynamic code may have been asynchronously sampled before the profiling tool is aware of its existence.
                                     
2011-04-26
EVALUATION

The reason for deferring the DynamicCodeGeneration event was to
prevent a deadlock. In my opinion, not deadlocking the VM is a
higher priority quality goal.

The reason for having compiler related events posted by the
ServiceThread is because these events require a real JavaThread
and the CompilerThread is not a real JavaThread. The JVM/TI
spec permits event handlers for most JVM/TI events to do things
like load classes and the CompilerThread cannot load classes.
                                     
2011-04-26
EVALUATION

Deferred DynamicCodeGeneration events need to make a copy
of the event name because they don't know when the caller
will free the name after the event is queued and control
is returned to the event posting client code.
                                     
2011-04-27
SUGGESTED FIX

See attached 7039447-webrev-cr0.tgz file for the proposed fix.
                                     
2011-04-27
SUGGESTED FIX

See attached 7039447-webrev-cr1.tgz file for the proposed fix
after revisions from code review round 0.
                                     
2011-04-28
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot/rev/0cddebc420d8
                                     
2011-04-28
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot/hotspot/rev/0cddebc420d8
                                     
2011-05-04



Hardware and Software, Engineered to Work Together