From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,20bed0f2cc70afe1 X-Google-Attributes: gidfee84,public From: Aurel Balmosan Subject: Re: SIGSEGV INSIDE malloc: HELP!!! Date: 1999/04/12 Message-ID: <3711B4C3.8B415D7D@orga.com>#1/1 X-Deja-AN: 465404412 X-Nntp-Posting-Host: 194.122.136.143 Content-Transfer-Encoding: 7bit Sender: news@orga.com (News Administrator) References: <37029976.1CAB9443@ornl.gov> Content-Type: text/plain; charset=us-ascii Organization: ORGA Kartensysteme GmbH Mime-Version: 1.0 Newsgroups: comp.unix.osf.osf1 Phil LoCascio wrote: > Hi, > > using OSF1 machine.name V4.0 878 alpha , I keep getting segmentation > faults INSIDE the systems malloc!! > > Anyone seen this or know a solution? > > Cheers > > PHiL Well, thats the normal behaviour if you use more memory then you allocated using malloc/calloc/realloc. I.e. you allocated 10 bytes for a string with strlen(string)==10. If you then do a strcpy(malloced_area, string) it will need 11 bytes!!! 10 bytes for the string and 1 byte for the final 0-char. This is the easiest example. In any case the program might or might not crash depending on how often it uses malloc/calloc/realloc and free. What you will see is that you get SIGSEGV/SIGBUS in routines like __free or malloc... Happy bug hunting, Aurel Balmosan.