public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Josh Gagliardi <gagliardi@mediaone.net>
To: help-gcc@gnu.org
Subject: Re: Segmentation Fault: new char[12]
Date: Fri, 31 Dec 1999 22:24:00 -0000	[thread overview]
Message-ID: <384EA7F1.4E7920CC@mediaone.net> (raw)
Message-ID: <19991231222400.t21eprdU2W0Ig4hxhUrlERCgNvT5V-JvGd3jM6ojY4E@z> (raw)
In-Reply-To: <82m7qn$pji$2@null.agames.com>

>         I don't think the "memory leak" is your biggest problem. The
> visible result of a memory leak is that malloc() returns 0 after some
> amount of time, but your code checks for that. Getting a _SEGFAULT_
> from malloc() (or free(), or whatever) is almost always caused by
> your application corrupting the malloc "headers" that are often
> stored adjacent to the allocated memory. You need to be looking for
> array-bounds violations, not memory-leaks.

Freeing something twice can also do bad things to the free list and
cause a later malloc or free to SEGFAULT.

  reply	other threads:[~1999-12-31 22:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-07 12:11 atharaken
1999-12-07 18:21 ` hwidjaja
1999-12-08  6:51   ` atharaken
1999-12-08 14:22     ` hwidjaja
1999-12-31 22:24       ` hwidjaja
1999-12-31 22:24     ` atharaken
1999-12-08  7:21   ` atharaken
1999-12-08 10:35     ` Mike Albaugh
1999-12-08 10:54       ` Josh Gagliardi [this message]
1999-12-31 22:24         ` Josh Gagliardi
1999-12-31 22:24       ` Mike Albaugh
1999-12-31 22:24     ` atharaken
1999-12-31 22:24   ` hwidjaja
1999-12-31 22:24 ` atharaken

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=384EA7F1.4E7920CC@mediaone.net \
    --to=gagliardi@mediaone.net \
    --cc=help-gcc@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).