-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
Running scc --min crash with divide by zero error #223
Comments
Wow I don't even know how to replicate that... although I know where it occurs.
It only happens because somehow the number of lines is zero, and yet... that should never happen because any content would indicate there is at least one line! It's possible, its a file consisting of just null bytes or some such though I guess. Anyway will I try to replicate that, I have put in a fix on master. If you are able to build from there that should resolve the issue. Otherwise let me know and I can put a build here for you to try. I won't be pushing out the next build till the next version of Go is released so I can get builds for the new M1 Apple machines done at the same time. |
After reading your comment I noticed that I have 0 lines of RestructuredText, because of a |
I tried the latest master, and no more error when running with |
Great! No worries at all. Thank's for reporting it so well allowing me to fix it quickly. Hope it unblocks you from whatever you were working on. |
Ok |
@danadalleh glad it works for you too |
Would reopen the issue as I have the exact same problem using the latest
Everything works when the file is EDIT: Just read @boyter comment at the top stating that it should be fixed on master. Is there a way to get a prerelease version of 3.0 now? Sorry for the inconvenience. |
Ah now that's interesting. The BOM of UTF-8 file. I might have another look to ensure this is resolved, but I suspect it will be. Might explain some other issues though so worth investigating again. |
Confirmed that this is indeed resolved on master. You get interesting output,
Because it shows scc processing 3 bytes, but that file having literally nothing in it. Which is correct for a BOM file. Anyway appears still to be resolved. @d-bauer Pretty sure you are using Windows. Attached a build for you which should fix this for you. Its pretty stable, just not finished for 3.0.0 yet. |
@boyter Thank you very much for your quick response. Yes I use windows, thanks for the provided version. I appreciate it 👍 |
@d-bauer No worries at all. In fact you can even get the real 3.0.0 release now! |
Describe the bug
Running scc with the
--min
argument on my code base results in a divide by zero errorTo Reproduce
Unfortunately I cant share the code thats causing this (2m+ lines of company code), hopefully you will get some clue by the stack trace.
I run
scc --min
orscc --min-gen
. I tried some other options and they work as expected..Expected behavior
No crash :)
Desktop (please complete the following information):
ps. SCC is great, just found it the other day while looking for easy to install and fast alternative to cloc, thanks!
The text was updated successfully, but these errors were encountered: