Path: utzoo!utgpu!watserv1!watmath!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!rpi!crdgw1!uunet!icom!xwkg.Icom.Com!andy From: andy@xwkg.Icom.Com (Andrew H. Marrinson) Newsgroups: comp.sources.d Subject: Re: tgif core dumps all the time -- just mine? Keywords: tgif bugs Message-ID: Date: 15 Apr 91 20:58:53 GMT References: <150@mx-1> Sender: news@icom.icom.com (News Feed) Organization: Icom Systems, Inc. Lines: 39 No, it isn't just you. I had to make the following change to msg.c (in addition to a handful of other stuff for System V that you presumably found already): *** msg.c~ Thu Mar 21 15:46:00 1991 --- msg.c Thu Mar 21 16:57:32 1991 *************** *** 38,44 **** if (*Msg == '\0') { topMsgNumber = msgCount; return; } ! s = (char *) calloc (strlen (Msg), sizeof(char)); msg_ptr = (struct MsgRec *) calloc (1, sizeof(struct MsgRec)); strcpy (s, Msg); --- 38,44 ---- if (*Msg == '\0') { topMsgNumber = msgCount; return; } ! s = (char *) calloc (strlen (Msg) + 1, sizeof(char)); msg_ptr = (struct MsgRec *) calloc (1, sizeof(struct MsgRec)); strcpy (s, Msg); -------------- END OF PATCH ------------- It seems as though some mallocs always allocate a little bit more memory than you ask for. I found a virtually identical bug in the CMU SNMP client. The System V malloc is not so forgiving! I haven't sent this bug fix to the author of tgif yet. I suppose I ought to... Hope this helps... -- Andrew H. Marrinson Icom Systems, Inc. Wheeling, IL, USA (andy@icom.icom.com)