glpk problems on cygwin
Tatsuro MATSUOKA
tmacchant at yahoo.co.jp
Mon Aug 18 20:45:34 CDT 2008
Hello Jaroslav Hajek
Thanks!!
I have just patched the source files using your changeset and no buiding octave on cygwin.
I will report the results later.
Rergards
Tatsuro
--- Jaroslav Hajek <highegg at gmail.com> wrote:
> Hello,
>
> I think I may have located the problem. Certain matrix sizes seem to
> be assumed in the __glpk__ DLD function but one is passed incorrectly
> due to a typo in glpk.m.
> Attached is a fix. I've also added proper size checks to __glpk__.cc
> Tatsuro, Jiri, can you verify this indeed fixes the problem?
>
> regards,
>
>
>
> --
> RNDr. Jaroslav Hajek
> computing expert
> Aeronautical Research and Test Institute (VZLU)
> Prague, Czech Republic
> url: www.highegg.matfyz.cz
> > # HG changeset patch
> # User Jaroslav Hajek <highegg at gmail.com>
> # Date 1219067310 -7200
> # Node ID 13f64ee5c1e94ccdd26d4e0689a6889b28df1f86
> # Parent 2fd4a5ef6b593a531f248d25341e7e25d4d979e3
> fix invalid memory read in glpk
>
> diff --git a/scripts/ChangeLog b/scripts/ChangeLog
> --- a/scripts/ChangeLog
> +++ b/scripts/ChangeLog
> @@ -1,3 +1,7 @@
> +2008-08-18 Jaroslav Hajek <highegg at gmail.com>
> +
> + * optimization/glpk.m: Fix invalid call to zeros.
> +
> 2008-08-08 John W. Eaton <jwe at octave.org>
>
> * general/Makefile.in (SOURCES): Add cellidx.m to the list.
> diff --git a/scripts/optimization/glpk.m b/scripts/optimization/glpk.m
> --- a/scripts/optimization/glpk.m
> +++ b/scripts/optimization/glpk.m
> @@ -470,7 +470,7 @@
>
> if (nargin > 3)
> if (isempty (lb))
> - lb = zeros (0, nx, 1);
> + lb = zeros (nx, 1);
> elseif (! isreal (lb) || all (size (lb) > 1) || length (lb) != nx)
> error ("LB must be a real valued %d by 1 column vector", nx);
> return;
> diff --git a/src/ChangeLog b/src/ChangeLog
> --- a/src/ChangeLog
> +++ b/src/ChangeLog
> @@ -1,3 +1,8 @@
> +2008-08-18 Jaroslav Hajek <highegg at gmail.com>
> +
> + * DLD-FUNCTIONS/__glpk__.cc (F__glpk__): Checks whether LB and UB are
> + of proper size.
> +
> 2008-08-12 John W. Eaton <jwe at octave.org>
>
> * pt-fcn-handle.cc (tree_anon_fcn_handle::rvalue):
> diff --git a/src/DLD-FUNCTIONS/__glpk__.cc b/src/DLD-FUNCTIONS/__glpk__.cc
> --- a/src/DLD-FUNCTIONS/__glpk__.cc
> +++ b/src/DLD-FUNCTIONS/__glpk__.cc
> @@ -575,7 +575,7 @@
> //-- bound on each of the variables.
> Matrix LB (args(3).matrix_value ());
>
> - if (error_state)
> + if (error_state || LB.length () < mrowsc)
> {
> error ("__glpk__: invalid value of lb");
> return retval;
> @@ -600,7 +600,7 @@
> //-- bound on each of the variables.
> Matrix UB (args(4).matrix_value ());
>
> - if (error_state)
> + if (error_state || UB.length () < mrowsc)
> {
> error ("__glpk__: invalid value of ub");
> return retval;
>
--------------------------------------
For All Sports Lovers! SPORTS OHEN PROJECT 2008
http://pr.mail.yahoo.co.jp/yells/
More information about the Bug-octave
mailing list