BUG #4835: psql server crashes when using non-existing functions

From: "David Sommerseth" <dazo(at)users(dot)sourceforge(dot)net>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4835: psql server crashes when using non-existing functions
Date: 2009-06-03 09:10:20
Message-ID: 200906030910.n539AKDU078694@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 4835
Logged by: David Sommerseth
Email address: dazo(at)users(dot)sourceforge(dot)net
PostgreSQL version: 8.3.7
Operating system: Linux (Gentoo Hardened 2008 / x86 - 32bit)
Description: psql server crashes when using non-existing functions
Details:

(This might be a duplicate of a mail I tried to send directly to the mailing
list, sorry if it gets dupped. I didn't find my report in the archives.
This new entry, via the web form, got more information as well)

I discovered this issue when upgrading from 8.3.5 to 8.3.7

Client side:
$ psql
Password:
Welcome to psql 8.3.7, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

david=# select pg_test_function_which_do_not_exists();
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!>

From server log:
Jun 2 15:07:40 john postgres[31161]: [27-1] david/david [[local]][0] ERROR:
42883: function pg_test_function_which_do_not_exists() does not exist at
character 8
Jun 2 15:07:40 john postgres[31161]: [27-2] david/david [[local]][0] HINT:
No function matches the given name and argument types. You might need to add
explicit type
Jun 2 15:07:40 john postgres[31161]: [27-3] casts.
Jun 2 15:07:40 john postgres[31161]: [27-4] david/david [[local]][0]
LOCATION: ParseFuncOrColumn, parse_func.c:227
Jun 2 15:07:40 john postgres[31161]: [27-5] david/david [[local]][0]
STATEMENT: select pg_test_function_which_do_not_exists();
Jun 2 15:07:40 john postgres[30160]: [27-1] / [][0] LOG: 00000: server
process (PID 31161) was terminated by signal 11: Segmentation fault
Jun 2 15:07:40 john postgres[30160]: [27-2] / [][0] LOCATION: LogChildExit,
postmaster.c:2529
Jun 2 15:07:40 john postgres[30160]: [28-1] / [][0] LOG: 00000:
terminating any other active server processes
Jun 2 15:07:40 john postgres[30160]: [28-2] / [][0] LOCATION:
HandleChildCrash, postmaster.c:2374
Jun 2 15:07:40 john postgres[30160]: [29-1] / [][0] LOG: 00000: all server
processes terminated; reinitializing
Jun 2 15:07:40 john postgres[30160]: [29-2] / [][0] LOCATION:
PostmasterStateMachine, postmaster.c:2690
Jun 2 15:07:40 john postgres[31163]: [30-1] david/david [[local]][0] FATAL:
57P03: the database system is in recovery mode
Jun 2 15:07:40 john postgres[31162]: [30-1] / [][0] LOG: 00000: database
system was interrupted; last known up at 2009-06-02 15:04:57 CEST
Jun 2 15:07:40 john postgres[31162]: [30-2] / [][0] LOCATION: StartupXLOG,
xlog.c:4836
Jun 2 15:07:40 john postgres[31162]: [31-1] / [][0] LOG: 00000: database
system was not properly shut down; automatic recovery in progress
Jun 2 15:07:40 john postgres[31162]: [31-2] / [][0] LOCATION: StartupXLOG,
xlog.c:5003
Jun 2 15:07:40 john postgres[31163]: [30-2] david/david [[local]][0]
LOCATION: ProcessStartupPacket, postmaster.c:1648
Jun 2 15:07:40 john postgres[31162]: [32-1] / [][0] LOG: 00000: redo
starts at 1/7BA68F7C
Jun 2 15:07:40 john postgres[31162]: [32-2] / [][0] LOCATION: StartupXLOG,
xlog.c:5065
Jun 2 15:07:40 john postgres[31162]: [33-1] / [][0] LOG: 00000: record
with zero length at 1/7BA77B74
Jun 2 15:07:40 john postgres[31162]: [33-2] / [][0] LOCATION: ReadRecord,
xlog.c:3126
Jun 2 15:07:40 john postgres[31162]: [34-1] / [][0] LOG: 00000: redo done
at 1/7BA77B48
Jun 2 15:07:40 john postgres[31162]: [34-2] / [][0] LOCATION: StartupXLOG,
xlog.c:5135
Jun 2 15:07:40 john postgres[31162]: [35-1] / [][0] LOG: 00000: last
completed transaction was at log time 2009-06-02 15:07:16.986517+02
Jun 2 15:07:40 john postgres[31162]: [35-2] / [][0] LOCATION: StartupXLOG,
xlog.c:5139
Jun 2 15:07:40 john postgres[31166]: [30-1] / [][0] LOG: 00000: autovacuum
launcher started
Jun 2 15:07:40 john postgres[31166]: [30-2] / [][0] LOCATION:
AutoVacLauncherMain, autovacuum.c:520
Jun 2 15:07:40 john postgres[30160]: [30-1] / [][0] LOG: 00000: database
system is ready to accept connections
Jun 2 15:07:40 john postgres[30160]: [30-2] / [][0] LOCATION: reaper,
postmaster.c:2156

I degraded to 8.3.5 again, and this behaviour disappeared.

The behaviour is sometimes better when the non-existing function do not
start with 'pg_', as it seems to recover better. But not always.

This bug is produced reliably on a Gentoo installation (hardened/x86) on
i686 (32bit).

kind regards,

David Sommerseth

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Dave Page 2009-06-03 09:47:44 Re: New install Error : FATAL: could not create lock file "postmaster.pid"
Previous Message Václav Kyselý 2009-06-03 07:42:20 New install Error : FATAL: could not create lock file "postmaster.pid"