All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Hollis R Blanchard <hollis+@andrew.cmu.edu>
To: Peter Chang <weasel@cs.stanford.edu>
Cc: linuxppc-dev@lists.linuxppc.org
Subject: Re: dl-load.c (ld.so) bug??
Date: Tue, 22 Jun 1999 09:52:49 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.3.96L.990622094815.1625A-100000@unix47.andrew.cmu.edu> (raw)
In-Reply-To: <v04205405b394c1fe1645@[209.239.164.131]>


On Mon, 21 Jun 1999, Peter Chang wrote:
> 
> At 23:09 -0400 06.21.1999, Daniel Jacobowitz wrote:
> >On Mon, Jun 21, 1999 at 10:48:12PM -0400, Hollis R Blanchard wrote:
> > >
> > > I have two even simpler test cases for you:
> > >
> > > int main(void){
> > >     char *ptr=NULL;
> > >     free(ptr);
> > > }
> >
> >Well, that one would probably segfault anyway (or at least, is not
> >guaranteed not to).
> 
> Hmm... the docs taht I have say this:
> 

[snip]
>  If ptr is a null pointer, no action occurs.
[snip]

Right. In other words, that's legal and should not segfault.

> > > int main(void){
> > >     char *ptr = (char *)malloc(100);
> > > }
> >
> >That one's a problem, though :)
> 
> Why? Its allocating memory, but never freeing it. Its a leak, but not 
> accessing things out of bounds. I haven't used ElectricFence, but its 
> not going to catch a bounds error on this.

Try it. It segfaults. Add a free afterwords if you like. It still segfaults.
Add a printf in front of it, and that printf will never happen. The segfault
starts in __libc_start_main. It makes no sense, but anytime you put a malloc
or a free in a program, EFence makes it segfault (*before* running that malloc
or free).

-Hollis


[[ This message was sent via the linuxppc-dev mailing list.  Replies are ]]
[[ not  forced  back  to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting.   ]]

  reply	other threads:[~1999-06-22 13:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-21 22:52 dl-load.c (ld.so) bug?? Troy Benjegerdes
1999-06-22  0:04 ` Hollis R Blanchard
1999-06-22  1:57   ` Troy Benjegerdes
1999-06-22  2:48     ` Hollis R Blanchard
1999-06-22  3:09       ` Daniel Jacobowitz
1999-06-22  4:36         ` Peter Chang
1999-06-22 13:52           ` Hollis R Blanchard [this message]
     [not found] <Pine.LNX.3.96L.990622003119.5237E-100000@unix47.andrew.cmu.edu>
1999-06-22  4:39 ` Peter Chang
     [not found] <199906231258.HAA25989@www.cedarnet.org>
1999-06-23 13:17 ` Geert Uytterhoeven
1999-06-23 14:19 ` Hollis R Blanchard
1999-06-23 14:32   ` Kevin Puetz
     [not found] <Pine.LNX.4.04.9906211749280.27642-100000@narn.local.drgw.n et>
1999-06-23 14:37 ` Franz Sirl

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=Pine.LNX.3.96L.990622094815.1625A-100000@unix47.andrew.cmu.edu \
    --to=hollis+@andrew.cmu.edu \
    --cc=linuxppc-dev@lists.linuxppc.org \
    --cc=weasel@cs.stanford.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.