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

UBSAN runtime errors #5510

Closed
mattdowle opened this issue Nov 2, 2022 · 1 comment · Fixed by #5832
Closed

UBSAN runtime errors #5510

mattdowle opened this issue Nov 2, 2022 · 1 comment · Fixed by #5832
Assignees
Labels
Milestone

Comments

@mattdowle
Copy link
Member

mattdowle commented Nov 2, 2022

Ran dev through full Rdevel-strict-clang CMD check added in #5509

$ find data.table.Rcheck -name "*.Rout" -exec grep -H "runtime error" {} \;
data.table.Rcheck/tests/nafill.Rout:assign.c:1006:21: runtime error: inf is outside the range of representable values of type 'int'
data.table.Rcheck/tests/nafill.Rout:assign.c:899:21: runtime error: -4.61169e+18 is outside the range of representable values of type 'int'
data.table.Rcheck/tests/nafill.Rout:assign.c:906:21: runtime error: -4.61169e+18 is outside the range of representable values of type 'int'
data.table.Rcheck/tests/nafill.Rout:assign.c:1023:21: runtime error: -1.84467e+19 is outside the range of representable values of type 'long'
data.table.Rcheck/tests/main.Rout:utils.c:8:38: runtime error: 2.14748e+09 is outside the range of representable values of type 'int'
data.table.Rcheck/tests/main.Rout:gsumm.c:1167:70: runtime error: nan is outside the range of representable values of type 'long'

I'll need to run again but using test.data.table() to get the test numbers ...

@mattdowle mattdowle added the tests label Nov 2, 2022
@mattdowle mattdowle added this to the 1.14.5 milestone Nov 2, 2022
@mattdowle
Copy link
Member Author

> test.data.table()
...
Running test id 2206.02          utils.c:8:38: runtime error: 2.14748e+09 is outside the range of representable values of type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior utils.c:8:38 in 
Running test id 2226.2          gsumm.c:1167:70: runtime error: nan is outside the range of representable values of type 'long'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior gsumm.c:1167:70 in 
...

> test.data.table("nafill.Rraw")
...
Running test id 1.08          assign.c:1006:21: runtime error: inf is outside the range of representable values of type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior assign.c:1006:21 in 
Running test id 6.47          assign.c:899:21: runtime error: -4.61169e+18 is outside the range of representable values of type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior assign.c:899:21 in 
assign.c:906:21: runtime error: -4.61169e+18 is outside the range of representable values of type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior assign.c:906:21 in 
Running test id 6.48          assign.c:1023:21: runtime error: -1.84467e+19 is outside the range of representable values of type 'long'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior assign.c:1023:21 in 
...

@jangorecki jangorecki modified the milestones: 1.14.9, 1.15.0 Oct 29, 2023
HughParsonage added a commit that referenced this issue Dec 17, 2023
Note that some double -> integer64 conversions
are collapsed into the one warning, affecting
tests, so these have been updated.
@HughParsonage HughParsonage self-assigned this Dec 17, 2023
MichaelChirico added a commit that referenced this issue Dec 26, 2023
* Fix UB via int conversion (#5510)

Note that some double -> integer64 conversions
are collapsed into the one warning, affecting
tests, so these have been updated.

* Ensure nan is not coerced. Closes #5510

* Fix '1' mistakenly removed from earlier commit

* Re #5834

* Rename function more sensibly

* Incorporate finite checks into the logic

* Suspend int64 coerce tests subject to #5834

* Update CODEOWNERS

* Revert CODEOWNERS

* Update CODEOWNERS

With extant file endings

* Simplify logic for integer check

* Check for NA_INTEGER superfluous

* Test 6.53 should emit warning on -2^31

* C++ toolkit included by default

* first pass at fix

* Simplify/unite with within_int64_repres()

* weak inequality

---------

Co-authored-by: Michael Chirico <chiricom@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants