-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
While reviewing for JOSS (openjournals/joss-reviews#5272), I encountered the following errors in the unit tests:
- There was a segmentation fault caused by https://github.com/AngryMaciek/hypercomplex/blob/master/.test/unit/test.cpp#L1553
- There seem to be some integer overflows happening in the testcase "Hypercomplex: Polynomial lib test" (https://github.com/AngryMaciek/hypercomplex/blob/master/.test/unit/test.cpp#L1628), which I suspect was not intentional.
After changing L1553 to Polynomial<9>, I got this output:
[ludo@unit 0]# g++ -g -fsanitize=address,undefined test.cpp -lmpfr -I../../
[ludo@unit 0]# ./a.out "*Polynomial lib test*"
Filters: *Polynomial lib test*
../../hypercomplex/./Polynomial.hpp:221:23: runtime error: signed integer overflow: 2350762724241362075 + 7026887158483631575 cannot be represented in type 'long int'
../../hypercomplex/./Polynomial.hpp:223:68: runtime error: signed integer overflow: 4687921697387726500 + 7020006581695868425 cannot be represented in type 'long int'
../../hypercomplex/./Polynomial.hpp:184:65: runtime error: signed integer overflow: 4741992405962908075 + 4741992405962908075 cannot be represented in type 'long int'
../../hypercomplex/./Polynomial.hpp:200:65: runtime error: signed integer overflow: 8658947902678907891 - -5880580300698688189 cannot be represented in type 'long int'
../../hypercomplex/./Polynomial.hpp:221:31: runtime error: signed integer overflow: -3907215870331955536 * -635402420 cannot be represented in type 'long int'
1,0,2,0,2
2,1,0,0,2
3,0,2,2,2
0,3,1,1,3
===============================================================================
All tests passed (199 assertions in 1 test case)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working