>I am using IRIX Release 6.5 UNIX/SGI.  I write code in C++ and compile
>it using g++.  I then run it in debug mode using gdb.
>
>For some reason, the following call
>unsigned long dwRows=236;
>float   **fppBuffer=NULL;
>fppBuffer=(float **)malloc(dwRows*sizeof(float *));
>
>results in the following error message.
>
>Program received signal SIGSEGV, Segmentation fault.
>0xfa2efcc in realfree () at malloc.c:316
>malloc.c:316: No such file or directory.
>Current language:  auto; currently c
>
>dwRows*sizeof(float *) has the value 944.
>
>Does anyone know what's causing this problem?  Any help would be greatly
>appreciated.

On IRIX/MIPS/SGI this essentially always due to some
*earlier* operation corrupting the malloc arena.
For example, some earlier 
        x=malloc(strlen(s));
        strcpy(x,s);
could (should, but depending on the length
of s might not :-) corrupt a malloc arena pointer (internal to
the malloc control data).

The program may not die till *much* later in an unrelated operation
that calls malloc or free or realloc.

Using a malloc-checking package like ElectricFence
(or some other) would be a good idea at this point.

Normal Programming Error in your app is the best guess, in other words.

Regards,
David B. Anderson [EMAIL PROTECTED] [EMAIL PROTECTED] http://reality.sgi.com/davea/

Reply via email to