You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2022/11/09 18:24:00 UTC

[jira] [Updated] (GROOVY-10819) Meta class registry corruption leading to stack overflow

     [ https://issues.apache.org/jira/browse/GROOVY-10819?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Milles updated GROOVY-10819:
---------------------------------
    Description: 
Consider the following:
{code:groovy}
String.metaClass.methodName = {
  // ...
}
"foo".methodName()
{code}

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.

  was:
Consider the following:
{code:groovy}
String.metaClass.methodName = {
  // ...
}
"foo".methodName()
{code}

After executing this, the {{ClassInfo}} registry contains an entry String: \{theClass: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.


> Meta class registry corruption leading to stack overflow
> --------------------------------------------------------
>
>                 Key: GROOVY-10819
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10819
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Critical
>
> Consider the following:
> {code:groovy}
> String.metaClass.methodName = {
>   // ...
> }
> "foo".methodName()
> {code}
> 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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)