09-28-2006 07:21 AM
09-28-2006 08:12 AM
There is a thread here which may be useful to you.
JR
09-28-2006 12:23 PM
09-29-2006 09:25 AM
08-31-2011 12:21 PM
It's been 5 years. Apparently this was never resolved?
I also get get this error. I am using CVI 2010 which I have found rather buggy. I allocate memory for a structure using "calloc" and at the end of the function I free the memory with "free". Sometimes the "free' gives a fatal error saying dynamic memory is corrupt even though I can view the structure and its contents.
08-31-2011 03:25 PM
Mikie,
A bug report regarding this issue was never officially filed because it was never reproduced or identified. Does you have code that produces this error message that you can post here?
08-31-2011 03:46 PM
I found that if you write past the allocated size and then try to free the memory, you then get the fatal error.
09-01-2011 09:41 AM
Mikie,
You should never attempt to write past the end of an array when programming in C. In fact you should be getting a fatal run-time error when you attempt to write past the end of an array. This is a feature of CVI that blocks the user from performing such actions which ANSI C does not prevent. What does your code look like that does this? Here is the code I have and as you can see in the comments, I receive the error before I get to freeing the memory.
#include <ansi_c.h>
int main (int argc, char *argv[])
{
int *myArray;
myArray = malloc(2*sizeof(int));
*(myArray) = 1;
*(myArray+1) = 2;
*(myArray+2) = 3; //FATAL RUN_TIME ERROR: Dereference of out-of-bounds pointer
free (myArray);
return 0;
}