Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
psibre opened this issue Jul 13, 2021 · 3 comments
Open

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

psibre opened this issue Jul 13, 2021 · 3 comments
Assignees
Labels

Comments

@psibre
Copy link
Member

psibre commented Jul 13, 2021

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 psibre added the bug label Jul 13, 2021
@psibre psibre self-assigned this Jul 13, 2021
@psibre
Copy link
Member Author

psibre commented Jul 13, 2021

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
Copy link
Member Author

psibre commented Jul 13, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant