Hi Xypron,
> the following code leads to a segmentation error in glpk-4.31:
> set S;
> param p {s in S} symbolic;
> set P;
> table plants IN 'iODBC' 'DSN=glpk;UID=glpk;PWD=gnu'
> p['PLANTS'] :
> S <- [LOC1];
> solve;
> data;
> param p :=
> [PLANTS] 'SELECT PLANT, CAPA AS CAPACITY FROM transp_capa';
> end;
> 11 lines were read
> Reading plants...
> error.mod:5: no value for S
> Model processing error
> Segmentation fault (core dumped)
> set S;
> param p {s in S} symbolic;
> set P;
> display p['PLANTS'];
> solve;
> data;
> param p :=
> [PLANTS] 'SELECT PLANT, CAPA AS CAPACITY FROM transp_capa';
> end;
> gives
> 10 lines were read
> Display statement at line 4
> error.mod:4: no value for S
> Model processing error
> I would have expected successful error treatment for the table
> statement, too.
Thank you. I could reproduce the bug.
It appears in the following fragment:
if (dca->arg != NULL)
{ for (k = 1; k <= dca->na; k++)
xfree(dca->arg[k]);
xfree(dca->arg);
}
(in the internal routine free_dca (glpmpl03.c), which is called
from mpl_terminate in case of error), because some dca->arg[k] is
not initialized (contains 0x3f3f3f3f written by xmalloc/xcalloc).
I need a time to fix the bug.
Andrew Makhorin
_______________________________________________
Bug-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-glpk