Re: [HACKERS] patch for memory overrun on Linux(i386) - Mailing list pgsql-hackers

From Marc Howard Zuckman
Subject Re: [HACKERS] patch for memory overrun on Linux(i386)
Date
Msg-id Pine.LNX.3.95.980321235655.16374A-100000@fallon.classyad.com
Whole thread Raw
In response to Re: [HACKERS] patch for memory overrun on Linux(i386)  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] patch for memory overrun on Linux(i386)
List 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@candle.pha.pa.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@fallon.classyad.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!                      _
_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_


pgsql-hackers by date:

Previous
From: Coronach
Date:
Subject: Re: [HACKERS] psql nested queries with 2000+ records
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] patch for memory overrun on Linux(i386)