Skip site navigation (1) Skip section navigation (2)

Re: BUG #5669: server process was terminated by exception 0xC0000005

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Geery <andrew(dot)geery(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #5669: server process was terminated by exception 0xC0000005
Date: 2010-09-22 16:39:24
Message-ID: 27203.1285173564@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Andrew Geery <andrew(dot)geery(at)gmail(dot)com> writes:
> The schema below crashes pretty reliably for me.

OK ... so the problem is that the function uses the pg_settings view,
which results in calling show_all_settings(), and in particular it
runs show_session_authorization(), which then dumps core because
session_authorization_string is NULL in an autovacuum process.

As far as a fix for the crash goes, I'm not sure if it'd be better to
try to make show_session_authorization() return some sort of default
value in this scenario, or to try to ensure that the variable has been
set to something valid before we start running user-supplied code.
In either case the problem is potentially wider than this one function
and variable.  Thoughts anyone?

As far as the function itself goes, ISTM you ought to rethink it,
because this looks like the very opposite of immutable to me:

> create or replace function get_fts_config_name() returns regconfig as $$
>    select setting::regconfig from pg_settings
>       where name = 'default_text_search_config';
> $$ language sql immutable;

That's no excuse for the backend crashing, of course, but I would not
be surprised at all if you end up with corrupt indexes due to the
allegedly-immutable value changing.

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Alvaro HerreraDate: 2010-09-22 16:56:04
Subject: Re: BUG #5669: server process was terminated by exception 0xC0000005
Previous:From: Andrew GeeryDate: 2010-09-22 16:23:03
Subject: Re: BUG #5669: server process was terminated by exception 0xC0000005

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group