Bug 1214835

Summary: [regression] HPROF: output truncated when using doe=n option
Product: Red Hat Enterprise Linux 6 Reporter: Ondřej Komárek <okomarek>
Component: java-1.7.0-openjdkAssignee: Andrew John Hughes <ahughes>
Status: CLOSED ERRATA QA Contact: Lukáš Zachar <lzachar>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.6CC: ahughes, dbhole, dkutalek, esammons, mbukatov, sbaiduzh, sgehwolf
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: java-1.7.0-openjdk-1.7.0.79-2.5.5.4.el6 Doc Type: Bug Fix
Doc Text:
Due to a regression, the Java Heap/CPU Profiling Tool (HPROF) produced truncated output when used with the "doe=n" argument. Consequently, the output file contained only the header, the data was missing. A patch has been applied, and the output of HPROF is now correct when using "doe=n".
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-22 05:54:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
patch containing fix to the issue. none

Description Ondřej Komárek 2015-04-23 15:51:37 UTC
Created attachment 1018052 [details]
patch containing fix to the issue.

Description of problem:
----------------------

Output of java profiling tool hprof is being truncated when used with argument "doe=n". This argument should define wheter output should be written over time or at end of java program.


Version-Release number of selected component (if applicable):
------------------------------------------------------------

This issue is probably present in all versions of Java starting from May 2007 when Sun released most of its Java source code as free software. 

I used jdk1.7.0_51 and jdk1.6.0_31

How reproducible:
----------------
100%


Steps to Reproduce:
------------------
There are more ways how to run hproftool, I will describe just one:

1. Set hprof argument "doe" to "n", eg.: export JAVA_TOOL_OPTIONS="-Xrunhprof:thread=y,force=n,doe=n,file=/home/my_user/my-hprof-output.txt"
2. Run some java job, eg.: java example
3. collect output, compare it to one runned with "doe=y"

Actual results:
--------------

Output file is truncated when using argument "doe=n". Output file contains just header, relevant data is missing. File is much smaller.


Expected results:
----------------

HPROF tool should produce same output regardless "doe" argument setting.


Additional info:
---------------

This issue has been reported and fixed in 2003, but fix was somehow lost. Please see original bug report: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4890063

Check for description of hprof: http://docs.oracle.com/javase/7/docs/technotes/samples/hprof.html

There is a patch for this issue in attachment.

affected file should be in: src/share/demo/jvmti/hprof/hprof_init.c

Comment 9 errata-xmlrpc 2015-07-22 05:54:43 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2015-1245.html