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

Parsing fails on apple-silicon/arm64, wind and windows #2953

Closed
MariusMaibornWolff opened this issue Aug 5, 2022 · 6 comments
Closed

Parsing fails on apple-silicon/arm64, wind and windows #2953

MariusMaibornWolff opened this issue Aug 5, 2022 · 6 comments
Assignees
Labels
bug Only issues that describe bugs. pr-analysis Issues that touch the analysis pr(oject). priority:urgent Should be addressed ASAP

Comments

@MariusMaibornWolff
Copy link

Bug

gitlogparser, rawtextparser and sourcecodeparser fail on Apple Silicon.

The command gets stuck on apple silicon with no further output.
No output file is written after executing the command.
e.g.:

ccsh gitlogparser "git_output" "--output-file=gitlogparserresult.json" "--file-name-list=git_filename_list_output" "--not-compressed" "--silent=false" "--add-author=true"

output:

Assumed encoding UTF-8
57% [=========================================================> ] 9868725/17018092 Byte, ETA: 00:00:00
Unhandled Edge Case in MergeCommit: deleted: false, mutated: true, modification type: RENAME, initalAdd: false, file: apps/community-service/.idea/runConfigurations.xml
58% [==========================================================> ] 9881689/17018092 Byte, ETA: 00:00:00
Unhandled Edge Case in MergeCommit: deleted: false, mutated: true, modification type: RENAME, initalAdd: false, file: apps/community-service/.idea/runConfigurations.xml
100% [====================================================================================================>] 17018092/17018092 Byte, ETA: 00:00:00
Created Project with 3325 leaves.

Expected Behavior

Process finishes and output json file has been created.

Actual Behavior

Process gets stuck. No further output/error is given.

Steps to Reproduce the Problem

  1. User a mac with apple-silicon / arm64
  2. Run any parser on any project
  3. Observe that the process is stuck and no further output is given.

Specifications

  • is released in online-demo: yes | no
  • CodeCharta Version: latest
  • OS: Mac OS
  • Browser: Chrome
@MariusMaibornWolff MariusMaibornWolff added the bug Only issues that describe bugs. label Aug 5, 2022
@MariusMaibornWolff
Copy link
Author

For solution: Eventually check if parsers run in a docker container successfully.

@ce-bo ce-bo added pr-analysis Issues that touch the analysis pr(oject). priority:high Set by PO labels Aug 8, 2022
@ce-bo ce-bo added this to the automation-basics-3 milestone Aug 8, 2022
@ce-bo ce-bo added priority:urgent Should be addressed ASAP and removed priority:high Set by PO labels Aug 11, 2022
@ce-bo
Copy link
Collaborator

ce-bo commented Aug 11, 2022

@Hall-Ma found out, that this applies also for Windows (tested on Windows with ccsh version 1.103.3).

@ce-bo
Copy link
Collaborator

ce-bo commented Aug 11, 2022

Let's extend golden_test.sh to have an automated regression test in case this bug reoccurs sometime.

@Hall-Ma Hall-Ma changed the title Parsing fails on apple-silicon/arm64 Parsing fails on apple-silicon/arm64, wind and windows Aug 15, 2022
@Hall-Ma Hall-Ma self-assigned this Aug 15, 2022
@Hall-Ma
Copy link
Contributor

Hall-Ma commented Aug 15, 2022

When you are trying to use Sonar Importer on Windows (Git Bash) you get no output file because the script doesn't end:
image
I tried to debug a bit and found out that the method wrapInput of the new CompressedStreamHandler stuck when it tries to read the content val firstValue = content.read(). @phanlezz Do you have any idea why?
On Mac, the Sonar Importer works.

@phanlezz
Copy link
Collaborator

phanlezz commented Aug 15, 2022

When you are trying to use Sonar Importer on Windows (Git Bash) you get no output file because the script doesn't end: image I tried to debug a bit and found out that the method wrapInput of the new CompressedStreamHandler stuck when it tries to read the content val firstValue = content.read(). @phanlezz Do you have any idea why? On Mac, the Sonar Importer works.

We had this issue before and we added a workaround. I'm not quite sure why it stopped working again. I might be able to look later today or tomorrow into it. 😞
This issue is/was that the programm doesn't know if there is something incoming on the System.in . I added the .available check, but thats an old (and like we now see) unrealiable method of checking if there is an input steam as it seems.
The root of the problem is a method later in the scipt, that checks System.In always one second after calling it. There is an open issue explaining this behavior: #2858 and the workaround #2854 (where we found this problem).
We might be able to remove the compression handler from the deserializer that handles generic input streams, but for that we would need to rewrite almost every test which rely often on the input stream method to parse sample project files (since these could not be transferred as a FileInputStream)

The git bash seems to act differently than cmd or other CLIs.

Small workaround for the moment, if it is an urgent problem: CTRL + D (normally sends EOF to console)

phanlezz added a commit that referenced this issue Aug 15, 2022
#2953
This fixes a bug in the workaround for the input stream validation, by removing a typo
phanlezz added a commit that referenced this issue Aug 15, 2022
phanlezz added a commit that referenced this issue Aug 16, 2022
…2953  (#2987)

* Fix stuck merge process by correcting input stream validation

* This fixes a bug in the workaround for the input stream validation, by removing a typo

#2953
@phanlezz
Copy link
Collaborator

Closed through #2987 . Will be reopened if new issue are found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Only issues that describe bugs. pr-analysis Issues that touch the analysis pr(oject). priority:urgent Should be addressed ASAP
Projects
None yet
Development

No branches or pull requests

4 participants