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

Meta class registry corruption leads to stack overflow

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 4.0.7
    • None
    • None

    Description

      Consider the following:

      @groovy.transform.CompileStatic
      void test() {
        String.getMetaClass().methodName = {
          // ...
        }
        "foo".methodName()
      }
      

      After executing this, the ClassInfo registry contains an entry java.lang.String: {theClass: java.lang.Class, ...}.

      As additional Groovy code is executed, PojoMetaClassSite entries can fail cache check and create a new CallSite and it too fails cache check and so on until stack overflow.

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              emilles Eric Milles
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: