You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compile CuraEngine for a CPU architecture with a 32-bit size_t
Run unit test InfillTest
Actual Results
...
5:
5: [ FATAL ] /usr/include/gtest/internal/gtest-param-util.h:585:: Condition IsValidParamName(param_name) failed. Parameterized test name 'InfillTestParameters_P2_Z0_C0_L350__-4294967296' is invalid, in ./tests/InfillTest.cpp line 241
5:
...
96% tests passed, 1 tests failed out of 26
Total Test time (real) = 10.85 sec
The following tests FAILED:
5 - InfillTest (Subprocess aborted)
Errors while running CTest
make[1]: *** [Makefile:94: test] Error 8
Expected results
The unit test succeeds.
Additional Information
The bug lies in the a printf format string, where %lld is incorrectly used to format a size_t argument.
InfillTest runs with very high numbers for this argument which will cause a rollover on 32 architectures if they're interpreted as signed, but size_t is unsigned.
To fix the issue, the correct format string for size_t should be used: %zu
Alternatively, changing %lld to %llu will also work in most cases.
Application Version
5.0.0 until current HEAD ( ef46801 )
Platform
Linux on i686 (or any 32-bit architecture)
Qt
N/A
PyQt
N/A
Display Driver
N/A
Steps to Reproduce
size_t
InfillTest
Actual Results
Expected results
The unit test succeeds.
Additional Information
The bug lies in the a
printf
format string, where%lld
is incorrectly used to format asize_t
argument.InfillTest runs with very high numbers for this argument which will cause a rollover on 32 architectures if they're interpreted as signed, but
size_t
is unsigned.To fix the issue, the correct format string for
size_t
should be used:%zu
Alternatively, changing
%lld
to%llu
will also work in most cases.This occurred during automatic unit testing of CuraEngine 5.0.0 in Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1040252
But the bug is still present in current HEAD: https://github.com/Ultimaker/CuraEngine/blob/main/tests/InfillTest.cpp#L103
The text was updated successfully, but these errors were encountered: