[Circle] [CIRCLE] [CODE] eliza probs on SunOS

From: JEREMY IRISH (JIRISH@inetpop.is.ge.com)
Date: 11/13/96


Howdy,

I'm having a cross-platform nightmare and I need your help. I was able to sucessfully compile 
(and run with no problems) the eliza code (from ftp.circlemud.org) on a Linux box and  also a 
box running BSD, but when I try to port the code to a bare bones SunOs 4.1.3 machine I run into 
the following error in my syslog:

realloc error in addreply in call 1
realloc error in addreply in call 2
realloc error in addreply in call 3
realloc error in addreply in call 4
..etc..

...and the chat.data isn't placed into memory.


I was able to track the problem down to akey.C below


	if((t = (reply *)realloc(replys, numreplys * sizeof(reply))) == NULL)
	{
#ifdef CHECKMEM
		printf("realloc error in addreply in call %d\n",called);
#endif
		return 0;
	}


Now, I have an idea that since dmalloc.h apparently isn't in my C library that I may have a 
problem, but I can see several malloc and realloc references in boards.c db.c etc... so should I 
have another include, or is there another problem here? There shouldn't be any memory problems 
since the mud is the only process running on the machine. 

BTW, the Sun Machine is very very bare bones (I just compiled a gcc compiler on it last week).



Help!

Jeremy

irish@mail.tibex.com


---------------------------- The whole snippet of code follows: -----------------------------

int akey::addreply( int w, char *r )
{
	reply *t;
#ifdef CHECKMEM
	static int called = 0;

	called++;
#endif
	numreplys++;

	if((t = (reply *)realloc(replys, numreplys * sizeof(reply))) == NULL)
	{
#ifdef CHECKMEM
		printf("realloc error in addreply in call %d\n",called);
#endif
		return 0;
	}

	replys = t;
	totalwates += w;
	replys[numreplys-1].wate = w;

	if((replys[numreplys-1].sent = strdup( r )) == NULL)
	{
#ifdef CHECKMEM
      puts("out of mem for strdup in addreply");
#endif
      return 0;
	}
#ifdef DEBUG
	printf("reply added:%s",replys[numreplys].sent);
#endif
	return 1;
}

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST