JDK-6326015 : HPROF: format=b timestamp is incorrect
  • Type: Bug
  • Component: tools
  • Sub-Component: hprof
  • Affected Version: 6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-09-19
  • Updated: 2010-04-02
  • Resolved: 2005-12-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0u7 b01Fixed
Related Reports
Relates :  
Description
The timestamp in the format=b output is incorrect, the jlong arithmetic calculation can cause some problems due to a C compiler bug.

Comments
EVALUATION Make sure the time stamp in the hprof file is a gettimeofday stamp, and make sure the jlong casts insure proper arithmetic promotions (some issues with C compiler in this area). See suggested fix.
29-09-2005

SUGGESTED FIX ######### File: ./hprof_md.c ######### (cd . && sccs diffs -C -w -s -b hprof_md.c) ------- hprof_md.c ------- *** /tmp/sccs.T2ayOl Wed Sep 28 18:23:27 2005 --- hprof_md.c Wed Sep 28 18:22:43 2005 *************** *** 243,249 **** jlong md_get_timemillis(void) { ! return md_millisecs(); } jlong --- 243,254 ---- jlong md_get_timemillis(void) { ! struct timeval tv; ! ! (void)gettimeofday(&tv, (void *)0); ! /*LINTED*/ ! return (jlong)(((jlong)tv.tv_sec * (jlong)1000) + ! ((jlong)tv.tv_usec / (jlong)1000)); } jlong
29-09-2005