-
-
Notifications
You must be signed in to change notification settings - Fork 386
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
Panic inside vm.Run #385
Comments
The first panic is on the line:
This means that the instruction pointer points to a wrong address. But this is strange, as a few lines above we have check:
Very interesting. Is it possible to add a wrapper with recover and log the executed expression? |
Also, could you make sure that you don't reuse VM in different threads? |
I added wrapper and caught the panic once again (same stacktrace).
So, the environment is something like this:
And I will keep my eye on it to prove that panics happen only for this expression. I checked the code and seems highly unlikely that VM is being used in different threads. |
The code looks ok. Lets true to take a look at what program (already compiled) is executed during panic. Please, log the program as JSON, and as |
Should getting the program as JSON be done as something like this |
The whole program. Or some sort of other dump technics you can find out. |
@Bychin any news on the problem? |
@antonmedv so I wasn't able to reproduce the problems after a little change. So previously I was using the VM like this:
|
I will close this issue as it not a problem any more. Feel free to create another issue if someone encounters a panic in vm. |
Hi!
I have encountered a panic inside
vm.Run
method -runtime error: index out of range [-1]
.The code is running 24/7 and the part with
expr
is used all the time, but the panic occurs ~once per day.Stacktrace:
So from what I can see in the source code in
github.com/antonmedv/expr/vm/vm.go
the first panic was recovered and the second happened inside thedefer
:Please feel free to ask for more information if you need.
The text was updated successfully, but these errors were encountered: