Re: [HACKERS] patch for memory overrun on Linux(i386)

From: Marc Howard Zuckman <marc(at)fallon(dot)classyad(dot)com>
To: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
Cc: The Hermit Hacker <scrappy(at)hub(dot)org>, mgittens(at)david(dot)gits(dot)nl, hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] patch for memory overrun on Linux(i386)
Date: 1998-03-22 04:57:51
Message-ID: Pine.LNX.3.95.980321235655.16374A-100000@fallon.classyad.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 21 Mar 1998, Bruce Momjian wrote:

> >
> >
> > Some things just require confirmation...can someone else (Thomas?) running
> > Linux comment on this before I apply it? I just find it kinda unexpected
> > to see something that doesn't work for SCO doesn't work for Linux too :)
>
> On BSDI, malloc man pages says:
>
> The allocated space is suitably aligned (after possible pointer coercion)
> for storage of any type of object.
>
> I don't believe this is a standard, and I think Linux may not follow it.
> I think I heard somewhere they don't. We certainly need to have this
> checked before use in a patch.
>
>
> --
> Bruce Momjian | 830 Blythe Avenue
> maillist(at)candle(dot)pha(dot)pa(dot)us | Drexel Hill, Pennsylvania 19026
> + If your life is a hard drive, | (610) 353-9879(w)
> + Christ can be your backup. | (610) 853-3000(h)
>

>From the linux man page:
For calloc() and malloc(), the value returned is a pointer
to the allocated memory, which is suitably aligned for any
kind of variable, or NULL if the request fails.

realloc() returns a pointer to the newly allocated memory,
which is suitably aligned for any kind of variable and may
be different from ptr, or NULL if the request fails or if
size was equal to 0. If realloc() fails the original
block is left untouched - it is not freed or moved.

Marc Zuckman
marc(at)fallon(dot)classyad(dot)com

_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
_ Visit The Home and Condo MarketPlace _
_ http://www.ClassyAd.com _
_ _
_ FREE basic property listings/advertisements and searches. _
_ _
_ Try our premium, yet inexpensive services for a real _
_ selling or buying edge! _
_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-03-22 05:16:51 Re: [QUESTIONS] How do I build libpgtcl?
Previous Message Coronach 1998-03-22 04:21:39 Re: [HACKERS] psql nested queries with 2000+ records