I cherry-picked the fixes from 5.5.2.5-2ubuntu1 (old Oracular) and
uploaded it into the Noble queue.

** Changed in: lp-solve (Ubuntu Noble)
       Status: New => In Progress

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to lp-solve in Ubuntu.
https://bugs.launchpad.net/bugs/2084527

Title:
  [SRU] lp-solve: does not respect compiler flags

Status in lp-solve package in Ubuntu:
  Fix Released
Status in lp-solve source package in Noble:
  In Progress

Bug description:
  [ Impact ]
  In order to help developers with profiling, Ubuntu enabled frame-pointers for 
packages in the main archive.

  https://ubuntu.com/blog/ubuntu-performance-engineering-with-frame-
  pointers-by-default

  lp-solve was missed due to the packaging issues. These have been fixed
  on Oracular and can now be ported to Noble.

  For lp-solve the main impact may not be the missing frame pointers -
  but the missing hardening flags.

  [ Test Plan ]

  Look at the DW_AT_producer in the associated debug ELF file for flags.
  -fno-omit-frame-pointer should be present after the fix.

  The following scripts can be used as a reference
  https://gist.github.com/julian-klode/85e55553f85c410a1b856a93dce77208
  https://gist.github.com/julian-klode/95818246eaef0ac6a54588f7f368e25c

  The hardening flags are passed in the same parameter.

  For regression potential, lp-solve is in pretty bad shape (custom
  build scripts, no autopkgtest,  no build-time tests) and only went
  through a very light MIR process (LP: #305790). But it ships a demo
  application that runs through most of its feature set and we will use
  that as a smoke test on functionality.

  I've built & run the demo of lp-solve 5.5.2.5-2build4 on Noble and we
  expect a very similar result after the SRU:

  # apt install lp-solve liblpsolve55-dev
  # gcc -o demo.out /usr/share/doc/lp-solve/examples/demo.c 
/usr/lib/lp_solve/liblpsolve55.so -I /usr/include/lpsolve/
  # LD_LIBRARY_PATH=/usr/lib/lp_solve/ ./demo.out
  lp_solve 5.5.2.5 demo

  This demo will show most of the features of lp_solve 5.5.2.5
  [return]

  We start by creating a new problem with 4 variables and 0 constraints
  We use: lp=make_lp(0,4);
  [return]
  We can show the current problem with print_lp(lp)
  Model name: 
                  C1       C2       C3       C4 
  Minimize         0        0        0        0 
  Type          Real     Real     Real     Real 
  upbo           Inf      Inf      Inf      Inf 
  lowbo            0        0        0        0 
  [return]
  Now we add some constraints
  add_constraint(lp, {0, 3, 2, 2, 1}, LE, 4)
  Model name: 
                  C1       C2       C3       C4 
  Minimize         0        0        0        0 
  R1               3        2        2        1 <=        4
  Type          Real     Real     Real     Real 
  upbo           Inf      Inf      Inf      Inf 
  lowbo            0        0        0        0 
  [return]
  add_constraintex is now used to add a row. Only the npn-zero values must be 
specfied with this call.
  add_constraintex(lp, 3, {4, 3, 1}, {2, 3, 4}, GE, 3)
  Model name: 
                  C1       C2       C3       C4 
  Minimize         0        0        0        0 
  R1               3        2        2        1 <=        4
  R2               0        4        3        1 >=        3
  Type          Real     Real     Real     Real 
  upbo           Inf      Inf      Inf      Inf 
  lowbo            0        0        0        0 
  [return]
  Set the objective function
  set_obj_fn(lp, {0, 2, 3, -2, 3})
  Model name: 
                  C1       C2       C3       C4 
  Minimize         2        3       -2        3 
  R1               3        2        2        1 <=        4
  R2               0        4        3        1 >=        3
  Type          Real     Real     Real     Real 
  upbo           Inf      Inf      Inf      Inf 
  lowbo            0        0        0        0 
  [return]
  Now solve the problem with printf(solve(lp));

  Model name:  '' - run #1    
  Objective:   Minimize(R0)
   
  SUBMITTED
  Model size:        2 constraints,       4 variables,            7 non-zeros.
  Sets:                                   0 GUB,                  0 SOS.
   
  Using DUAL simplex for phase 1 and PRIMAL simplex for phase 2.
  The primal and dual simplex pricing strategy set to 'Devex'.
   
  Found feasibility by dual simplex after             1 iter.
   
  Optimal solution                  -4 after          2 iter.

  Relative numeric accuracy ||*|| = 0

   MEMO: lp_solve version 5.5.2.5 for 64 bit OS, with 64 bit REAL variables.
        In the total iteration count 2, 0 (0.0%) were bound flips.
        There were 2 refactorizations, 0 triggered by time and 0 by density.
         ... on average 1.0 major pivots per refactorization.
        The largest [LUSOL v2.2.1.0] fact(B) had 5 NZ entries, 1.0x largest 
basis.
        The constraint matrix inf-norm is 4, with a dynamic range of 4.
        Time to load data was 8.496 seconds, presolve used 0.000 seconds,
         ... 0.000 seconds in simplex solver, in total 8.496 seconds.
  0[return]
  The value is 0, this means we found an optimal solution
  We can display this solution with print_objective(lp) and print_solution(lp)

  Value of objective function: -4.00000000

  Actual values of the variables:
  C1                              0
  C2                              0
  C3                              2
  C4                              0

  Actual values of the constraints:
  R1                              4
  R2                              6
  [return]
  The dual variables of the solution are printed with
  print_duals(lp);

  Objective function limits:
                                   From            Till       FromValue
  C1                                 -3           1e+30       0.6666667
  C2                                 -2           1e+30               2
  C3                             -1e+30               0          -1e+30
  C4                                 -1           1e+30               4

  Dual values with from - till limits:
                             Dual value            From            Till
  R1                                 -1               2           1e+30
  R2                                  0          -1e+30           1e+30
  C1                                  5          -1e+30       0.6666667
  C2                                  5              -3               2
  C3                                  0          -1e+30           1e+30
  C4                                  4          -1e+30               4
  [return]
  We can change a single element in the matrix with
  set_mat(lp,2,1,0.5)
  Model name: 
                  C1       C2       C3       C4 
  Minimize         2        3       -2        3 
  R1               3        2        2        1 <=        4
  R2             0.5        4        3        1 >=        3
  Type          Real     Real     Real     Real 
  upbo           Inf      Inf      Inf      Inf 
  lowbo            0        0        0        0 
  [return]
  If we want to maximize the objective function use set_maxim(lp);
  Model name: 
                  C1       C2       C3       C4 
  Maximize         2        3       -2        3 
  R1               3        2        2        1 <=        4
  R2             0.5        4        3        1 >=        3
  Type          Real     Real     Real     Real 
  upbo           Inf      Inf      Inf      Inf 
  lowbo            0        0        0        0 
  [return]
  after solving this gives us:
  Using DUAL simplex for phase 1 and PRIMAL simplex for phase 2.
  The primal and dual simplex pricing strategy set to 'Devex'.
   
   
  Optimal solution                  12 after          1 iter.

  Relative numeric accuracy ||*|| = 0

   MEMO: lp_solve version 5.5.2.5 for 64 bit OS, with 64 bit REAL variables.
        In the total iteration count 1, 0 (0.0%) were bound flips.
        There were 1 refactorizations, 0 triggered by time and 0 by density.
         ... on average 1.0 major pivots per refactorization.
        The largest [LUSOL v2.2.1.0] fact(B) had 5 NZ entries, 1.0x largest 
basis.
        The constraint matrix inf-norm is 4, with a dynamic range of 4.
        Time to load data was 12.696 seconds, presolve used 0.000 seconds,
         ... 0.000 seconds in simplex solver, in total 12.696 seconds.

  Value of objective function: 12.00000000

  Actual values of the variables:
  C1                              0
  C2                              0
  C3                              0
  C4                              4

  Actual values of the constraints:
  R1                              4
  R2                              4

  Objective function limits:
                                   From            Till       FromValue
  C1                             -1e+30               9             0.4
  C2                             -1e+30               6               2
  C3                             -1e+30               6               2
  C4                                1.5           1e+30          -1e+30

  Dual values with from - till limits:
                             Dual value            From            Till
  R1                                  3               3           1e+30
  R2                                  0          -1e+30           1e+30
  C1                                 -7          -1e+30             0.4
  C2                                 -3            -0.5               2
  C3                                 -8              -1               2
  C4                                  0          -1e+30           1e+30
  [return]
  Change the value of a rhs element with set_rh(lp,1,7.45)
  Model name: 
                  C1       C2       C3       C4 
  Maximize         2        3       -2        3 
  R1               3        2        2        1 <=     7.45
  R2             0.5        4        3        1 >=        3
  Type          Real     Real     Real     Real 
  upbo           Inf      Inf      Inf      Inf 
  lowbo            0        0        0        0 
  Using DUAL simplex for phase 1 and PRIMAL simplex for phase 2.
  The primal and dual simplex pricing strategy set to 'Devex'.
   
   
  Optimal solution               22.35 after          0 iter.

  Relative numeric accuracy ||*|| = 0

   MEMO: lp_solve version 5.5.2.5 for 64 bit OS, with 64 bit REAL variables.
        In the total iteration count 0, 0 (100.0%) were bound flips.
        There were 1 refactorizations, 0 triggered by time and 0 by density.
         ... on average 0.0 major pivots per refactorization.
        The largest [LUSOL v2.2.1.0] fact(B) had 5 NZ entries, 1.0x largest 
basis.
        The constraint matrix inf-norm is 4, with a dynamic range of 4.
        Time to load data was 13.184 seconds, presolve used 0.000 seconds,
         ... 0.000 seconds in simplex solver, in total 13.184 seconds.

  Value of objective function: 22.35000000

  Actual values of the variables:
  C1                              0
  C2                              0
  C3                              0
  C4                           7.45

  Actual values of the constraints:
  R1                           7.45
  R2                           7.45
  [return]
  We change C4 to the integer type with
  set_int(lp, 4, TRUE)
  Model name: 
                  C1       C2       C3       C4 
  Maximize         2        3       -2        3 
  R1               3        2        2        1 <=     7.45
  R2             0.5        4        3        1 >=        3
  Type          Real     Real     Real      Int 
  upbo           Inf      Inf      Inf      Inf 
  lowbo            0        0        0        0 
  We set branch & bound debugging on with set_debug(lp, TRUE)
  and solve...
  [return]
  Using DUAL simplex for phase 1 and PRIMAL simplex for phase 2.
  The primal and dual simplex pricing strategy set to 'Devex'.
   

  Relaxed solution               22.35 after          0 iter is B&B base.
   
  Feasible solution             21.675 after          1 iter,         2 nodes 
(gap 2.9%)
   
  Optimal solution              21.675 after          1 iter,         2 nodes 
(gap 2.9%).

  Relative numeric accuracy ||*|| = 0

   MEMO: lp_solve version 5.5.2.5 for 64 bit OS, with 64 bit REAL variables.
        In the total iteration count 1, 0 (0.0%) were bound flips.
        There were 2 refactorizations, 0 triggered by time and 0 by density.
         ... on average 0.5 major pivots per refactorization.
        The largest [LUSOL v2.2.1.0] fact(B) had 5 NZ entries, 1.0x largest 
basis.
        The maximum B&B level was 2, 1.0x MIP order, 2 at the optimal solution.
        The constraint matrix inf-norm is 4, with a dynamic range of 4.
        Time to load data was 13.920 seconds, presolve used 0.000 seconds,
         ... 0.000 seconds in simplex solver, in total 13.920 seconds.

  Value of objective function: 21.67500000

  Actual values of the variables:
  C1                              0
  C2                          0.225
  C3                              0
  C4                              7

  Actual values of the constraints:
  R1                           7.45
  R2                            7.9
  [return]
  We can set bounds on the variables with
  set_lowbo(lp,2,2); & set_upbo(lp,4,5.3)
  Model name: 
                  C1       C2       C3       C4 
  Maximize         2        3       -2        3 
  R1               3        2        2        1 <=     7.45
  R2             0.5        4        3        1 >=        3
  Type          Real     Real     Real      Int 
  upbo           Inf      Inf      Inf      5.3 
  lowbo            0        2        0        0 
  [return]
  Using DUAL simplex for phase 1 and PRIMAL simplex for phase 2.
  The primal and dual simplex pricing strategy set to 'Devex'.
   

  Relaxed solution               16.35 after          1 iter is B&B base.
   
  Feasible solution             15.675 after          2 iter,         2 nodes 
(gap 3.9%)
   
  Optimal solution              15.675 after          2 iter,         2 nodes 
(gap 3.9%).

  Relative numeric accuracy ||*|| = 0

   MEMO: lp_solve version 5.5.2.5 for 64 bit OS, with 64 bit REAL variables.
        In the total iteration count 2, 0 (0.0%) were bound flips.
        There were 2 refactorizations, 0 triggered by time and 0 by density.
         ... on average 1.0 major pivots per refactorization.
        The largest [LUSOL v2.2.1.0] fact(B) had 5 NZ entries, 1.0x largest 
basis.
        The maximum B&B level was 2, 1.0x MIP order, 2 at the optimal solution.
        The constraint matrix inf-norm is 4, with a dynamic range of 4.
        Time to load data was 15.048 seconds, presolve used 0.000 seconds,
         ... 0.000 seconds in simplex solver, in total 15.048 seconds.

  Value of objective function: 15.67500000

  Actual values of the variables:
  C1                              0
  C2                          2.225
  C3                              0
  C4                              3

  Actual values of the constraints:
  R1                           7.45
  R2                           11.9
  [return]
  Now remove a constraint with del_constraint(lp, 1)
  Model name: 
                  C1       C2       C3       C4 
  Maximize         2        3       -2        3 
  R1             0.5        4        3        1 >=        3
  Type          Real     Real     Real      Int 
  upbo           Inf      Inf      Inf      5.3 
  lowbo            0        2        0        0 
  Add an equality constraint
  Model name: 
                  C1       C2       C3       C4 
  Maximize         2        3       -2        3 
  R1             0.5        4        3        1 >=        3
  R2               1        2        1        4  =        8
  Type          Real     Real     Real      Int 
  upbo           Inf      Inf      Inf      5.3 
  lowbo            0        2        0        0 
  [return]
  A column can be added with:
  add_column(lp,{3, 2, 2});
  Model name: 
                  C1       C2       C3       C4       C5 
  Maximize         2        3       -2        3        3 
  R1             0.5        4        3        1        2 >=        3
  R2               1        2        1        4        2  =        8
  Type          Real     Real     Real      Int     Real 
  upbo           Inf      Inf      Inf      5.3      Inf 
  lowbo            0        2        0        0        0 
  [return]
  A column can be removed with:
  del_column(lp,3);
  Model name: 
                  C1       C2       C3       C4 
  Maximize         2        3        3        3 
  R1             0.5        4        1        2 >=        3
  R2               1        2        4        2  =        8
  Type          Real     Real      Int     Real 
  upbo           Inf      Inf      5.3      Inf 
  lowbo            0        2        0        0 
  [return]
  We can use automatic scaling with:
  set_scaling(lp, SCALE_MEAN);
  Model name: 
                  C1       C2       C3       C4 
  Maximize         2        3        3        3 
  R1             0.5        4        1        2 >=        3
  R2               1        2        4        2  =        8
  Type          Real     Real      Int     Real 
  upbo           Inf      Inf      5.3      Inf 
  lowbo            0        2        0        0 
  [return]
  The function get_mat(lprec *lp, int row, int column) returns a single
  matrix element
  printf("%f %f\n", get_mat(lp,2,3), get_mat(lp,1,1); gives
  4.000000 0.500000
  Notice that get_mat returns the value of the original unscaled problem
  [return]
  If there are any integer type variables, then only the rows are scaled
  set_scaling(lp, SCALE_MEAN);
  set_int(lp,3,FALSE);
  Model name: 
                  C1       C2       C3       C4 
  Maximize         2        3        3        3 
  R1             0.5        4        1        2 >=        3
  R2               1        2        4        2  =        8
  Type          Real     Real     Real     Real 
  upbo           Inf      Inf      5.3      Inf 
  lowbo            0        2        0        0 
  [return]
  Using DUAL simplex for phase 1 and PRIMAL simplex for phase 2.
  The primal and dual simplex pricing strategy set to 'Devex'.
   
  Found feasibility by dual simplex after             1 iter.
   
  Optimal solution                  14 after          3 iter.

  Relative numeric accuracy ||*|| = 0

   MEMO: lp_solve version 5.5.2.5 for 64 bit OS, with 64 bit REAL variables.
        In the total iteration count 3, 0 (0.0%) were bound flips.
        There were 3 refactorizations, 0 triggered by time and 0 by density.
         ... on average 1.0 major pivots per refactorization.
        The largest [LUSOL v2.2.1.0] fact(B) had 5 NZ entries, 1.0x largest 
basis.
        The constraint matrix inf-norm is 4, with a dynamic range of 4.
        Time to load data was 17.936 seconds, presolve used 0.000 seconds,
         ... 0.000 seconds in simplex solver, in total 17.936 seconds.
  print_objective, print_solution gives the solution to the original problem

  Value of objective function: 14.00000000

  Actual values of the variables:
  C1                              4
  C2                              2
  C3                              0
  C4                              0

  Actual values of the constraints:
  R1                             10
  R2                              8
  [return]
  Scaling is turned off with unscale(lp);
  Model name: 
                  C1       C2       C3       C4 
  Maximize         2        3        3        3 
  R1             0.5        4        1        2 >=        3
  R2               1        2        4        2  =        8
  Type          Real     Real     Real     Real 
  upbo           Inf      Inf      5.3      Inf 
  lowbo            0        2        0        0 
  [return]
  Now turn B&B debugging off and simplex tracing on with
  set_debug(lp, FALSE), set_trace(lp, TRUE) and solve(lp)
  [return]
  Using DUAL simplex for phase 1 and PRIMAL simplex for phase 2.
  The primal and dual simplex pricing strategy set to 'Devex'.
   
  Start at primal feasible basis
  rowdual: Infeasibility sum                  0 in       0 constraints.
   
  Optimal solution                  14 after          0 iter.

  Relative numeric accuracy ||*|| = 0

   MEMO: lp_solve version 5.5.2.5 for 64 bit OS, with 64 bit REAL variables.
        In the total iteration count 0, 0 (100.0%) were bound flips.
        There were 1 refactorizations, 0 triggered by time and 0 by density.
         ... on average 0.0 major pivots per refactorization.
        The largest [LUSOL v2.2.1.0] fact(B) had 5 NZ entries, 1.0x largest 
basis.
        The constraint matrix inf-norm is 4, with a dynamic range of 4.
        Time to load data was 18.856 seconds, presolve used 0.000 seconds,
         ... 0.000 seconds in simplex solver, in total 18.856 seconds.
  Where possible, lp_solve will start at the last found basis
  We can reset the problem to the initial basis with
  default_basis(lp). Now solve it again...
  [return]
  Using DUAL simplex for phase 1 and PRIMAL simplex for phase 2.
  The primal and dual simplex pricing strategy set to 'Devex'.
   
  Start at infeasible basis
  rowdual: Infeasibility sum              -17.2 in       1 constraints.
  coldual: Entering column 5, reduced cost -3, pivot value 4, bound swaps 0
  I:    1 - MAJOR -     2 leaves to LOWER,      5 enters from UPPER with 
THETA=4.3 and OBJ=9
  performiteration: Variable 5 entered basis at iter 1 at                  1
  performiteration: Feasibility gap at iter 1 is                  0
  rowdual: Infeasibility sum                  0 in       0 constraints.
  Found feasibility by dual simplex after             1 iter.
  I:    2 - MAJOR -     5 leaves to LOWER,      4 enters from LOWER with 
THETA=2 and OBJ=12
  performiteration: Variable 4 entered basis at iter 2 at                  2
  performiteration: Current objective function value at iter 2 is               
  12
  I:    3 - MAJOR -     4 leaves to LOWER,      3 enters from LOWER with 
THETA=4 and OBJ=14
  performiteration: Variable 3 entered basis at iter 3 at                  4
  performiteration: Current objective function value at iter 3 is               
  14
  primloop: Objective at iter          3 is                 14 (   2:    4 <-   
 3)
  rowdual: Infeasibility sum                  0 in       0 constraints.
   
  Optimal solution                  14 after          3 iter.

  Relative numeric accuracy ||*|| = 0

   MEMO: lp_solve version 5.5.2.5 for 64 bit OS, with 64 bit REAL variables.
        In the total iteration count 3, 0 (0.0%) were bound flips.
        There were 3 refactorizations, 0 triggered by time and 0 by density.
         ... on average 1.0 major pivots per refactorization.
        The largest [LUSOL v2.2.1.0] fact(B) had 5 NZ entries, 1.0x largest 
basis.
        The constraint matrix inf-norm is 4, with a dynamic range of 4.
        Time to load data was 19.240 seconds, presolve used 0.000 seconds,
         ... 0.000 seconds in simplex solver, in total 19.240 seconds.
  It is possible to give variables and constraints names
  set_row_name(lp,1,"speed"); & set_col_name(lp,2,"money")
  Model name: 
                  C1    money       C3       C4 
  Maximize         2        3        3        3 
  speed          0.5        4        1        2 >=        3
  R2               1        2        4        2  =        8
  Type          Real     Real     Real     Real 
  upbo           Inf      Inf      5.3      Inf 
  lowbo            0        2        0        0 
  As you can see, all column and rows are assigned default names
  If a column or constraint is deleted, the names shift place also:
  [return]
  del_column(lp,1);
  Model name: 
               money       C2       C3 
  Maximize         3        3        3 
  speed            4        1        2 >=        3
  R2               2        4        2  =        8
  Type          Real     Real     Real 
  upbo           Inf      5.3      Inf 
  lowbo            2        0        0 
  [return]
  An lp structure can be created and read from a .lp file
  lp = read_lp("lp.lp", TRUE);
  The verbose option is used
  [return]
  lp is now:
  Model name: test
               money       C2       C3 
  Maximize         3        3        3 
  speed            4        1        2 >=        3
  R2               2        4        2  =        8
  Type          Real     Real     Real 
  upbo           Inf      5.3      Inf 
  lowbo            2        0        0 
  [return]
  solution:

  Value of objective function: 12.00000000

  Actual values of the variables:
  money                           2
  C2                              0
  C3                              2

  Actual values of the constraints:
  speed                          12
  R2                              8

  [ Where problems could occur ]

  The custom build scripts (lp_solve/ccc & lp_solve55/ccc) have been
  modified to pass CFLAGS along. Some of them are potentially
  duplicated, and there is the possibility of "wanted regressions" where
  some of the hardening flags that are now passed to those modules would
  expose/prevent some security issue (e.g. abort instead of overflowing
  a buffer).

  We do not expect any functional regressions.

  [ Other Info ]

  changes in dpkg have been made to make sure frame-pointers are not
  enabled on s390x and ppc64el.

  Bug reference with similar SRU -
  https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/2073128

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lp-solve/+bug/2084527/+subscriptions


-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to