Package: lp-solve
Version: 5.5.0.10-10
Severity: grave
Justification: renders package unusable

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);

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.


#include <stdio.h>
#include <stdlib.h>
#include "lp_lib.h"

int main(void)
{
  lprec *lp;

  /* Create a new LP model */
  lp = make_lp(0, 3);
  int i = 0;
  for (i = 0; i < 10000; ++i) {
    add_columnex(lp, 0, NULL, NULL);
  }
  
  REAL con[1+3];     /* must be 1 more than number of rows ! */


  con[0] = 1.0; /* the objective value */
  con[1] = 2.0;
  con[2] = 0.0;
  con[3] = 3.0;
  add_constraint(lp, con, LE, 5);
  
  write_LP(lp, stdout);
  delete_lp(lp);
  return(0);
}



-- System Information:
Debian Release: 5.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages lp-solve depends on:
ii  libc6                         2.7-18     GNU C Library: Shared libraries
ii  libsuitesparse-3.1.0          3.1.0-3    collection of libraries for comput

lp-solve recommends no packages.

lp-solve suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to