[GRASS-dev] [GRASS GIS] #2168: Memory error in G_matrix_inverse

#2168: Memory error in G_matrix_inverse
-----------------------+----------------------------------------------------
Reporter: stopkovae | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: | Platform: Linux
      Cpu: x86-64 |
-----------------------+----------------------------------------------------
Hi,

I would like to ask for error correction in ''G_matrix_inverse()''
function. It makes "''free(): invalid next size (fast)''" error.

I suggest replacing of

''perm = (integer *) G_malloc(wmat->rows);''[[BR]]
with[[BR]]
''perm = (integer *) G_malloc(wmat->rows * sizeof(int));''

in ''grass/trunk/lib/gmath/la.c'' (line 486).

Thank you in advance.

Eva

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2168&gt;
GRASS GIS <http://grass.osgeo.org>

#2168: Memory error in G_matrix_inverse
-----------------------+----------------------------------------------------
Reporter: stopkovae | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: | Platform: Linux
      Cpu: x86-64 |
-----------------------+----------------------------------------------------

Comment(by huhabla):

Hi Eva,
thank yout for the bug report. It should be fixed in r58748. Please test
the changes.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2168#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#2168: Memory error in G_matrix_inverse
-----------------------+----------------------------------------------------
Reporter: stopkovae | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: | Platform: Linux
      Cpu: x86-64 |
-----------------------+----------------------------------------------------

Comment(by StopkovaE):

Hi Soeren,

thank you for fixing, it works fine.

Eva

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2168#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#2168: Memory error in G_matrix_inverse
------------------------+---------------------------------------------------
  Reporter: stopkovae | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Resolution: fixed | Keywords:
  Platform: Linux | Cpu: x86-64
------------------------+---------------------------------------------------
Changes (by martinl):

  * status: new => closed
  * resolution: => fixed

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2168#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>