Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-6303

[JDWP] Fix a potential crash problem that would happen if String object is GCed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 5.0M10
    • None
    • JDK
    • None
    • Patch Available

    Description

      I found there was a potential crash problem in StringReference command set, Value command. In the statement [1] as following shows, if the string object for which we are trying to read its ID has been GCed actually, the string ID we retrieved would be null as a result. Hence if we pass the null value to the follwing jni invocations [2], crash would happen. The solution is that we should return the error code to the upper level when the string object is GCed in this case.

      [1] jstring stringObject = m_cmdParser->command.ReadStringID(jni);

      [2] jsize len = jni->GetStringLength(stringObject);
      jsize utfLen = jni->GetStringUTFLength(stringObject);

      Attachments

        1. HARMONY-6303.diff
          0.9 kB
          Jim Yu

        Activity

          People

            Unassigned Unassigned
            junjie0122 Jim Yu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: