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

[Bug][csharpsrc2cpg]Unable to create cpg for c# code #4850

Open
wooyune1 opened this issue Aug 15, 2024 · 1 comment
Open

[Bug][csharpsrc2cpg]Unable to create cpg for c# code #4850

wooyune1 opened this issue Aug 15, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@wooyune1
Copy link

Describe the bug
Unable to create cpg for c# code.The following error occurs:

[main] INFO io.joern.csharpsrc2cpg.utils.DotNetAstGenRunner - Running dotnetastgen on 'D:\Workspace\Java\CsharpAnalysis\src\main\resources'
[main] ERROR io.joern.csharpsrc2cpg.utils.DotNetAstGenRunner - 	- running dotnetastgen failed!
java.lang.RuntimeException: 
	at io.joern.x2cpg.utils.ExternalCommand.handleRunResult(ExternalCommand.scala:22)
	at io.joern.x2cpg.utils.ExternalCommand.handleRunResult$(ExternalCommand.scala:8)
	at io.joern.x2cpg.utils.ExternalCommand$.handleRunResult(ExternalCommand.scala:39)
	at io.joern.x2cpg.utils.ExternalCommand.run(ExternalCommand.scala:34)
	at io.joern.x2cpg.utils.ExternalCommand.run$(ExternalCommand.scala:8)
	at io.joern.x2cpg.utils.ExternalCommand$.run(ExternalCommand.scala:39)
	at io.joern.csharpsrc2cpg.utils.DotNetAstGenRunner.runAstGenNative(DotNetAstGenRunner.scala:67)
	at io.joern.x2cpg.astgen.AstGenRunnerBase.execute(AstGenRunner.scala:181)
	at io.joern.x2cpg.astgen.AstGenRunnerBase.execute$(AstGenRunner.scala:83)
	at io.joern.csharpsrc2cpg.utils.DotNetAstGenRunner.execute(DotNetAstGenRunner.scala:14)
	at io.joern.csharpsrc2cpg.CSharpSrc2Cpg.createCpg$$anonfun$1$$anonfun$1(CSharpSrc2Cpg.scala:36)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at better.files.Dispose.apply(Dispose.scala:75)
	at better.files.Dispose.foreach(Dispose.scala:91)
	at better.files.File$.usingTemporaryDirectory(File.scala:1320)
	at io.joern.csharpsrc2cpg.CSharpSrc2Cpg.createCpg$$anonfun$1(CSharpSrc2Cpg.scala:68)
	at scala.runtime.function.JProcedure2.apply(JProcedure2.java:15)
	at scala.runtime.function.JProcedure2.apply(JProcedure2.java:10)
	at io.joern.x2cpg.X2Cpg$.withNewEmptyCpg$$anonfun$1$$anonfun$1(X2Cpg.scala:322)
	at io.joern.x2cpg.X2Cpg$.$anonfun$adapted$1(X2Cpg.scala:323)
	at scala.util.Try$.apply(Try.scala:210)
	at io.joern.x2cpg.X2Cpg$.withNewEmptyCpg$$anonfun$1(X2Cpg.scala:323)
	at scala.util.Try$.apply(Try.scala:210)
	at io.joern.x2cpg.X2Cpg$.withNewEmptyCpg(X2Cpg.scala:329)
	at io.joern.csharpsrc2cpg.CSharpSrc2Cpg.createCpg(CSharpSrc2Cpg.scala:69)
	at TaintAnalysis$.run(TaintAnalysis.scala:39)
	at Main$.main(Main.scala:3)
	at Main.main(Main.scala)

To Reproduce
my code

  def run(): Unit = {
    val config = Config()
      .withInputPath("src\\main\\resources")

    implicit val cpg: Cpg = new CSharpSrc2Cpg().createCpg(config).get
  }

c# code to parse

using System;

namespace HelloWorld
{
    class Program
    {
        static void Main(string[] args)
        {
            int i = 0;
            int a = i + 1;
            Console.WriteLine(a);
        }
    }
}

Desktop (please complete the following information):

  • Windows11
  • io.joern:csharpsrc2cpg_3:4.0.35
  • jdk 17
@wooyune1 wooyune1 added the bug Something isn't working label Aug 15, 2024
@wozhendeshuai
Copy link

same question

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

2 participants