the script "joern/graph-for-funcs.sc" cannot run successfully, how to solve it?
See original GitHub issueenviroment:
computer: Linux version 4.4.0-124-generic (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9) )
java version "1.8.0_251",Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
Scala code runner version 2.13.3
the error log output:
j```
oern> cpg.runScript(“/home/bfs/cct/devign/joern/graph-for-funcs.sc”).toString()
Compiling (synthetic)/ammonite/predef/interpBridge.sc
Compiling (synthetic)/ammonite/predef/replBridge.sc
Compiling (synthetic)/ammonite/predef/sourceBridge.sc
Compiling (synthetic)/ammonite/predef/frontEndBridge.sc
Compiling (synthetic)/ammonite/predef/DefaultPredef.sc
Compiling (synthetic)/ammonite/predef/ArgsPredef.sc
Compiling /home/bfs/cct/scala/sbt/(console)
Compiling /home/bfs/cct/devign/joern/graph-for-funcs.sc
graph-for-funcs.sc:86: value filterOnEnd is not a member of java.util.Iterator[overflowdb.Node]
method.out(EdgeTypes.CONTAINS).filterOnEnd(_.isInstanceOf[nodes.CfgNode]).cast[nodes.CfgNode]
^
graph-for-funcs.sc:92: value hasLabel is not a member of java.util.Iterator[overflowdb.Node]
possible cause: maybe a semicolon is missing before value hasLabel
?
.hasLabel(NodeTypes.BLOCK)
^
graph-for-funcs.sc:97: value hasLabel is not a member of java.util.Iterator[overflowdb.Node]
val source = new NodeSteps(method.out(EdgeTypes.CONTAINS).hasLabel(NodeTypes.CALL).cast[nodes.Call]).nameNot(“<operator>.*”).dedup
^
java.lang.RuntimeException: Compilation Failed
io.shiftleft.console.scripting.AmmoniteExecutor.$anonfun$runScript$7(AmmoniteExecutor.scala:52)
cats.effect.internals.IORunLoop$.liftedTree3$1(IORunLoop.scala:229)
cats.effect.internals.IORunLoop$.step(IORunLoop.scala:229)
cats.effect.IO.unsafeRunTimed(IO.scala:320)
cats.effect.IO.unsafeRunSync(IO.scala:239)
io.shiftleft.console.scripting.ScriptManager.runScript(ScriptManager.scala:130)
io.shiftleft.console.scripting.ScriptManager$CpgScriptRunner.runScript(ScriptManager.scala:64)
io.shiftleft.console.scripting.ScriptManager$CpgScriptRunner.runScript(ScriptManager.scala:54)
ammonite.$sess.cmd7$.<clinit>(cmd7.sc:1)
Have you encountered this problem ? and do you know where the problem is? I look forward to your help to provide ideas to solve the problem.
Thank you very much
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (3 by maintainers)
Top GitHub Comments
Hi @epicosy , great ! Thanks for the update
It is most probable that Joern’s implementation was changed with something different. I just extended their script for combining the AST, CGF, and PDG for each method to include the file path. I did a diff between the script in my repository (on the left) and their current version of the script (on the right) here. Was it helpful?