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 20:06:00 UTC

[jira] [Resolved] (GROOVY-10819) Meta class registry corruption leads to stack overflow

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

Eric Milles resolved GROOVY-10819.
----------------------------------
    Resolution: Fixed

https://github.com/apache/groovy/commit/f27cca94a6a4f97ea5e4d14e2d20f713ae132b1e

> Meta class registry corruption leads 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}
> @groovy.transform.CompileStatic
> void test() {
>   String.getMetaClass().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)