Skip to content

[Bug]joern-export failed with grahson format #5659

@tulufangrapesbrrr

Description

@tulufangrapesbrrr

while trying to export the cfg of a code file in prahson format this error occurs:

$ joern-export cpg.bin --repr cfg --format graphson -o example_code_graph_cfg
Exception in thread "main" scala.NotImplementedError: repr=Cfg not yet supported for this format
        at io.joern.joerncli.JoernExport$.exportWithFlatgraphFormat(JoernExport.scala:161)
        at io.joern.joerncli.JoernExport$.exportCpg(JoernExport.scala:114)
        at io.joern.joerncli.JoernExport$.main$$anonfun$1$$anonfun$1(JoernExport.scala:66)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.util.Using$.resource(Using.scala:296)
        at io.joern.joerncli.JoernExport$.main$$anonfun$1(JoernExport.scala:67)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.Option.foreach(Option.scala:437)
        at io.joern.joerncli.JoernExport$.main(JoernExport.scala:59)
        at io.joern.joerncli.JoernExport.main(JoernExport.scala)

cdg, ddg also failed with the same error.

when --repr is set to all, the exportation was successful:

o example_code_graph
exported 91 nodes, 358 edges into /mnt/d/Code/LLM_Comment_Generation-main/example_code_graph

when --repr is set to cpg, although it seems successful but i'm not sure if the contents in the out_dir is in the right format:

dministrator@DESKTOP-VAT73EM:/mnt/d/Code/LLM_Comment_Generation-main$ joern-export cpg.bin --repr cpg --format graphson -o example_code_graph_cpg
exported 69 nodes, 265 edges into /mnt/d/Code/LLM_Comment_Generation-main/example_code_graph_cpg
Image

I've also tried other format, dot works fine with all types of repr.

  • OS:Windows+WSL(Ubuntu)

  • Joern Version
    dministrator@DESKTOP-VAT73EM:/mnt/d/Code/LLM_Comment_Generation-main/joern$ joern

    ██╗ ██████╗ ███████╗██████╗ ███╗ ██╗
    ██║██╔═══██╗██╔════╝██╔══██╗████╗ ██║
    ██║██║ ██║█████╗ ██████╔╝██╔██╗ ██║
    ██ ██║██║ ██║██╔══╝ ██╔══██╗██║╚██╗██║
    ╚█████╔╝╚██████╔╝███████╗██║ ██║██║ ╚████║
    ╚════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝
    Version: 4.0.422

  • Java version:openjdk-21

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions