Re: Preventing stack-overflow crashes (improving on

From: Matthew Kirkwood <matthew(at)hairy(dot)beasts(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Gaetano Mendola <mendola(at)bigfoot(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Preventing stack-overflow crashes (improving on
Date: 2003-12-31 17:49:49
Message-ID: Pine.LNX.4.58.0312311749190.13563@sphinx.mythic-beasts.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 31 Dec 2003, Tom Lane wrote:

> > Is ABS enough on a 64-bit architecture ?
>
> That was pseudocode, I wasn't actually planning to rely on a function.
> Something more like
>
> long diff;

FWIW, ISO has a ptrdiff_t, which may be useful here.

Matthew.

> diff = stack_base_ptr - &stack_top_loc;
> if (diff < 0)
> diff = -diff;
> if (diff > max)
> elog ...
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 2003-12-31 18:36:22 Re: cache in plpgsql
Previous Message markw 2003-12-31 17:31:44 using stp for dbt2 + postgresql