MiniZinc / libminizinc

The MiniZinc compiler
http://www.minizinc.org
Other
512 stars 80 forks source link

minizinc crashes on one example: food.mzn #597

Closed yurivict closed 1 year ago

yurivict commented 2 years ago
$ minizinc food.mzn 
Segmentation fault

0 0x00000008004cdc30 in MiniZinc::SetLit::rehash() () from /usr/local/lib/libmzn.so

1 0x00000008003c346c in MiniZinc::SetLit::SetLit(MiniZinc::Location const&, std::1::vector<MiniZinc::Expression*, std::1::allocator<MiniZinc::Expression*> > const&) ()

from /usr/local/lib/libmzn.so

2 0x00000008003bc0f0 in mzn_yyparse(void*) () from /usr/local/lib/libmzn.so

3 0x00000008006c3219 in MiniZinc::parse(MiniZinc::Env&, MiniZinc::Model*&, std::1::vector<std::1::basic_string<char, std::__1::char_traits, std::1::allocator >, std::1:

:allocator<std::1::basic_string<char, std::__1::char_traits, std::1::allocator > > > const&, std::1::vector<std::1::basic_string<char, std::1::chartraits, std:: _1::allocator >, std::1::allocator<std::1::basic_string<char, std::1::char_traits, std::1::allocator > > > const&, std::1::basic_string<char, std::1::char_trait s, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::vector<std::1::basic_string<char, std:: __1::char_traits, std::1::allocator >, std::1::allocator<std::1::basic_string<char, std::1::char_traits, std::1::allocator > > > const&, std::1::unordered _set<std::1::basic_string<char, std::1::char_traits, std::1::allocator >, std::1::hash<std::__1::basic_string<char, std::1::char_traits, std::__1::allocator

, std::1::equal_to<std::__1::basic_string<char, std::1::char_traits, std::1::allocator > >, std::1::allocator<std::1::basic_string<char, std::__1::char_traits , std::1::allocator > > >, bool, bool, bool, bool, std::__1::basic_ostream<char, std::__1::char_traits >&) () from /usr/local/lib/libmzn.so

4 0x00000008006c5915 in MiniZinc::parse(MiniZinc::Env&, std::1::vector<std::1::basic_string<char, std::__1::char_traits, std::1::allocator >, std::1::allocator<std::__1

::basic_string<char, std::1::char_traits, std::1::allocator > > > const&, std::1::vector<std::__1::basic_string<char, std::1::char_traits, std::1::allocator , std::1::allocator<std::1::basic_string<char, std::__1::char_traits, std::1::allocator > > > const&, std::1::basic_string<char, std::__1::char_traits, std::1:: allocator > const&, std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, std::1::vector<std::1::basic_string<char, std::1::char_traits<ch ar>, std::1::allocator >, std::1::allocator<std::__1::basic_string<char, std::1::char_traits, std::1::allocator > > > const&, std::1::unordered_set<std::1::basi c_string<char, std::__1::char_traits, std::1::allocator >, std::1::hash<std::1::basic_string<char, std::1::char_traits, std::1::allocator > >, std::1::equ al_to<std::1::basic_string<char, std::1::char_traits, std::1::allocator > >, std::1::allocator<std::__1::basic_string<char, std::1::char_traits, std::1::allocat or > > >, bool, bool, bool, bool, std::1::basic_ostream<char, std::__1::char_traits >&) () from /usr/local/lib/libmzn.so

5 0x000000080062c865 in MiniZinc::Flattener::flatten(std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, std::__1::basic_string<char, std::__1::ch

ar_traits, std::__1::allocator > const&) () from /usr/local/lib/libmzn.so

6 0x00000008006f2376 in MiniZinc::MznSolver::flatten(std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, std::__1::basic_string<char, std::__1::ch

FreeBSD 13.1

yurivict commented 2 years ago

Debug build fails this way:

$ minizinc food.mzn
Error: Gecode: Float::linear: Number out of limits
=====ERROR=====
yurivict commented 2 years ago

food.mzn causes the failure.

cyderize commented 2 years ago

I can't seem to reproduce the crash on Windows/Linux - was this using one of our binaries?

I think the Gecode error is expected (var float without domains can often be problematic) - it would probably work with a solver like Gurobi or SCIP.

yurivict commented 2 years ago

This is with binaries from FreeBSD packages.