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

[drlvm][jvmti] Lack of synchronization in GetLoadedClasses and GetClassLoaderClasses may cause VM to crash

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 5.0M4
    • 5.0M4
    • DRLVM
    • None
    • Patch Available
    • Novice

    Description

      Recent runs of jdktools show unstable tests that sometimes crash in GetLoadedClasses function. The reason is that the number of reported classes from classloader tables is bigger than memory allocated for them. It happens because some classes may be loaded between the count of loaded classes it known and filling up the reported array. In debug mode assertion "number == count" often fails for this reason ("count" is the number of classes determined for allocating memory, "number" is the number of actually reported classes).

      Attached patch adds synchronization to these functions. Tests work stably for me now. I would really like to commit this fix in M4, so marking this bug as M4.

      Attachments

        1. patch
          3 kB
          Gregory Shimansky

        Activity

          People

            gshimansky Gregory Shimansky
            gshimansky Gregory Shimansky
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: