-
Notifications
You must be signed in to change notification settings - Fork 296
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
[Bug] joern-export tool export incorrect formated .dot files. #5158
Comments
I guess the issue is in I am not sure why we made this distinction there and re-implemented the dot exporting logic again within flatgraph if we already had a working one in joern. Anyway: there is a lot of escaping (using |
Do you have any temporary solutions? |
Thanks for bringing this up, and yes there's a bit of historical mess in there. I'll take a look today. |
didn't get around to looking into this yet |
I just pushed @max-leuthaeuser @yikesoftware there's two differences between the joern DotSerializer and flatgraph's DotExporter:
We never really made a plan for what we really want in the dot export, and there's many different use cases. I guess I'll change the 'all' representation back to the flatgraph exporter, after I added escaping. |
Thanks! After my testing, your method can indeed export dot format files in the correct format. However, compared to the original approach, each node seems to only have Before:
After:
|
yes that's expected as per my message above. specifically:
That's the part you need. Won't get to that this week though. |
@yikesoftware can you please share how you use or render the dot file? |
When using previous version to dump dot and make png:
dot file:
When using
It was successful, but it lacked a lot of key attribute information. |
@mpollmeier Perhaps the key issue lies only in the handling of quotation marks, as all internal quotation marks need to be manually escaped. |
what's |
Path name. Just ignore it. I originally planned to use IDA to export some pseudocode and input it into Joern, but I discovered this issue during the testing phase. |
ah, sorry i got confused by your shell prefix 😆 |
A belated Merry Christmas~ Any update? |
When I try to export CPG in dot format using the joern export tool, the resulting dot file format is incorrect, which makes it difficult for libraries such as graphviz and pydot to parse correctly. In contrast, when exporting images such as CFG, PDG, AST, CPG14, etc., the dot format is correct.
For example:
joern-export 1.cpg.bin -o 1.cpg.gv --repr cpg --format dot
And I got a file in output results:
There are 4 main errors of this dot file:
The corrected file is as follow:
Perhaps for some reason, you have simplified the file format of dot when exporting CPG, but I think it is best to ensure that the format is standard and only requires some symbol related modifications, so the workload should not be significant.
Joern version: 4.0.116
OS: Ubuntu 24.04
Java version: openjdk 21.0.5 2024-10-15
The text was updated successfully, but these errors were encountered: