MiniZinc / libminizinc

The MiniZinc compiler
http://www.minizinc.org
Other
516 stars 81 forks source link

Segmentation fault on compilation #864

Open kletzi opened 2 weeks ago

kletzi commented 2 weeks ago

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: