I have a quite complicated code in that is working fine on AIX but core dumping in Solaris. I tried to make it as simplified as possible.

Below is a global structrue having a pointer to a function

```
 custom_struct_1 my_struct1 = {
      intValue1, intValue2, intValue3, func3
   };

```

This is a second structure having a pointer to the first one as a field

```
  custom_struct_2 my_struct2 = {
      intValue1, intValue2, &my_struct1
  };

```

below is the flow

```
func1(){

   custom_struct *my_dumping_struct;
   memset(my_struct, 0, sizeof(my_struct);

   func2(my_dumping_struct, &my_struct2);

 }

func2(custom_struct *my_dumping_struct, custom_struct_2 *my_struct2 ){

   custom_struct1 *my_cust1;
   // Some conditions go here 

   my_cust1 = &my_struct2->custom_struct_1;

   my_cust1->struct_func(my_dumping_struct);

}

func3(custom_struct *my_dumping_struct)
{
    // Here when trying to access any field of the passed structure
    // a core dump is occuring
    if(my_dumping_struct->intValue1 == 0)
    {
        ....
    }
}

```

I appreciate any help. It is driving me crazy. I tried multipile things like defining the dumping structure without a pointer at first, using 

```
  memset(&my_dumping_structre, 0, sizeof(my_dumping_struct))

```

and passing it with a reference to the other functions it still core dumps.

*EDIT*

Definition of the structures are as below:

```
 struct custom_struct {
            int intValue1;
            int intValue2;
         };

         struct custom_struct_1 {

            int intValue1;
            int intValue2;
            int intValue3;
            int (*struct_func)(custom_struct *my_struct);
         };

         struct custom_struct_2 {
            int intValue1;
            int intValue2;
            struct custom_struct_1 *my_struct;
         };

```

Thanks