[Soot-list] Cannot Create Control-Flow Graphs of Maven Projects

Ekincan Ufuktepe ekincanufuktepe at gmail.com
Sat Feb 24 02:41:10 EST 2018


Dear All,

I am able to create control-flow graphs (CFG) of ordinary Java Eclipse
projects. I use the command below to create my CFGs and redirect the path
where the bytecodes are located, which is the "bin" folder.

"--graph=ClassicCompleteUnitGraph -cp . -allow-phantom-refs -pp
-process-dir MyJavaProject\bin"

However, when I tried it with a open source Maven project called
"checkstyle", I received an exception " IllegalArgumentException". The
exception and error message that I get is at the end of the mail.

I am aware that the bytecodes are located in the "target\classes" folder of
the maven project, I change the path from "bin" to "target\classes" but
still it didn't work. Also, I must say that the project contains some
errors, with some incomplete classes, syntax errors etc. Still I don't
think it would be an obstacle, because I previously tried it another
project that had errors and gave me an output of CFG.

The new command that I use to create CFG for the maven project is:

"--graph=ClassicCompleteUnitGraph -cp . -allow-phantom-refs -pp
-process-dir checkstyle-checkstyle-8.7\target\classes"

I am really not sure if this is a bug or not, that's why I wanted to ask
and make sure if I am doing something wrong or not. As I said before, the
command that I use works completely fine on ordinary eclipse java project,
but cannot get it working on maven projects.

Thanks in advance,

Best Regards,

Ekin

java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.<init>(ClassReader.java:185)
at org.objectweb.asm.ClassReader.<init>(ClassReader.java:168)
at org.objectweb.asm.ClassReader.<init>(ClassReader.java:439)
at soot.asm.AsmClassSource.resolve(AsmClassSource.java:60)
at soot.SootResolver.bringToHierarchyUnchecked(SootResolver.java:236)
at soot.SootResolver.bringToHierarchy(SootResolver.java:208)
at soot.SootResolver.bringToSignatures(SootResolver.java:269)
at soot.SootResolver.processResolveWorklist(SootResolver.java:170)
at soot.SootResolver.resolveClass(SootResolver.java:133)
at soot.Scene.loadClass(Scene.java:860)
at soot.Scene.loadClassAndSupport(Scene.java:846)
at soot.Scene.loadNecessaryClasses(Scene.java:1601)
at soot.Main.run(Main.java:250)
at soot.Main.main(Main.java:147)
at soot.tools.CFGViewer.main(CFGViewer.java:101)
at tr.iyte.edu.tcp.slicer.CFGGenerator.createCFG(CFGGenerator.java:25)
at tr.iyte.edu.tcp.Main.main(Main.java:61)


Ouuups... something went wrong! Sorry about that.
Follow these steps to fix the problem:
1.) Are you sure you used the right command line?
    Click here to double-check:
    https://soot-build.cs.uni-paderborn.de/doc/sootoptions/

2.) Not sure whether it's a bug? Feel free to discuss
    the issue on the Soot mailing list:
    https://github.com/Sable/soot/wiki/Getting-help

3.) Sure it's a bug? Click this link to report it.
    Please be as precise as possible when giving us
    information on how to reproduce the problem. Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20180224/e8bb786a/attachment.html>


More information about the Soot-list mailing list