From MAILER-DAEMON Sun Mar 05 11:08:40 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
id 1ckYi8-0008Gg-RF
for mharc-bug-glpk@gnu.org; Sun, 05 Mar 2017 11:08:40 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:55539)
by lists.gnu.org with esmtp (Exim 4.71) (envelope-from )
id 1ckYi7-0008GW-A2
for bug-glpk@gnu.org; Sun, 05 Mar 2017 11:08:40 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1ckYi3-0004z2-9a
for bug-glpk@gnu.org; Sun, 05 Mar 2017 11:08:39 -0500
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60995)
by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from )
id 1ckYi3-0004yw-5R
for bug-glpk@gnu.org; Sun, 05 Mar 2017 11:08:35 -0500
Received: from ppp91-76-90-30.pppoe.mtu-net.ru ([91.76.90.30]:42181
helo=[192.168.1.65]) by fencepost.gnu.org with esmtpa (Exim 4.82)
(envelope-from ) id 1ckYi2-000127-IU
for bug-glpk@gnu.org; Sun, 05 Mar 2017 11:08:34 -0500
Message-ID: <1488730216.7668.0.camel@corvax>
From: Andrew Makhorin
To: bug-glpk@gnu.org
Date: Sun, 05 Mar 2017 19:10:16 +0300
Content-Type: text/plain; charset="UTF-8"
X-Mailer: Evolution 3.4.4-3
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
Subject: [Bug-glpk] [Fwd: uncaught self reference in model's param line
crashes glpsol v4.55]
X-BeenThere: bug-glpk@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: "Bug reports for GLPK \(GNU Linear Programming Kit\)"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Sun, 05 Mar 2017 16:08:40 -0000
-------- Forwarded Message --------
From: mail386132@mailout.e4ward.com
To: bug-glpk@gnu.org
Cc: mail386132@mailout.e4ward.com
Subject: uncaught self reference in model's param line crashes glpsol
v4.55
Date: Sun, 05 Mar 2017 15:26:21 +0000
First off, I would like to thank you for sharing such a great tool with the rest of the world!
On to the bug report.
I have noticed that glpsol reproducibly crashes on a debian wheezy box
$ glpsol --version | head -1
GLPSOL: GLPK LP/MIP Solver, v4.55
if a model's param line contains a self reference.
While the following model is OK
param A_symbolic{1..2, 1..2}, default -1;
param A{i in 1..2, j in 1..2} :=
(if A_symbolic[i,j]=1 then 1.2 else
(if A_symbolic[i,j]=2 then 3.4 else
A_symbolic[i,j] ));
solve;
for {i in 1..2} { for {j in 1..2} {printf "%5.2f ",A[i,j];} printf "\n"; }
data;
# if A_symbolic[i,j] = 1 then A[i,j] is 1.2
# if A_symbolic[i,j] = 2 then A[i,j] is 3.4
# else A[i,j] is A_symbolic[i,j]
param A_symbolic: 1 2 :=
1 0 1
2 2 0 ;
end;
a self reference in the definition of the A parameter is not caught by
glpsol, which causes the program to crash with a segmentation violation error:
param A_symbolic{1..2, 1..2}, default -1;
param A{i in 1..2, j in 1..2} :=
(if A_symbolic[i,j]=1 then 1.2 else
(if A_symbolic[i,j]=2 then 3.4 else
A[i,j] ));
solve;
for {i in 1..2} { for {j in 1..2} {printf "%5.2f ",A[i,j];} printf "\n"; }
data;
# if A_symbolic[i,j] = 1 then A[i,j] is 1.2
# if A_symbolic[i,j] = 2 then A[i,j] is 3.4
# else A[i,j] is A_symbolic[i,j]
param A_symbolic: 1 2 :=
1 0 1
2 2 0 ;
end;
The only difference between the two models was:
$ diff glpsol_*mod
5c5
< A[i,j] ));
---
> A_symbolic[i,j] ));
Any ideas?