Hi Fonso, Thanks for the bug report. I just noticed this bug while taking a look through the output of rc-alert, so I thought I'd look a little more closely at this one.
On Tue, 24 Mar 2009 19:27:27 +0100 Fonso wrote:
> Severity: grave
> Justification: renders package unusable
I don't think the above severity is justified. See below.
> The lp-solve documentation states: "For add_columnex, column and rowno
> can both be NULL. In that case an empty column is added." This means the
> following call should be valid:
>
> add_columnex(lp, 0, NULL, NULL);
According to my reading of the manual, that's correct yes.
> lp-solve accepts that call and seemingly does add a column to the model.
> However, when later adding constraints it crashes with a segfault. As
> this is the only way to add columns to a model after building it, it is
> a very serious bug. The behaviour can be reproduced with the following
> example code. Remove the add_columnex line and it works fine. Keep it
> and watch the crash on add_constraint.
A key thing to notice in your example program is that you are trying to
add 10000 columns to your LP model. That's an impressively large number
of columns for a linear problem.
I ran this same example program with that number reduced to 1000 and the
bug is eliminated. [Additionally, I noticed your example program is
failing to check for errors from add_columnex, but when I added this I
didn't notice any errors being returned.]
I also ran the sample programs from the documentation showing
add_columnex and they also work fine.
So it does look like there is a bug in lp-solve here, but it appears to
only affect users attempting to add well over 1000 columns to their
model. That sounds like a severity of at most "important" to me which is
defined as:
important
a bug which has a major effect on the usability of a package,
without rendering it completely unusable to everyone.
-Carl
signature.asc
Description: This is a digitally signed message part

