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
Crash with some formatters in v1.63.2 #12852
Comments
I noticed when looking at the So it would seem that perhaps this is problem with the data I have in my cache. Is that sufficient resolution to this? Shall I just close the issue? The contents of that cached file is: |
I can reproduce this by creating a new empty file and running rubocop on it twice. Only the second run will error. |
@Earlopain interestingly (to me at least) This problem only happens when caching is involved. I moved aside my cache directory and ran rubocop with the debug flag. It ran fine and I could see my empty file was being scanned. I ran a few more times immediately and the next 2 or 3 times the file was still scanned but then the file was being picked up by the cache and rubocop was crashing. |
Check out the attached PR, that should fix this. Let me know if that works for you. |
This does appear to correct the problem. |
[Fix #12852] Correctly deserialize a global offense
After upgrading to v1.63.2 from 1.62.1 I found that the default formatter resulted in a crash:
I went through all the documented formatters and found the following results:
I then spot checked
clang
andmarkdown
in previous versions. I found thatclang
started failing in 1.63.1 whilemarkdown
was failing since at least 1.62.1Expected behavior
I expect rubocop not to crash when using some formatters.
Actual behavior
(not including
--debug
output here as the file is 2.1Mb... but I can provide that data if needed)Rubocop will run and report errors for a while and then crash with an error:
index 0 outside of array bounds: 0...0
and a stack trace:Most of the tested formatters that failed did have this failure coming from
clang_style_formatter
but markdown and html have failures starting in their formatters.Steps to reproduce the problem
I am unsure which rule is triggering the failure but it seems that most commonly the error seen just before the crash is:
Lint/EmptyFile: Empty file detected.
RuboCop version
The text was updated successfully, but these errors were encountered: