Skip to content

Undefined Behavior failures #498

@Ravenwater

Description

@Ravenwater

Run ctest --rerun-failed --output-on-failure
Test project /home/runner/work/universal/universal/build
Start 610: math_distinct_powers
1/3 Test #610: math_distinct_powers .............***Failed 0.04 sec
/home/runner/work/universal/universal/./include/sw/universal/native/integers.hpp:33:11: runtime error: signed integer overflow: 2147483648 * 4294967296 cannot be represented in type 'int64_t' (aka 'long')
#0 0x55759c2a8c66 in sw::universal::ipow(long, unsigned int) /home/runner/work/universal/universal/./include/sw/universal/native/integers.hpp:33:11
#1 0x55759c2a793b in sw::universal::DistinctPowerCombinations(unsigned long, unsigned long) /home/runner/work/universal/universal/applications/precision/math/distinct_powers.cpp:76:24
#2 0x55759c2a7a36 in main /home/runner/work/universal/universal/applications/precision/math/distinct_powers.cpp:97:24
#3 0x7fb9cb22a1c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e)
#4 0x7fb9cb22a28a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e)
#5 0x55759c27c5f4 in _start (/home/runner/work/universal/universal/build/applications/precision/math/math_distinct_powers+0x255f4) (BuildId: d9d761e1ea9db09d18988c37657d0c39df28b28c)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/runner/work/universal/universal/./include/sw/universal/native/integers.hpp:33:11

Start 653: c_api_shim_performance

2/3 Test #653: c_api_shim_performance ...........***Failed 0.77 sec
/home/runner/work/universal/universal/./include/sw/universal/number/posit/specialized/posit_32_2.hpp:867:40: runtime error: shift exponent 61 is too large for 32-bit type 'int'
#0 0x5596b80da2d4 in sw::universal::posit<32u, 2u>::adjustAndRound(signed char, unsigned int, unsigned long, bool) const /home/runner/work/universal/universal/./include/sw/universal/number/posit/specialized/posit_32_2.hpp:867:40
#1 0x5596b80d9e29 in sw::universal::posit<32u, 2u>::operator/=(sw::universal::posit<32u, 2u> const&) /home/runner/work/universal/universal/./include/sw/universal/number/posit/specialized/posit_32_2.hpp:409:11
#2 0x5596b80d9771 in sw::universal::posit<32u, 2u> sw::universal::operator/<32u, 2u>(sw::universal::posit<32u, 2u> const&, sw::universal::posit<32u, 2u> const&) /home/runner/work/universal/universal/./include/sw/universal/number/posit/posit_impl.hpp:1899:15
#3 0x5596b80d9702 in op_div<32ul, 2ul>::op(sw::universal::posit<32u, 2u>, sw::universal::posit<32u, 2u>) /home/runner/work/universal/universal/c_api/shim/posit/posit_c_api.cpp:173:1
#4 0x5596b806b53e in posit32_u capi<32ul, 2ul, posit32_u, posit32x2_s, convert_bytes<32ul, 2ul, posit32_u>>::op21<op_div<32ul, 2ul>>(posit32_u, posit32_u) /home/runner/work/universal/universal/c_api/shim/posit/posit_c_api.cpp:235:26
#5 0x5596b806648c in posit32_divp32 /home/runner/work/universal/universal/./include/sw/universal/number/posit/posit_c_macros.h:99:1
#6 0x5596b80645e0 in posit32_div /home/runner/work/universal/universal/./include/sw/universal/number/posit/posit_c_macros.h:99:1
#7 0x5596b806453b in DivisionWorkloadPosit32 /home/runner/work/universal/universal/c_api/shim/test/posit/performance.c:368:7
#8 0x5596b8061bbb in PerformanceRunner /home/runner/work/universal/universal/./include/sw/universal/benchmark/performance_runner.h:77:5
#9 0x5596b80649de in TestArithmeticOperatorPerformance /home/runner/work/universal/universal/c_api/shim/test/posit/performance.c:420:2
#10 0x5596b8064aa2 in main /home/runner/work/universal/universal/c_api/shim/test/posit/performance.c:451:2
#11 0x7f2b6ac2a1c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e)
#12 0x7f2b6ac2a28a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e)
#13 0x5596b80365e4 in _start (/home/runner/work/universal/universal/build/c_api/shim/test/posit/c_api_shim_performance+0x805e4) (BuildId: 384e6a68cebb953c940e3e9e63f06dd28d13d953)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/runner/work/universal/universal/./include/sw/universal/number/posit/specialized/posit_32_2.hpp:867:40

Start 657: c_api_shim_posit32

3/3 Test #657: c_api_shim_posit32 ...............*Failed 2.81 sec
/home/runner/work/universal/universal/./include/sw/universal/number/posit/specialized/posit_32_2.hpp:804:24: runtime error: shift exponent 60 is too large for 32-bit type 'int'
#0 0x564d8c707e6e in sw::universal::posit<32u, 2u>::round_mul(signed char, unsigned int, unsigned long) const /home/runner/work/universal/universal/./include/sw/universal/number/posit/specialized/posit_32_2.hpp:804:24
#1 0x564d8c707a85 in sw::universal::posit<32u, 2u>::operator
=(sw::universal::posit<32u, 2u> const&) /home/runner/work/universal/universal/./include/sw/universal/number/posit/specialized/posit_32_2.hpp:328:11
#2 0x564d8c707531 in sw::universal::posit<32u, 2u> sw::universal::operator
<32u, 2u>(sw::universal::posit<32u, 2u> const&, sw::universal::posit<32u, 2u> const&) /home/runner/work/universal/universal/./include/sw/universal/number/posit/posit_impl.hpp:1893:13
#3 0x564d8c7074c2 in op_mul<32ul, 2ul>::op(sw::universal::posit<32u, 2u>, sw::universal::posit<32u, 2u>) /home/runner/work/universal/universal/c_api/shim/posit/posit_c_api.cpp:172:1
#4 0x564d8c699f3e in posit32_u capi<32ul, 2ul, posit32_u, posit32x2_s, convert_bytes<32ul, 2ul, posit32_u>>::op21<op_mul<32ul, 2ul>>(posit32_u, posit32_u) /home/runner/work/universal/universal/c_api/shim/posit/posit_c_api.cpp:235:26
#5 0x564d8c694ebc in posit32_mulp32 /home/runner/work/universal/universal/./include/sw/universal/number/posit/posit_c_macros.h:98:1
#6 0x564d8c693490 in posit32_mul /home/runner/work/universal/universal/./include/sw/universal/number/posit/posit_c_macros.h:98:1
#7 0x564d8c692f5e in main /home/runner/work/universal/universal/c_api/shim/test/posit/posit32.c:109:9
#8 0x7f0da8a2a1c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e)
#9 0x7f0da8a2a28a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e)
#10 0x564d8c6675e4 in _start (/home/runner/work/universal/universal/build/c_api/shim/test/posit/c_api_shim_posit32+0x7f5e4) (BuildId: 10e639867b7cd295429d0ac3daad81ee20986ca3)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/runner/work/universal/universal/./include/sw/universal/number/posit/specialized/posit_32_2.hpp:804:24

0% tests passed, 3 tests failed out of 3

Total Test time (real) = 3.63 sec

The following tests FAILED:
610 - math_distinct_powers (Failed)
653 - c_api_shim_performance (Failed)
657 - c_api_shim_posit32 (Failed)
Errors while running CTest
Error: Process completed with exit code 8.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions