United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7162063 libsaproc debug print should format size_t correctly on 64bit platform
JDK-7162063 : libsaproc debug print should format size_t correctly on 64bit platform

Details
Type:
Bug
Submit Date:
2012-04-17
Status:
Resolved
Updated Date:
2013-04-30
Project Name:
JDK
Resolved Date:
2012-05-04
Component:
hotspot
OS:
linux
Sub-Component:
svc
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
hs23
Fixed Versions:
hs24 (b09)

Related Reports
Backport:
Backport:

Sub Tasks

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

ok
                                     
2012-04-23
EVALUATION

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

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

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



Hardware and Software, Engineered to Work Together