Backing up a little - Trying to get LAPACK to work...
Jerry Feldman
gaf at blu.org
Wed May 26 07:34:20 EDT 2010
On 05/25/2010 10:07 PM, Bruce Labitt wrote:
> OK, I thought it seemed like stack corruption, too.
>
> I know I didn't check the results of malloc directly - however, I made
> it a point to write to the arrays to initialize them to a known value.
> If I had a bad malloc, wouldn't the program have died during that
> initialization? It was one of those arrays whose pointer got hosed.
>
> Purify & Insure++ are looking pretty good right now...
One thing I noticed in your code before, not sure if you did anything
about it.
void foo(doublecomplex *, int p1, int p2)
doublecomplex a[9][9]; // this allocates a 9x9 array of doublecomplex
foo(a, 9, 9); // In this case, the address of array a is placed onto
// the stack (or placed into a parameter register).
In the code that I read before there was one point where the parameters
were passed differently. .
One trick to test the underlying routines is to use mmap(2) to allocate
each array. mmap(2) allocates memory on page boundaries. If each array
is in its own page, then chances of corruption are reduced. Of course
you will be allocating a page per array which is wasteful, but it is one
way to see if the called routines are working, and if they might be the
corruptors.
--
Jerry Feldman <gaf at blu.org>
Boston Linux and Unix
PGP key id: 537C5846
PGP Key fingerprint: 3D1B 8377 A3C0 A5F2 ECBB CA3B 4607 4319 537C 5846
More information about the gnhlug-discuss
mailing list