Re: Autovacuum worker does not set stack_base_ptr

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, "Johann 'Myrkraverk' Oskarsson" <johann(at)2ndquadrant(dot)com>
Subject: Re: Autovacuum worker does not set stack_base_ptr
Date: 2012-04-03 02:57:19
Message-ID: CA+TgmoYq5vmsnE+cW4HtOaex1M3m6eOrucbyogbsW868EegzNA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Apr 1, 2012 at 12:31 PM, Heikki Linnakangas
<heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
> Currently, only regular backends set the stack base pointer, for the
> check_stack_depth() mechanism, in PostgresMain. We don't have stack overrun
> protection in auxiliary processes. However, autovacuum workers at least can
> run arbitrary user code, and if that overruns the stack, you get a segfault.

The *Main functions for the various auxiliary processes seem to have a
bad case of cut-and-paste-itis. Consolidating some of that logic
would help to avoid bugs of this type.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-04-03 04:06:56 Re: measuring lwlock-related latency spikes
Previous Message Robert Haas 2012-04-02 23:20:02 Re: new group commit behavior not helping?