[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pbmserv-dev] Q: about running programs



-> Hi, I have a question that is way out in left field, I am wondering if anyone
-> has an answer.  I am running a version of backgammon from the server, the
-> only difference is I added an extra "ReadWriteIntList" to the game file.
-> The problem is that my program crashes right when it needs to write the
-> Name() of the new list.  The only bizzare solution I can come up with is
-> that I ran out of variables space in my program.  Is that possible?  Can
-> I have *too many* variables in my program that my operating system can't 
-> handle all of them? 
-> 
-> 

Yes, it depends how it is allocated. If it is alloced on the local heap there is a maximum but if it 
allocated with malloc or global that should not be the case.

eg.

int someFunction()
{
  int myInt[10000];
}

may create problem but not

int someFunction()
{
  int *myInt;

  myInt=(int *)malloc(sizeof(int)*10000);
	
  ...


  free(myInt);
}


But how does it crash ? Have you tried running a debugger or a library like "efence" ?

/Martin