bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gsl] Invalid memory accesses in gsl-1.6/vector/test.c


From: Brian Gough
Subject: Re: [Bug-gsl] Invalid memory accesses in gsl-1.6/vector/test.c
Date: Thu, 7 Jul 2005 14:50:10 +0100

Julian Seward writes:
 > The impression I get is that there's some double-freeing going on
 > in this test, leading to a huge number of accesses to freed 
 > memory.  I tried to cut it down to the attached program, but 
 > there are so many layers of macros that I find it hard to make
 > sense of.

Thanks for the bug report, you're right -- I accidentally introduced
an error in the vector test program for gsl-1.6 (the library itself is
not affected).  See patch below if you are interested.

 > Is this a known problem?  Has anyone [apart from me] run the gsl-1.6
 > test suite though a memory debugging tool like Valgrind or Purify?

I usually test the releases with the bounds-checking version of gcc,
but it missed this one.  I will have to start checking with valgrind
as well ;-)

-- 
best regards,

Brian Gough

Network Theory Ltd,
Publishing Free Software Manuals --- http://www.network-theory.co.uk/

Index: test_complex_source.c
===================================================================
RCS file: /home/gsl-cvs/gsl/vector/test_complex_source.c,v
retrieving revision 1.23
diff -u -r1.23 test_complex_source.c
--- test_complex_source.c       24 Jun 2005 11:33:25 -0000      1.23
+++ test_complex_source.c       6 Jul 2005 11:18:33 -0000
@@ -75,7 +75,7 @@
   if (stride == 1)
     {
       v0 = FUNCTION (gsl_vector, alloc) (N);
-      view = FUNCTION (gsl_vector, subvector) (v, 0, N);
+      view = FUNCTION (gsl_vector, subvector) (v0, 0, N);
       v = &view.vector;
     }
   else
Index: test_source.c
===================================================================
RCS file: /home/gsl-cvs/gsl/vector/test_source.c,v
retrieving revision 1.26
diff -u -r1.26 test_source.c
--- test_source.c       24 Jun 2005 11:33:26 -0000      1.26
+++ test_source.c       6 Jul 2005 11:14:18 -0000
@@ -75,7 +75,7 @@
   if (stride == 1)
     {
       v0 = FUNCTION (gsl_vector, alloc) (N);
-      view = FUNCTION (gsl_vector, subvector) (v, 0, N);
+      view = FUNCTION (gsl_vector, subvector) (v0, 0, N);
       v = &view.vector;
     }
   else




reply via email to

[Prev in Thread] Current Thread [Next in Thread]