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] DotNetAstGen binary gets killed instantly on MacOS #4019

Closed
karan-batavia opened this issue Jan 3, 2024 · 3 comments · Fixed by #4038
Closed

[Bug] DotNetAstGen binary gets killed instantly on MacOS #4019

karan-batavia opened this issue Jan 3, 2024 · 3 comments · Fixed by #4038
Assignees
Labels
bug Something isn't working

Comments

@karan-batavia
Copy link
Contributor

Describe the bug
The DotNetAstGen binaries stored in joern-cli/frontends/csharpsrc2cpg/bin/astgen folder are segregated by operating systems. The dotnetastgen-macos-arm is terminated instantly on a ARM Mac, throwing an error code of 137. The tests fail with a RuntimeException defined in code. Strangely, the dotnetastgen-macos works perfectly fine on the same machine, but it is not picked up by default when running the tests.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. ..
  5. See error

Expected behavior
The Ast for the tests should be generated and tests should execute.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS - MacOS
  • Joern Version - latest
  • Java version - 20.x

Additional context
Add any other context about the problem here.

@karan-batavia karan-batavia added the bug Something isn't working label Jan 3, 2024
@karan-batavia
Copy link
Contributor Author

cc: @pandurangpatil

@DavidBakerEffendi
Copy link
Collaborator

DavidBakerEffendi commented Jan 8, 2024

I've encountered this too, and I've found that the default terminal is usually simulating Intel (Rosetta mode). I've tried to look at cross-architecture builds for dotnet but with little success. To prove this, try running the x86 version and see if it works.

@DavidBakerEffendi
Copy link
Collaborator

Ok I looked into this and seems related to dotnet/runtime#79267

Also, running arch confirms my terminal is in arm64 mode, but it runs the x64 build of DotNetAstGen just fine so probably no need to build both variants.

DavidBakerEffendi added a commit that referenced this issue Jan 10, 2024
Two main groups of properties are commonly duplicated among test fixtures:
* Dataflow processing with custom semantic definitions
* Post processing passes

This PR uses a combination of traits and new additions to `TestCpg` to improve the re-usability and consistency of these among frontend fixtures.

I leave it up to the authors of the frontends to refactor these changes in each test suite.themselves.

Misc: Added a fix for #4019
DavidBakerEffendi added a commit that referenced this issue Jan 11, 2024
Two main groups of properties are commonly duplicated among test fixtures:
* Dataflow processing with custom semantic definitions
* Post processing passes

This PR uses a combination of traits and new additions to `TestCpg` to improve the re-usability and consistency of these among frontend fixtures.

I leave it up to the authors of the frontends to refactor these changes in each test suite.themselves. The result is that all test fixtures include the options for
```scala
.withOssDataflow(Boolean)
.withExtraFlows(List[FlowSemantic])
.withPostProcessingPasses(Boolean)
```

Misc: Added a fix for #4019
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

Successfully merging a pull request may close this issue.

2 participants