Segmentation fault while structure variable declaration
I'm facing a segmentation fault(core) at the step where a structure variable is declared.
PFB the code snippet:
insert
Code:
struct LOCAL_UTILS_struct_
{
tbaAmtType bigLimitAmt;
longDescType longDesc;
tba800ErrorMsgType mlStr01;
};
typedef struct LOCAL_UTILS_struct_ LOCAL_UTILS_STRUCT_TYPE;
Function ()
{
LOCAL_UTILS_STRUCT_TYPE locUtils;
Above line is giving segmentation fault; but not always. When structure eliminated, and structure variables declared separately inside function, core didn’t occur.
Also, I declared a dummy string above this structure declaration of size 30000. Then the core didn’t occur.
Please suggest probable reason for this behaviour.
Latest info:
While analysis, it was found that the structure name LOCAL_UTILS_STRUCT_TYPE was also present in one of the header files. But that header file is not present in my current source. Can this be the probable reason?