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
IgnoredReturnValue randomly crashes #5403
Comments
Also having similar issues, just commenting to hopefully get more visibility on this. Rerunning a few times usually gets CI to pass but it's rather annoying. |
I’ll investigate this issue to confirm my suspicion. |
IgnoredReturnValue crashes due to the usage of a non-thread-safe collection operation. The usage of `Iterable<T>.plus()` causes this problem. The crash in parallel mode is fixed by iterating over each collection by itself. See here for more details in detekt v1.21: https://github.com/detekt/detekt/blob/32f6e22d9524804ebbb51d31e53cd28a84864ed6/detekt-rules-errorprone/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/IgnoredReturnValue.kt#L90 Closes #5403
IgnoredReturnValue crashes due to the usage of a non-thread-safe collection operation. The usage of `Iterable<T>.plus()` causes this problem. The crash in parallel mode is fixed by iterating over each collection by itself. See here for more details in detekt v1.21: https://github.com/detekt/detekt/blob/32f6e22d9524804ebbb51d31e53cd28a84864ed6/detekt-rules-errorprone/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/IgnoredReturnValue.kt#L90 Closes #5403
This is still happening randomly on our CI after the 1.22 upgrade. |
@cortinico @BraisGabin Happy New Year! As previously brought up by my colleague, this is issue seems to be present still on 1.22. Would it make sense to re-open the issue? Is there anything we could do to help tackling it? |
Updated stack trace and repro steps would be great. |
I believe the problem is in this line: Line 118 in 2e6b576
We should probably refrain from doing a Having a repro would help debug this though 👍 |
Well spotted! That's another usage of a non-thread-safe collection operation.
|
part 2 of #5403: IgnoredReturnValue crashes due to the usage of a non-thread-safe collection operation. The usage of `Iterable<T>.plus()` causes this problem. The crash in parallel mode is fixed by iterating over each collection by itself. See here for more details in detekt v1.21: https://github.com/detekt/detekt/blob/32f6e22d9524804ebbb51d31e53cd28a84864ed6/detekt-rules-errorprone/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/IgnoredReturnValue.kt#L90 Closes #5403
* Fix IgnoredReturnValue rule crash in parallel mode part 2 of #5403: IgnoredReturnValue crashes due to the usage of a non-thread-safe collection operation. The usage of `Iterable<T>.plus()` causes this problem. The crash in parallel mode is fixed by iterating over each collection by itself. See here for more details in detekt v1.21: https://github.com/detekt/detekt/blob/32f6e22d9524804ebbb51d31e53cd28a84864ed6/detekt-rules-errorprone/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/IgnoredReturnValue.kt#L90 Closes #5403 * Add missing newline before ")"
(Apologies first: This is probably the worst kind of bug reports. I can't reliably reproduce the failure. The crash happens seemingly randomly when parsing different files, and seemingly more often in parallel mode (but I'm not 100% sure). Rerunning detekt almost always makes the crash go away.)
Expected Behavior
The rule works. Nothing crashes.
Observed Behavior
Steps to Reproduce
Scan a lot of large test files (we use assertj which has lots of
@CheckResult
annotations) in parallel mode repeatedly.Your Environment
--scan
option when running the gradle task): privateThe text was updated successfully, but these errors were encountered: