Allocating memory of VL structures
I'm trying to get a program working that has a very large structure group. The structure is of the form:
Code:
typedef struct {
double x;
double y;
double z;
} Vect;
typedef struct {
Vect vector1;
Vect vector2;
Vect vector3;
//(6 doubles);
} Param1;
typedef struct {
//(3 doubles);
//(8 integers);
} Param2;
typedef struct {
Param2 param2[256];
double P3d[17];
int P3i[17];
int P3i1;
int P3i2;
} Param3;
typedef struct {
double val[10000];
} Vals;
typedef struct {
int P4i;
double P4d;
} Param4;
typedef struct {
//(3 integers);
//(6 doubles);
Param4 param4;
Vals val1;
Vals val2;
Vals val3;
} Param5;
typedef struct {
//(4 integers);
//(3 doubles);
Param4 param4;
Param5 param5[256];
} Param6;
typedef struct {
Param6 param6[64];
Param1 param1;
Param3 param3[64];
} Param7;
typedef struct {
Param7 param7[3];
} Structure;
Structure struct;
Whenever I build the program/subroutines (a combination of FORTRAN and C) everything claims it's fine. When I run it I immediately get a killed signal. When I strace:
$ strace ./prog
execve("/home/.../prog.run", ["/home/.../prog.run"], [/* 43 vars */]) = 0
+++ killed by SIGKILL +++
I'm pretty sure the problem is in allocating memory for my structure, but I can't figure out how to assign memory for this kind of structure system. Does anyone have any insight? Thanks.