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

[php2cpg] ClassCastException occurs during ComposerAutoloadPass #4918

Open
d1tto opened this issue Sep 13, 2024 · 0 comments
Open

[php2cpg] ClassCastException occurs during ComposerAutoloadPass #4918

d1tto opened this issue Sep 13, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@d1tto
Copy link
Contributor

d1tto commented Sep 13, 2024

Describe the bug

The ClassCastException was reported when generating CPG for Ecommerce-CodeIgniter-Bootstrap project

2024-09-13 16:38:29.473 ERROR ComposerAutoloadPass: Pass io.joern.x2cpg.frontendspecific.php2cpg.ComposerAutoloadPass failed
java.lang.ClassCastException: class io.shiftleft.codepropertygraph.generated.nodes.TypeDecl cannot be cast to class io.shiftleft.codepropertygraph.generated.nodes.CfgNode (io.shiftleft.codepropertygraph.generated.nodes.TypeDecl and io.shiftleft.codepropertygraph.generated.nodes.CfgNode are in unnamed module of loader 'app')
        at scala.collection.Iterator$$anon$10.nextCur(Iterator.scala:594) ~[org.scala-lang.scala-library-2.13.12.jar:?]
        at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:608) ~[org.scala-lang.scala-library-2.13.12.jar:?]
        at scala.collection.Iterator$ConcatIterator.advance$1(Iterator.scala:1182) ~[org.scala-lang.scala-library-2.13.12.jar:?]
        at scala.collection.Iterator$ConcatIterator.hasNext(Iterator.scala:1188) ~[org.scala-lang.scala-library-2.13.12.jar:?]
        at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:600) ~[org.scala-lang.scala-library-2.13.12.jar:?]
        at scala.collection.mutable.Growable.addAll(Growable.scala:61) ~[org.scala-lang.scala-library-2.13.12.jar:?]
        at scala.collection.mutable.Growable.addAll$(Growable.scala:57) ~[org.scala-lang.scala-library-2.13.12.jar:?]
        at scala.collection.mutable.ArrayBuilder.addAll(ArrayBuilder.scala:67) ~[org.scala-lang.scala-library-2.13.12.jar:?]
        at scala.collection.IterableOnceOps.toArray(IterableOnce.scala:1346) ~[org.scala-lang.scala-library-2.13.12.jar:?]
        at scala.collection.IterableOnceOps.toArray$(IterableOnce.scala:1339) ~[org.scala-lang.scala-library-2.13.12.jar:?]
        at scala.collection.AbstractIterator.toArray(Iterator.scala:1300) ~[org.scala-lang.scala-library-2.13.12.jar:?]
        at io.joern.x2cpg.frontendspecific.php2cpg.ComposerAutoloadPass.generateParts(ComposerAutoloadPass.scala:46) ~[io.joern.x2cpg-4.0.73.jar:4.0.73]
        at io.joern.x2cpg.frontendspecific.php2cpg.ComposerAutoloadPass.generateParts(ComposerAutoloadPass.scala:45) ~[io.joern.x2cpg-4.0.73.jar:4.0.73]
        at io.shiftleft.passes.ForkJoinParallelCpgPass.runWithBuilder(CpgPass.scala:106) ~[io.shiftleft.codepropertygraph_3-1.7.9.jar:1.7.9]
        at io.shiftleft.passes.ForkJoinParallelCpgPass.createAndApply(CpgPass.scala:74) ~[io.shiftleft.codepropertygraph_3-1.7.9.jar:1.7.9]
        at io.joern.console.cpgcreation.PhpCpgGenerator.applyPostProcessingPasses$$anonfun$1(PhpCpgGenerator.scala:38) ~[io.joern.console-4.0.73.jar:4.0.73]
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15) ~[org.scala-lang.scala3-library_3-3.4.2.jar:3.4.2]
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10) ~[org.scala-lang.scala3-library_3-3.4.2.jar:3.4.2]
        at scala.collection.immutable.List.foreach(List.scala:333) ~[org.scala-lang.scala-library-2.13.12.jar:?]
        at io.joern.console.cpgcreation.PhpCpgGenerator.applyPostProcessingPasses(PhpCpgGenerator.scala:38) ~[io.joern.console-4.0.73.jar:4.0.73]
        at io.joern.joerncli.JoernParse$.applyDefaultOverlays$$anonfun$1(JoernParse.scala:164) ~[io.joern.joern-cli-4.0.73.jar:4.0.73]
        at scala.util.Try$.apply(Try.scala:210) ~[org.scala-lang.scala-library-2.13.12.jar:?]
        at io.joern.joerncli.JoernParse$.applyDefaultOverlays(JoernParse.scala:168) ~[io.joern.joern-cli-4.0.73.jar:4.0.73]
        at io.joern.joerncli.JoernParse$.run$$anonfun$2$$anonfun$1$$anonfun$1(JoernParse.scala:90) ~[io.joern.joern-cli-4.0.73.jar:4.0.73]
        at scala.util.Success.flatMap(Try.scala:258) ~[org.scala-lang.scala-library-2.13.12.jar:?]
        at io.joern.joerncli.JoernParse$.run$$anonfun$2$$anonfun$1(JoernParse.scala:91) ~[io.joern.joern-cli-4.0.73.jar:4.0.73]
        at scala.util.Success.flatMap(Try.scala:258) ~[org.scala-lang.scala-library-2.13.12.jar:?]
        at io.joern.joerncli.JoernParse$.run$$anonfun$2(JoernParse.scala:91) ~[io.joern.joern-cli-4.0.73.jar:4.0.73]
        at scala.util.Success.flatMap(Try.scala:258) ~[org.scala-lang.scala-library-2.13.12.jar:?]
        at io.joern.joerncli.JoernParse$.run(JoernParse.scala:91) ~[io.joern.joern-cli-4.0.73.jar:4.0.73]
        at io.joern.joerncli.JoernParse$.run$$anonfun$1(JoernParse.scala:77) ~[io.joern.joern-cli-4.0.73.jar:4.0.73]
        at scala.util.Success.flatMap(Try.scala:258) [org.scala-lang.scala-library-2.13.12.jar:?]
        at io.joern.joerncli.JoernParse$.run(JoernParse.scala:77) [io.joern.joern-cli-4.0.73.jar:4.0.73]
        at io.joern.joerncli.JoernParse$.main(JoernParse.scala:19) [io.joern.joern-cli-4.0.73.jar:4.0.73]
        at io.joern.joerncli.JoernParse.main(JoernParse.scala) [io.joern.joern-cli-4.0.73.jar:4.0.73]

Ecommerce-CodeIgniter-Bootstrap.zip

Desktop (please complete the following information):

  • OS Windows11
  • Joern Version 4.0.73 (latest)
  • Java version Oracle GraalVM 17.0.10+11.1 (build 17.0.10+11-LTS-jvmci-23.0-b27)
@d1tto d1tto added the bug Something isn't working label Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant