<< Back to previous view

[TANAL-123] Problematic asm-all 4.2 dependency Created: 23/May/17  Updated: 23/May/17  Resolved: 23/May/17

Status: Closed
Project: tools.analyzer
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: Juho Teperi Assignee: Nicola Mometto
Resolution: Completed Votes: 1
Labels: None

Attachments: Text File TANAL-123.patch    
Patch: Code

 Description   

I just hit a crazy problem with Pegdown after updating to latest Core.async which depends on Tools.analyzer.jvm:

clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: Error creating extended parser class: null, compiling:(system.clj:11:16)
             java.lang.RuntimeException: Error creating extended parser class: null
     java.lang.IllegalArgumentException: 
                     org.objectweb.asm.MethodVisitor.<init>                                        
                     org.objectweb.asm.MethodVisitor.<init>                                        
                   org.objectweb.asm.tree.MethodNode.<init>                                        
                   org.objectweb.asm.tree.MethodNode.<init>                                        
   org.parboiled.transform.ClassNodeInitializer.visitMethod         ClassNodeInitializer.java:  136
                            org.objectweb.asm.ClassReader.b                                        
                       org.objectweb.asm.ClassReader.accept                                        
                       org.objectweb.asm.ClassReader.accept                                        
       org.parboiled.transform.ClassNodeInitializer.process         ClassNodeInitializer.java:   63
org.parboiled.transform.ParserTransformer.extendParserClass            ParserTransformer.java:   44
  org.parboiled.transform.ParserTransformer.transformParser            ParserTransformer.java:   38
                       org.parboiled.Parboiled.createParser                    Parboiled.java:   54
                        org.pegdown.PegDownProcessor.<init>             PegDownProcessor.java:   94
                        org.pegdown.PegDownProcessor.<init>             PegDownProcessor.java:   63

Core.async dependency tree:

[org.clojure/core.async "0.3.442"]
└── [org.clojure/tools.analyzer.jvm "0.7.0"]
    ├── [org.clojure/tools.analyzer "0.6.9"]
    └── [org.ow2.asm/asm-all "4.2"]

Endophile/Pegdown/Parboiled dependency tree:

[endophile "0.2.0"]
└── [org.pegdown/pegdown "1.6.0"]
    └── [org.parboiled/parboiled-java "1.1.7"]
        ├── [org.ow2.asm/asm-analysis "5.0.3"]
        ├── [org.ow2.asm/asm-tree "5.0.3"]
        ├── [org.ow2.asm/asm-util "5.0.3"]
        ├── [org.ow2.asm/asm "5.0.3"]
        └── [org.parboiled/parboiled-core "1.1.7"]

As a workaround I added [org.ow2.asm/asm-all "5.2"] dependency the project. The asm-all artifact is problematic as it provides the same files as separate dependencies. This means that dependency conflict is hard to debug as lein deps :tree or such can't warn about this. According to notice which can be found inside asm archive file (http://download.forge.ow2.org/asm/asm-5.2-bin.zip) under all folder README, using the asm-all artifact is not recommended:

It is highly recommended to use only the necessary ASM jars for your application instead of using the asm-all jar, unless you really need all ASM packages.

As a solution I propose tools.analyzer.jvm will change the dependency to org.ow2.asm/asm, the core library. After that change Leiningen pedantic mode should be able to warn about this. The dependency could also be updated to the latest version (5.2).

Warning from lein deps :tree when using core artifact:

[org.clojure/tools.analyzer.jvm "0.7.1-SNAPSHOT"] -> [org.ow2.asm/asm "4.2"]
 overrides
[endophile "0.2.1"] -> [org.pegdown/pegdown "1.6.0"] -> [org.parboiled/parboiled-java "1.1.7"] -> [org.ow2.asm/asm-util "5.0.3"] -> [org.ow2.asm/asm-tree "5.0.3"] -> [org.ow2.asm/asm "5.0.3"]
 and
[endophile "0.2.1"] -> [org.pegdown/pegdown "1.6.0"] -> [org.parboiled/parboiled-java "1.1.7"] -> [org.ow2.asm/asm-analysis "5.0.3"] -> [org.ow2.asm/asm-tree "5.0.3"] -> [org.ow2.asm/asm "5.0.3"]
 and
[endophile "0.2.1"] -> [org.pegdown/pegdown "1.6.0"] -> [org.parboiled/parboiled-java "1.1.7"] -> [org.ow2.asm/asm-tree "5.0.3"] -> [org.ow2.asm/asm "5.0.3"]
 and
[endophile "0.2.1"] -> [org.pegdown/pegdown "1.6.0"] -> [org.parboiled/parboiled-java "1.1.7"] -> [org.ow2.asm/asm "5.0.3"]


 Comments   
Comment by Nicola Mometto [ 23/May/17 8:47 PM ]

https://github.com/clojure/tools.analyzer.jvm/commit/f273e18a58bcf9d34861e80c5ca278427dea48cd





Generated at Wed May 24 10:49:59 CDT 2017 using JIRA 4.4#649-r158309.