marytts / gradle-marytts-voicebuilding-plugin

A replacement for the legacy VoiceImportTools in MaryTTS
http://mary.dfki.de/
GNU General Public License v3.0
16 stars 12 forks source link

Seemingly random CI failures with java.lang.LinkageError #145

Open psibre opened 3 years ago

psibre commented 3 years ago

Somewhat unpredictably, we're seeing random CI failures with this error:

    org.gradle.api.GradleException: Could not inject synthetic classes.
        at org.gradle.initialization.DefaultLegacyTypesSupport.injectEmptyInterfacesIntoClassLoader(DefaultLegacyTypesSupport.java:91)
        at org.gradle.testfixtures.internal.ProjectBuilderImpl.getGlobalServices(ProjectBuilderImpl.java:161)
        at org.gradle.testfixtures.internal.ProjectBuilderImpl.createProject(ProjectBuilderImpl.java:106)
        at org.gradle.testfixtures.ProjectBuilder.build(ProjectBuilder.java:120)
        at org.gradle.testfixtures.ProjectBuilder$build$0.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:119)
        at de.dfki.mary.voicebuilding.VoiceLicenseExtensionTest.setup(VoiceLicenseExtensionTest.groovy:12)

        Caused by:
        java.lang.RuntimeException: java.lang.LinkageError: loader 'app' attempted duplicate interface definition for org.gradle.api.internal.DynamicObject. (org.gradle.api.internal.DynamicObject is in unnamed module of loader 'app')
            at org.gradle.internal.classloader.ClassLoaderUtils$AbstractClassLoaderLookuper.invoke(ClassLoaderUtils.java:150)
            at org.gradle.internal.classloader.ClassLoaderUtils$LookupClassDefiner.defineClass(ClassLoaderUtils.java:204)
            at org.gradle.internal.classloader.ClassLoaderUtils.define(ClassLoaderUtils.java:78)
            at org.gradle.initialization.DefaultLegacyTypesSupport.injectEmptyInterfacesIntoClassLoader(DefaultLegacyTypesSupport.java:88)
            ... 8 more

            Caused by:
            java.lang.LinkageError: loader 'app' attempted duplicate interface definition for org.gradle.api.internal.DynamicObject. (org.gradle.api.internal.DynamicObject is in unnamed module of loader 'app')
                at java.base/java.lang.ClassLoader.defineClass1(Native Method)
                at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
                at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:878)
                at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:710)
                at org.gradle.internal.classloader.ClassLoaderUtils$AbstractClassLoaderLookuper.invoke(ClassLoaderUtils.java:148)
                ... 11 more

Stfw for this only brings up an old bug that was fixed in Gradle v3.0.

psibre commented 3 years ago

Example CI failures:

psibre commented 3 years ago

The stacktrace above is thrown by

Gradle suite > Gradle test > de.dfki.mary.voicebuilding.VoiceLicenseExtensionTest > setup FAILED

The other one by

 Gradle suite > Gradle test > de.dfki.mary.voicebuilding.VoiceExtensionTest > setup FAILED
    java.lang.LinkageError: loader (instance of  sun/misc/Launcher$AppClassLoader): attempted  duplicate class definition for name: "org/gradle/api/internal/DynamicObject"
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:635)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
        at org.gradle.internal.classloader.ClassLoaderUtils$ReflectionClassDefiner.defineClass(ClassLoaderUtils.java:173)
        at org.gradle.internal.classloader.ClassLoaderUtils.define(ClassLoaderUtils.java:78)
        at org.gradle.initialization.DefaultLegacyTypesSupport.injectEmptyInterfacesIntoClassLoader(DefaultLegacyTypesSupport.java:88)
        at org.gradle.testfixtures.internal.ProjectBuilderImpl.getGlobalServices(ProjectBuilderImpl.java:161)
        at org.gradle.testfixtures.internal.ProjectBuilderImpl.createProject(ProjectBuilderImpl.java:106)
        at org.gradle.testfixtures.ProjectBuilder.build(ProjectBuilder.java:120)
        at org.gradle.testfixtures.ProjectBuilder$build$0.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:119)
        at de.dfki.mary.voicebuilding.VoiceExtensionTest.setup(VoiceExtensionTest.groovy:12)

Maybe something about the way the extensions are implemented is triggering random regressions...? But it's odd that this never appeared before we migrated to GitHub Actions, and now only there...

psibre commented 3 years ago

Another one in https://github.com/marytts/gradle-marytts-voicebuilding-plugin/runs/3059997671?check_suite_focus=true#step:8:233:

 Gradle suite > Gradle test > de.dfki.mary.voicebuilding.VoiceExtensionTest > setup FAILED
    org.gradle.api.GradleException: Could not inject synthetic classes.
        at org.gradle.initialization.DefaultLegacyTypesSupport.injectEmptyInterfacesIntoClassLoader(DefaultLegacyTypesSupport.java:91)
        at org.gradle.testfixtures.internal.ProjectBuilderImpl.getGlobalServices(ProjectBuilderImpl.java:161)
        at org.gradle.testfixtures.internal.ProjectBuilderImpl.createProject(ProjectBuilderImpl.java:106)
        at org.gradle.testfixtures.ProjectBuilder.build(ProjectBuilder.java:120)
        at org.gradle.testfixtures.ProjectBuilder$build$0.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:119)
        at de.dfki.mary.voicebuilding.VoiceExtensionTest.setup(VoiceExtensionTest.groovy:12)

        Caused by:
        java.lang.RuntimeException: java.lang.LinkageError: loader 'app' attempted duplicate interface definition for org.gradle.api.internal.DynamicObject. (org.gradle.api.internal.DynamicObject is in unnamed module of loader 'app')
            at org.gradle.internal.classloader.ClassLoaderUtils$AbstractClassLoaderLookuper.invoke(ClassLoaderUtils.java:150)
            at org.gradle.internal.classloader.ClassLoaderUtils$LookupClassDefiner.defineClass(ClassLoaderUtils.java:204)
            at org.gradle.internal.classloader.ClassLoaderUtils.define(ClassLoaderUtils.java:78)
            at org.gradle.initialization.DefaultLegacyTypesSupport.injectEmptyInterfacesIntoClassLoader(DefaultLegacyTypesSupport.java:88)
            ... 8 more

            Caused by:
            java.lang.LinkageError: loader 'app' attempted duplicate interface definition for org.gradle.api.internal.DynamicObject. (org.gradle.api.internal.DynamicObject is in unnamed module of loader 'app')
                at java.base/java.lang.ClassLoader.defineClass1(Native Method)
                at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
                at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:878)
                at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:710)
                at org.gradle.internal.classloader.ClassLoaderUtils$AbstractClassLoaderLookuper.invoke(ClassLoaderUtils.java:148)
                ... 11 more