The PrusaSlicer currently fails to build on multiple architectures due to an
uninitialized field in GravityKernel.hpp .
This bug causes a unit test failure, but this doesn't always show.
The bug is in src/libslic3r/Arrange/Core/NFP/Kernels/GravityKernel.hpp line 18:
Vec2d active_sink;
This struct field is not initialized because the default constructor of Vec2d
(which is a type alias to Eigen::Matrix<double, 2, 1>) does nothing. This is
documented behavior, but was not respected in the PrusaSlicer source code:
https://eigen.tuxfamily.org/dox/group__TutorialMatrixClass.html
allocation, and never initializes the matrix coefficients.
This issue was partially fixed in upstream commit
f2ae32780eb8ec9437e0134b08a5e1c752353527, but the default constructor was not
replaced. It's not clear if this is still an issue or not, but the following
patch should at least be backported to Debian to fix the FTBFS issue in
PrusaSlicer:
commit f2ae32780eb8ec9437e0134b08a5e1c752353527
Author: tamasmeszaros <meszaros.q@gmail.com>
Date: Mon Oct 2 12:07:14 2023 +0200
Fix failing arrange test on newest msvc
diff --git a/src/libslic3r/Arrange/Core/NFP/Kernels/GravityKernel.hpp
b/src/libslic3r/Arrange/Core/NFP/Kernels/GravityKernel.hpp
index c8a5488b3..3bb1cad0e 100644
--- a/src/libslic3r/Arrange/Core/NFP/Kernels/GravityKernel.hpp
+++ b/src/libslic3r/Arrange/Core/NFP/Kernels/GravityKernel.hpp
@@ -17,7 +17,9 @@ struct GravityKernel {
std::optional<Vec2crd> item_sink;
Vec2d active_sink;
- GravityKernel(Vec2crd gravity_center) : sink{gravity_center} {}
+ GravityKernel(Vec2crd gravity_center) :
+ sink{gravity_center}, active_sink{unscaled(gravity_center)} {}
+
GravityKernel() = default;
template<class ArrItem>