Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-8230

Deadlock in GroovyClassLoader

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5.0-beta-1
    • 2.5.0-beta-2
    • None
    • None

    Description

      The GroovyClassLoader.clearCache() method can deadlock when another thread is creating a new instance of a class. The clearCache() method locks the classCache, then when removing the class, through the InvokerHelper, locks the ClassInfo object. When a new instance is created that instance can lock the ClassInfo object first, then later request the lock for the classCache (This happens when requesting the entry getClassCacheEntry). If the timing between the two threads is unlucky a deadlock can occur.

      Relevant stack trace attached.

      Groovy: 2.4.10 groovy-all-2.4.10-indy.jar
      Java: JRE 8u73_64

      Attachments

        1. GroovyClassLoaderDeadlock.txt
          4 kB
          Joel Bredeson

        Issue Links

          Activity

            People

              jwagenleitner John Wagenleitner
              jbredeson Joel Bredeson
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: