groovy / groovy/groovy-eclipse

LinkageError when building Spock

Open
#1,699 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
681
Forks
197
PR merge metrics
No merged PRs in 30d

Description

I opened Spock and let it build.

I get for spock-specs/src/test/groovy/org/spockframework/smoke/WithBlocks.groovy this Problem reported:

Groovy:General error during instruction selection: java.lang.LinkageError: loader constraint violation: loader java.net.URLClassLoader @60e6b90d wants to load abstract class groovyjarjarasm.asm.MethodVisitor. A different abstract class with the same name was previously loaded by org.eclipse.osgi.internal.loader.EquinoxClassLoader @5c02234. (groovyjarjarasm.asm.MethodVisitor is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @5c02234, parent loader 'platform')

I don't see anything in the Eclipse log.

I put a breakpoint for the LinkageError and got this stacktrace:

at java.lang.LinkageError.<init>(LinkageError.java:55)
at java.lang.ClassLoader.defineClass1(ClassLoader.java:-1)
at java.lang.ClassLoader.defineClass(ClassLoader.java:962)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:144)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:454)
at java.net.URLClassLoader.findClass(URLClassLoader.java:367)
at java.lang.ClassLoader.loadClass(ClassLoader.java:557)
at java.lang.ClassLoader.loadClass(ClassLoader.java:490)
at org.spockframework.compiler.CurrentClosureExpression.visit(CurrentClosureExpression.java:52)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitBytecodeExpression(AsmClassGenerator.java:1903)
at org.codehaus.groovy.classgen.BytecodeExpression.visit(BytecodeExpression.java:55)
at org.codehaus.groovy.classgen.asm.InvocationWriter.loadArguments(InvocationWriter.java:265)
at org.codehaus.groovy.classgen.asm.InvocationWriter.writeDirectMethodCall(InvocationWriter.java:215)
at org.codehaus.groovy.classgen.asm.InvocationWriter.makeDirectCall(InvocationWriter.java:313)
at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:132)
at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:126)
at org.codehaus.groovy.classgen.asm.InvocationWriter.writeInvokeMethod(InvocationWriter.java:456)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitMethodCallExpression(AsmClassGenerator.java:1007)
at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:79)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeReturn(StatementWriter.java:594)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitReturnStatement(AsmClassGenerator.java:841)
at org.codehaus.groovy.ast.stmt.ReturnStatement.visit(ReturnStatement.java:73)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeTryCatchFinally(StatementWriter.java:337)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitTryCatchFinally(AsmClassGenerator.java:801)
at org.codehaus.groovy.ast.stmt.TryCatchStatement.visit(TryCatchStatement.java:48)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeBlockStatement(StatementWriter.java:95)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitBlockStatement(AsmClassGenerator.java:771)
at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:72)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitStdMethod(AsmClassGenerator.java:630)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorOrMethod(AsmClassGenerator.java:565)
at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:125)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitMethod(AsmClassGenerator.java:714)
at org.codehaus.groovy.ast.ClassNode.visitMethods(ClassNode.java:1242)
at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1235)
at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:56)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:367)
at org.codehaus.groovy.control.CompilationUnit$2.call(CompilationUnit.java:829)
at org.codehaus.groovy.control.CompilationUnit$2.call(CompilationUnit.java:851)
at org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation(CompilationUnit.java:980)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:678)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:652)
at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.processToPhase(GroovyCompilationUnitDeclaration.java:243)
at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.generateCode(GroovyCompilationUnitDeclaration.java:346)
at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:844)
at org.eclipse.jdt.internal.compiler.ProcessTaskManager.processing(ProcessTaskManager.java:135)
at org.eclipse.jdt.internal.compiler.ProcessTaskManager$$Lambda/0x000000001a11ad08.run(Unknown Source:-1)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:545)
at java.util.concurrent.FutureTask.run(FutureTask.java:328)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
at java.lang.Thread.runWith(Thread.java:1487)
at java.lang.Thread.run(Thread.java:1474)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the build failure for spock-specs/src/test/groovy/org/spockframework/smoke/WithBlocks.groovy and inspect the reported stack trace, especially CurrentClosureExpression.visit. Investigate the conflicting groovyjarjarasm.asm.MethodVisitor class loaders. Done means the Spock build completes without the LinkageError.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, java
Domain
build-system, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.