SIZE = 2*1024*1024*1024;
struct
{
char array[SIZE];
} s1;
char *seq;
File *sp;
int i = 0;
EoFReached = 0;
memset(array,0,SIZE*sizeof(char));
while(EoFReached == 0) {
getseq(sp, seq, EoFReached);
memcpy(&(s1->array[i]),seq, seqlen);
i = i + seqlen;
}
After i value of 630511104 memcpy overwrites some values with some wrong values in the beginning of the array itself but at same time ending values are correct.
So tired to allocate memory dynamically instead of static allocation, using malloc.
But got segmentation falut after 630511104 with error message in gdb as
__memcpy_ssse3 () at ..sysdeps/x86_64/multiarch/memcpy-ssse3.S:" ../sysdeps/x86_64/multiarch/memcpy-ssse3.S: No such file or directory.