Skip to content
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

Fix from_unixtime for NaN input #2936

Closed

Conversation

mbasmanova
Copy link
Contributor

@mbasmanova mbasmanova commented Oct 24, 2022

from_unixtime(NaN, '') should return zero. Before the fix it was crashing under UBSAN:

velox/functions/prestosql/FromUnixTime.cpp:24:10: runtime error: nan is outside the range of representable values of type 'long'

SUMMARY: UndefinedBehaviorSanitizer: float-cast-overflow velox/functions/prestosql/FromUnixTime.cpp:24:10 in 

Fixes #2791

@netlify
Copy link

netlify bot commented Oct 24, 2022

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 75e9cd7
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/6356ea4812522c0009f71b52

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 24, 2022
@facebook-github-bot
Copy link
Contributor

@mbasmanova has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

1 similar comment
@facebook-github-bot
Copy link
Contributor

@mbasmanova has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Copy link
Contributor

@xiaoxmeng xiaoxmeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

from_unixtime() crashes with error: nan is outside the range of representable values of type 'long'
3 participants