Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign uppromql: int overflow not checked #2165
Comments
beorn7
added
kind/bug
component/promql
labels
Nov 4, 2016
beorn7
self-assigned this
Nov 4, 2016
beorn7
referenced this issue
Nov 4, 2016
Merged
Check for int64 overflow when converting from float64 #2167
beorn7
closed this
Nov 9, 2016
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 24, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
lock
bot
locked and limited conversation to collaborators
Mar 24, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
beorn7 commentedNov 4, 2016
The float64 sample value can overflow an int, even and int64. We blindly convert to int (and not even int64) for the MOD operator in
engine.go. This silently gives weird results instead of erroring or NaN'ing. It also breaks the test on certain architectures, cf. #2058.The evalInt method has a similar issue.
evalInt should probably error out (as that's somewhere where an error is expected anyway). MOD should probably yield NaN (similar to MOD by 0).