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

JAVA_CRW_DEMO: two bugs in demo\jvmti\java_crw_demo\src\java_crw_demo.c

    XMLWordPrintable

    Details

    • Subcomponent:
    • Introduced In Version:
      5.0
    • Resolved In Build:
      b01
    • CPU:
      x86
    • OS:
      windows_xp

      Backports

        Description

        FULL PRODUCT VERSION :
        1.6.0-rc-b64

        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows XP [Version 5.1.2600]
        All OS.

        A DESCRIPTION OF THE PROBLEM :
        the static void write_instruction(MethodImage *mi) C functions has two bugs :

        at line 1428 :

                 case JVM_OPC_goto:
                                    new_opcode = JVM_OPC_jsr_w;
        has to be replaced by
                 case JVM_OPC_goto:
                                    new_opcode = JVM_OPC_goto_w;

        At line 1493 when writing the new goto offset :
                          writeU4(ci, new_delta); /* write new and wide delta */

        must be replaced by
                           writeU4(ci, new_delta - 3); /* write new and wide delta */

        since the correct new offset is now new_delta - 3 and not new_delta.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :

        One easy way to reproduce the bug is to modify the line 1282 (adjust_instruction function).

        For example replace
        if ((new_delta < -32768) || (new_delta > 32767)) {
        by

        if ((new_delta < -16) || (new_delta > 15)) {

        to force call to widen() function.


        REPRODUCIBILITY :
        This bug can be reproduced always.

        CUSTOMER SUBMITTED WORKAROUND :
        See description<

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  ohair Kelly Ohair (Inactive)
                  Reporter:
                  ndcosta Nelson Dcosta
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: