bug-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-glpk] glpsol: crash on display


From: Andrew Makhorin
Subject: Re: [Bug-glpk] glpsol: crash on display
Date: Wed, 19 Nov 2008 03:14:23 +0300

> no idea if the MathProg statements below are legal.
> However, I'm sure the solver should not crash :)

> $> cat segfault.mod
> set samples dimen 4;

> set bnodes := (setof{(sid, bid, temp, rep) in samples: bid !in bnodes}
> bid);
> display bnodes;

> data;
> set samples :=
> # sid  bid  temp  rep
> (  A,   Z,   10,   1 )
> (  B,   Z,   10,   1 )
> (  C,   Z,   20,   1 )
> ;
> end;

> $> glpsol --math segfault.mod
> Reading model section from segfault.mod...
> Reading data section from segfault.mod...
> 15 lines were read
> Display statement at line 4
> Segmentation fault

> $> glpsol --version
> GLPSOL: GLPK LP/MIP Solver 4.32

Formally, your model is valid. However, mathprog allows recursive
definitions of sets and parameters, and your model leads to infinite
recursion on computing the set 'bnodes' that (most probably) causes
the stack overflow.

Note that the setof operator builds a set in the mathematical sense,
i.e. it guarantees that each distinct element included in the set
appears in it exactly once, so you do not need to perform corresponding
check.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]