Fraunhofer-AISEC / cpg

A library to extract Code Property Graphs from C/C++, Java, Go, Python, Ruby and every other language through LLVM-IR.
https://fraunhofer-aisec.github.io/cpg/
Apache License 2.0
246 stars 59 forks source link

Python Not Implemented Error #1508

Closed maximiliankaul closed 1 month ago

maximiliankaul commented 1 month ago

Stack trace

Stack trace in case of an Exception

14:34:03,679 WARN  NodeBuilderKt Unexpected: No code for node de.fraunhofer.aisec.cpg.frontends.python.Python$ASTModule@1307b6d8
14:34:03,684 WARN  NodeBuilderKt Unexpected: No code for node de.fraunhofer.aisec.cpg.frontends.python.Python$ASTModule@1307b6d8
14:34:03,699 WARN  NodeBuilderKt Unexpected: No code for node de.fraunhofer.aisec.cpg.frontends.python.Python$ASTalias@425a1d83
14:34:03,700 WARN  NodeBuilderKt Unexpected: No code for node de.fraunhofer.aisec.cpg.frontends.python.Python$ASTalias@4cb35d63
14:34:03,794 INFO  MeasurementHolder TranslationManager: Translation into full graph done in 286 ms
java.util.concurrent.ExecutionException: kotlin.NotImplementedError: An operation is not implemented.
        at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
        at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073)
        at de.fraunhofer.aisec.cpg_vis_neo4j.Application.call(Application.kt:591)
        at de.fraunhofer.aisec.cpg_vis_neo4j.Application.call(Application.kt:87)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
        at picocli.CommandLine.execute(CommandLine.java:2170)
        at de.fraunhofer.aisec.cpg_vis_neo4j.ApplicationKt.main(Application.kt:632)
Caused by: kotlin.NotImplementedError: An operation is not implemented.
        at de.fraunhofer.aisec.cpg.frontends.python.ExpressionHandler.handleNode(ExpressionHandler.kt:48)
        at de.fraunhofer.aisec.cpg.frontends.python.ExpressionHandler.handleNode(ExpressionHandler.kt:34)
        at de.fraunhofer.aisec.cpg.frontends.python.PythonHandler.handle(PythonHandler.kt:43)
        at de.fraunhofer.aisec.cpg.frontends.python.StatementHandler.handleIf(StatementHandler.kt:114)
        at de.fraunhofer.aisec.cpg.frontends.python.StatementHandler.handleNode(StatementHandler.kt:50)
        at de.fraunhofer.aisec.cpg.frontends.python.StatementHandler.handleNode(StatementHandler.kt:40)
        at de.fraunhofer.aisec.cpg.frontends.python.PythonHandler.handle(PythonHandler.kt:43)
        at de.fraunhofer.aisec.cpg.frontends.python.StatementHandler.makeBlock(StatementHandler.kt:391)
        at de.fraunhofer.aisec.cpg.frontends.python.StatementHandler.makeBlock$default(StatementHandler.kt:388)
        at de.fraunhofer.aisec.cpg.frontends.python.StatementHandler.handleWhile(StatementHandler.kt:80)
        at de.fraunhofer.aisec.cpg.frontends.python.StatementHandler.handleNode(StatementHandler.kt:54)
        at de.fraunhofer.aisec.cpg.frontends.python.StatementHandler.handleNode(StatementHandler.kt:40)
        at de.fraunhofer.aisec.cpg.frontends.python.PythonHandler.handle(PythonHandler.kt:43)
        at de.fraunhofer.aisec.cpg.frontends.python.PythonLanguageFrontend.pythonASTtoCPG(PythonLanguageFrontend.kt:263)
        at de.fraunhofer.aisec.cpg.frontends.python.PythonLanguageFrontend.parse(PythonLanguageFrontend.kt:79)
        at de.fraunhofer.aisec.cpg.TranslationManager.parse(TranslationManager.kt:353)
        at de.fraunhofer.aisec.cpg.TranslationManager.parseSequentially(TranslationManager.kt:306)
        at de.fraunhofer.aisec.cpg.TranslationManager.runFrontends(TranslationManager.kt:225)
        at de.fraunhofer.aisec.cpg.TranslationManager.analyzeNonAsync(TranslationManager.kt:87)
        at de.fraunhofer.aisec.cpg.TranslationManager.analyze$lambda$0(TranslationManager.kt:69)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

Unexpected behavior

When the analysis terminates exception free but leads to unexpected graphs: Describe the difference between the generated graph and what you would have expected

Code of interest

codeOfInterest

Extensions to the library, e.g. added or changed LanguageFrontends or Passes

changes to or added components

Changes to the configuration

configuration print