Describe the bug
When running our test suite using the valgrind/memcheck tool, we discovered that the assigned variable on line 256 in gecode/int/channel/dom.hpp can end up uninitialized. This is a problem as it is used in an if statement on line 258, triggering a 'Conditional jump or move depends on uninitialised value(s)' warning in memcheck.
Clearly, the code expects that the distinct propagate() call on line 257 will set the assigned variable, but it is pretty straightforward to see that the assigned reference parameter is not always assigned a value in propagate().
I don't know how serious this issue is, but we have not observed any actual bad behavior except for the memcheck warning. It also seems clear that the distinct propagator is called with an uninitialized assigned variable in a few other cases in the code.
To Reproduce
I don't know of a simple way to reproduce the problem outside of our internal test case, but it should be fairly straightforward to manually find the issue from the description above.
Gecode and Platform Configuration
Gecode 6.2.0
Red Hat Enterprise Linux 7
g++ (GCC) 10.2.1 20210130 (Red Hat 10.2.1-11)
Valgrind-3.15.0
Describe the bug
When running our test suite using the valgrind/memcheck tool, we discovered that the
assignedvariable on line 256 in gecode/int/channel/dom.hpp can end up uninitialized. This is a problem as it is used in an if statement on line 258, triggering a 'Conditional jump or move depends on uninitialised value(s)' warning in memcheck.Clearly, the code expects that the
distinctpropagate()call on line 257 will set theassignedvariable, but it is pretty straightforward to see that theassignedreference parameter is not always assigned a value inpropagate().I don't know how serious this issue is, but we have not observed any actual bad behavior except for the memcheck warning. It also seems clear that the
distinctpropagator is called with an uninitializedassignedvariable in a few other cases in the code.To Reproduce
I don't know of a simple way to reproduce the problem outside of our internal test case, but it should be fairly straightforward to manually find the issue from the description above.
Gecode and Platform Configuration
Gecode 6.2.0
Red Hat Enterprise Linux 7
g++ (GCC) 10.2.1 20210130 (Red Hat 10.2.1-11)
Valgrind-3.15.0