From: Aurel Balmosan <ab@orga.com>
Subject: Re: SIGSEGV INSIDE malloc: HELP!!!
Date: 1999/04/12 [thread overview]
Message-ID: <3711B4C3.8B415D7D@orga.com> (raw)
In-Reply-To: 37029976.1CAB9443@ornl.gov
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.
prev parent reply other threads:[~1999-04-12 4:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-03-31 5:00 SIGSEGV INSIDE malloc: HELP!!! Phil LoCascio
1999-04-02 5:00 ` Craig Neth
1999-04-05 4:00 ` Phil LoCascio
1999-04-12 4:00 ` Aurel Balmosan [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox