JDK-7162063 : libsaproc debug print should format size_t correctly on 64bit platform
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc
  • Affected Version: hs23
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: generic
  • Submitted: 2012-04-17
  • Updated: 2013-06-26
  • Resolved: 2012-05-04
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.
JDK 7 JDK 8 Other
7u40Fixed 8Fixed hs24Fixed
Description
See 7133111 for some background.

Unfortunatly the fix for 7133111 was incorrect. The correct format specifier should be "zu" for a size_t (not "zd") since size_t is unsigned.

Suggested change:

--- a/agent/src/os/linux/ps_core.c
+++ b/agent/src/os/linux/ps_core.c
@@ -440,7 +440,7 @@
       int j = 0;
       print_debug("---- sorted virtual address map ----\n");
       for (j = 0; j < ph->core->num_maps; j++) {
-        print_debug("base = 0x%lx\tsize = %zd\n", ph->core->map_array[j]->vaddr,
+        print_debug("base = 0x%lx\tsize = %zu\n", ph->core->map_array[j]->vaddr,
                                          ph->core->map_array[j]->memsz);
       }
    }

Comments
EVALUATION http://hg.openjdk.java.net/lambda/lambda/hotspot/rev/29ee40a082d3
29-06-2012

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-main/hotspot/rev/29ee40a082d3
02-05-2012

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/29ee40a082d3
23-04-2012

EVALUATION ok
23-04-2012