12-11-2019 02:05 AM
hello all,
sometimes i get this error :
and i don't know how to solve it !!
and my program doesn't work when i switch to debug run ,
i even try to make a small project (just for getting the same error to know what's the responsible of this)
but i can't do it ,
can someone help me to solve this error ,
or how i can make a little program to get this error.
12-11-2019 02:30 AM
In C memory allocation is left entirely as an exercise to the reader... Well, the standard library (ansi_c.h in CVI) provides malloc/calloc/realloc/free, but there are many other libraries (open source or not) that provides _other_ functions with the same names that work in different ways (usually to track allocations or debug memory issues) or with similar names.
In your case it could simply be trying to use realloc on a block of memory not allocated by malloc/calloc/realloc. For instance a static array or an array on the stack. How is you block defined ?
12-11-2019 03:22 AM
my bloc is define like that :
Ptr->ptrC[i]->ptrA[j]->Left->ptrset->value
Ptr, ptrC[i] , ptrA[j] , Left and ptrset are struct
and value is long
but i dont use realloc in my program
12-11-2019 05:07 AM
I don't see any definitions in the lines you pasted. Are you using external libraries/dll that maybe use realloc ?
12-11-2019 05:27 AM
This popup panel is from CVI? In my case it looks very different...
12-12-2019 02:03 AM
sorry for being late ,
the definition like is : ( Ptr have type tM)
Ptr->ptrC[i]->ptrA[j]->Left->ptrset->value
--------------
typedef struct t_M
{
int iI,
iM;
int iThreadID;
int iCodeDefaut;
char sCodeDefaut[512];
int iTestTime;
char strOrdreFab[100];
char strCodeProduit[100];
char strIndiceProduit[100];
struct t_Ca *ptrC[2]; //High & Low
struct t_Metro *ptrMet[12]; //Nombre des points
}tM;
struct t_Ca
{
int value;
struct t_Adj *ptrA[3]; //3 phase
};
struct t_Metro
{
struct t_Acc *ptrAccuracy[3]; //3 phase
};
struct t_Acc
{
struct t_Error *Left;
struct t_Error *Right;
};
struct t_Adj
{
struct t_Param *Left;
struct t_Param *Right;
};
struct t_Param {
struct t_Ca* ptrset;
struct t_Ca* ptrget;
};
struct t_Error {
double dErr1;
double dErr2;
double dErr3;
double dErr4;
};
/**/
for example how can i get the same error in a small project ?
another question if you dont mind where you read ( you know ) all this about the standard library (ansi_c.h in CVI)?
and about malloc and calloc ?
thanks
12-12-2019 02:21 AM
sorry for being late,
yes this popup panel is from CVI and i use CVI 2012
12-12-2019 09:19 AM
Whoa, that is some indirection nightmare, gives me a headache trying to follow the pointers ! And I agree that this doesn't look like a CVI popup, unless the OS was strangely themed.