-
Notifications
You must be signed in to change notification settings - Fork 319
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
Infiniti-loop (?) in analyzer / reporter on huge Gradle project #9763
Comments
I'm seeing a similar issue in the Reporter. I have a pretty big Gradle project which I'm trying to analyze. The analyzer runs fine, producing the
the reporter runs for about 10 minutes, then crashes with the stacktrace
I monitored memory consumption with |
Here is the analyzer-result.yml for reference. I only ran the Analyzer, then tried to create a WebApp report from the result file. Usually takes a few seconds, but now, takes 2m 30s and ends up with
Here's my Analyzer result file for reference, in case someone wants to verify. The reports have worked for me last time in release 45 of ORT. |
This is unnecessary and leads to a long runtime (and possible an infinite loop/recusrsion) for large dependency graphs as observed in oss-review-toolkit#9763
This is unnecessary and leads to a long runtime (and possible an infinite loop/recursion) for large dependency graphs as observed in oss-review-toolkit#9763 Signed-off-by: Jendrik Johannes <[email protected]>
Only create one 'OrtDependency' for each 'ResolvedComponentResult'. The 'ResolvedComponentResult' is immutable and therefore all 'OrtDependency' object derived from the same 'ResolvedComponentResult' have the same content. Hence, we can reuse these objects to save memory and computation time. Without this, large builds seem to run forever: oss-review-toolkit#9763 This PR is a refined version of the fix posted in the error description of oss-review-toolkit#9763 Signed-off-by: Jendrik Johannes <[email protected]>
Only create one 'OrtDependency' for each 'ResolvedComponentResult'. The 'ResolvedComponentResult' is immutable and therefore all 'OrtDependency' object derived from the same 'ResolvedComponentResult' have the same content. Hence, we can reuse these objects to save memory and computation time. This PR is a refined version of the fix posted in the error description of oss-review-toolkit#9763. Signed-off-by: Jendrik Johannes <[email protected]>
Only create one 'OrtDependency' for each 'ResolvedComponentResult'. The 'ResolvedComponentResult' is immutable and therefore all 'OrtDependency' object derived from the same 'ResolvedComponentResult' have the same content. Hence, we can reuse these objects to save memory and computation time. This PR is a refined version of the fix posted in the error description of oss-review-toolkit#9763. Signed-off-by: Jendrik Johannes <[email protected]>
Only create one 'OrtDependency' for each 'ResolvedComponentResult'. The 'ResolvedComponentResult' is immutable and therefore all 'OrtDependency' object derived from the same 'ResolvedComponentResult' have the same content. Hence, we can reuse these objects to save memory and computation time. This PR is a refined version of the fix posted in the error description of [1]. [1]: oss-review-toolkit#9763 Signed-off-by: Jendrik Johannes <[email protected]>
Only create one 'OrtDependency' for each 'ResolvedComponentResult'. The 'ResolvedComponentResult' is immutable and therefore all 'OrtDependency' object derived from the same 'ResolvedComponentResult' have the same content. Hence, we can reuse these objects to save memory and computation time. This PR is a refined version of the fix posted in the error description of [1]. [1]: #9763 Signed-off-by: Jendrik Johannes <[email protected]>
A similar issue was faced during the creation of a report for a Gradle project. I tried all the formats, but nothing seems to work. Additionally, while debugging, it appears to loop indefinitely while handling the dependencies graph. ort: |
Updates: I went as far as v41, trying to run the Analyzer, then Reporter. Analyzer produced the zipped results file. Reporter crashed the laptop with 16GB memory given to Java. Then I read the discussion #9875, and voilá, WebApp reports started to happily run again. Thanks @mnonnenmacher and @sschuberth for the tip! |
Describe the bug
We found an Infiniti-loop in the analyzer.
The project we want to analyse is https://github.com/hashgraph/hedera-services and the .ort.yml can be found here: https://github.com/hendrikebbers/ort-scan-hedera/blob/main/ort-config/hedera-services.yml
When we initially executed the analyzer it always crashed with an OutOfMemoryError in the Gradle Daemon. Even if we set the memory to 30 GB. We figured out, that the problem is located to
OrtModelBuilder.tk
. We did a local fix for that class and introduced a cache of typemutableMapOf<ComponentIdentifier, OrtDependency>()
that is used in thetoOrtDependencies
method. Instead of creating new OrtDependencyImpl instance all the time in thetoOrtDependencies
method we check if the cache already contains an instance with the given ID and than return that instance. I already discussed that change with @sschuberth and since some changes are needed I have not created a PR so far.Our concrete changes as a git patch:
With that change the Gradle deamon does not dies anymore and the analyse results are send back sucessfully to the ORT process. Sadly that runs endlessly. I killed the process after 16 hours but attached an VisualVm agend in between to check if it is still running or just blocked. The process was running all the time in the same code areas as you can see on the attached screenshots.
To Reproduce
.ort.yml
file with the content of https://github.com/hendrikebbers/ort-scan-hedera/blob/main/ort-config/hedera-services.ymlOrtModelBuilder.tk
based on the given git patch--debug -P ort.analyzer.allowDynamicVersions=true analyze -i PATH/TO/REPO -o PATH/TO/REPO
Expected behavior
The process should finish after some time and the analyser result should be stores in a file.
The text was updated successfully, but these errors were encountered: