I have encountered several occasions of the following error with MiniZinc 2.8.7:
MiniZinc error: Memory violation detected (segmentation fault).
This is a bug. Please file a bug report using the MiniZinc bug tracker.
Process finished with non-zero exit code -1073740791.
I managed to reduce one occurrence of the problem to the following example:
array[1..10] of var 0..10: arr;
array[1..10] of var opt 0..10: arr_opt;
constraint forall (j in 1..10) (arr_opt[j] == if j == 1 then <> else arr[j] endif);
solve satisfy;
It occurs in the compilation step independent of the selected solver, and with different optimization levels. It occurs on different machines with Windows 10 or 11, both from the IDE and command line. I am pretty sure that the original model I extracted this example from did work with a previous version of MiniZinc.
There are many small changes to the MiniZinc model that make the issue disappear:
Changing the constraint to if j == 1 then arr_opt[j] == <> else arr_opt[j] == arr[j] endif
Changing either the <> or the arr[j] in the constraint to a constant.
Adding the (redundant) constraint constraint arr_opt[1] == <>; to the model
I have encountered several occasions of the following error with MiniZinc 2.8.7:
I managed to reduce one occurrence of the problem to the following example:
It occurs in the compilation step independent of the selected solver, and with different optimization levels. It occurs on different machines with Windows 10 or 11, both from the IDE and command line. I am pretty sure that the original model I extracted this example from did work with a previous version of MiniZinc.
There are many small changes to the MiniZinc model that make the issue disappear:
if j == 1 then arr_opt[j] == <> else arr_opt[j] == arr[j] endif
constraint arr_opt[1] == <>;
to the model