-
Notifications
You must be signed in to change notification settings - Fork 51
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
Slice out of range error #129
Comments
@ajnavarro how can I reproduce it? |
I would try to send to |
Enry already has a test with nil content, as you can see here. It's for the general function Anyway, I added a couple of cases with There is a weird thing, the function where the process is raising a panic ( For the moment, I couldn't reproduce yet the panic in local. Keep on it. |
Eventually I couldn't reproduce the panic, so I didn't check if #130 fix the problem at all. About the previous comment, some other things should be known about this issue:
Anyway, PR #130 try to fix this checking for empty or nil content before call |
I can reproduce it too and it blocks us.
I will try to reproduce it because I am desperate and cannot work forward. |
@ajnavarro I think it makes sense to allow enry crash and just skip the corresponding file, recording it to the errors list together with stderr output. E.g. we used to do it in our Python pipeline. |
@abeaumont I confirm that there is no panic with the latest release. |
great, closing then. |
Hi, it looks like that this issue still exists. It appears quite rarely, so it should be tricky to debug. @abeaumont , @mcarmonaa , what do you think? |
@EgorBu You need to prove that Engine uses the updated version. When I used to have similar issues, I ran Engine locally, without a container, and replaced libenry.so in the engine's JAR with the manually built binary. And for sure in that case you need to prove that your patched JAR is used - sometimes Maven decides to overwrite it. |
@vmarkovtsev , from src-d/sourced-ce#243 (comment) - it should be enry 1.6.1 |
The issue can be reopened if needed. Do you have a file sample causing the crash? Does the problem also happen when enry cli is used? |
@abeaumont, unfortunately - no. Because it rarely happens. Most of the times - everything works well, and sometimes it fails on the same dataset. |
Even if frequency is low, it must happen with some file... that would be best information for debugging. Apart from that, an updated stack trace would also help. |
Do you want stack trace like in src-d/sourced-ce#243 (comment) ? Or something else? |
@EgorBu yes, that one. Apparently you're passing an empty filename and that's causing the problem. I'll fix enry to avoid that crash, you may want to workaround it by filtering files without name in the meantime. |
Interesting that it works most of the times if it always should be empty |
We can hit two different problems here: breaking on empty filenames and the engine probabilistically supplying empty file names due to some crazy race or whatever. |
sounds reasonable. |
Calling to
GetLanguage
method, sometimes we receive this error:panic: runtime error: slice bounds out of range
goroutine 17 [running, locked to thread]:
bytes.Count(0x7f627818c0d0, 0x4b, 0x0, 0x1c420038c20, 0x1, 0x20, 0x0)
/home/travis/.gimme/versions/go1.8.linux.amd64/src/bytes/bytes.go:62 +0x21d
gopkg.in/src-d/enry%2ev1.getHeaderAndFooter(0x7f627818c0d0, 0x4b, 0x0, 0x0, 0x0, 0x0)
/home/travis/gopath/src/gopkg.in/src-d/enry.v1/common.go:161 +0x9d
gopkg.in/src-d/enry%2ev1.GetLanguagesByModeline(0x7f627818f4a0, 0x0, 0x7f627818c0d0, 0x4b, 0x0, 0x7f62482e6c08, 0x0, 0x0, 0x0, 0x0, ...)
/home/travis/gopath/src/gopkg.in/src-d/enry.v1/common.go:142 +0x5c
gopkg.in/src-d/enry%2ev1.GetLanguages(0x7f627818f4a0, 0x0, 0x7f627818c0d0, 0x4b, 0x0, 0x0, 0x0, 0x0)
/home/travis/gopath/src/gopkg.in/src-d/enry.v1/common.go:126 +0x129
gopkg.in/src-d/enry%2ev1.GetLanguage(0x7f627818f4a0, 0x0, 0x7f627818c0d0, 0x4b, 0x0, 0x1c420038e48, 0x1c42001a500)
/home/travis/gopath/src/gopkg.in/src-d/enry.v1/common.go:38 +0x55
main.GetLanguage(0x7f627818f4a0, 0x0, 0x7f627818c0d0, 0x4b, 0x0, 0x0, 0x0)
/home/travis/build/src-d/enry/shared/enry.go:11 +0x55
main._cgoexpwrap_f7db11756761_GetLanguage(0x7f627818f4a0, 0x0, 0x7f627818c0d0, 0x4b, 0x0, 0x0, 0x0)
command-line-arguments/_obj/_cgo_gotypes.go:58 +0x9a
The text was updated successfully, but these errors were encountered: