Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7115107

Wrong format specifiers PREDICTIONS_VERBOSE debug output

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 7
    • hotspot
    • gc
    • x86
    • linux_ubuntu

      FULL PRODUCT VERSION :
      Self-built version, hsx22-b06. The bug is in hsx23 too according to the mercurial web viewer.

      FULL OS VERSION :
      Linux gremio 2.6.38-12-generic #51-Ubuntu SMP Wed Sep 28 14:27:32 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux


      A DESCRIPTION OF THE PROBLEM :
      The format specifiers for the size_t sized parameters to the gclog_or_tty->print() function call when PREDICTIONS_VERBOSE is set to 1 are wrong. They are %d while they should be %zd according to C99 standard.
      (g1CollectorPolicy.cpp:1674 ff)

      THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Did not try

      THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile current sources with PREDICTIONS_VERBOSE set to 1.

      Run a reasonably large benchmark with -XX:+UseG1GC.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      The size_t values should be printed without wraparound at 32 bits on 64 bit machines.
      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
        Bugfix:

      E.g. from http://hg.openjdk.java.net/hsx/hsx23-gate/hotspot/file/fde2a39ed7f3/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp:

           1677 "REGIONS %d %d %d "
           1678 "PENDING_CARDS %d %d "
           1679 "CARDS_SCANNED %d %d "
           1680 "RS_LENGTHS %d %d "

      But should be

           1677 "REGIONS %zd %zd %zd "
           1678 "PENDING_CARDS %zd %zd "
           1679 "CARDS_SCANNED %zd %zd "
           1680 "RS_LENGTHS %zd %zd "

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: