Re: Backend with closed connection at 99% CPU

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Guy Thornley <guy(at)esphion(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Backend with closed connection at 99% CPU
Date: 2004-09-21 00:36:16
Message-ID: 23781.1095726976@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Guy Thornley <guy(at)esphion(dot)com> writes:
> Postgres 7.4.1. (Yes I know, we _should_ upgrade).

Yup.

> As the subject says, it is spinning at 99% CPU. ...
> This backend has recently lost its client connection, ...
> You can even have a backtrace, how about that:

> (gdb) bt
> #0 0x0811cf40 in enlargeStringInfo ()
> #1 0x081249b8 in pq_getmessage ()
> #2 0x0817bdfe in HandleFunctionRequest ()
> #3 0x0817bfda in HandleFunctionRequest ()
> #4 0x0817eacc in PostgresMain ()

I'm betting this is this bug:

2004-05-11 16:07 tgl

* src/backend/lib/stringinfo.c (REL7_4_STABLE): Add tests to
enlargeStringInfo() to avoid possible buffer-overrun or
infinite-loop problems if a bogus data length is passed.

Somehow the dying client injected a few bogus bytes into the
communication channel, and managed to trigger the infinite-loop
variant of this bug.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2004-09-21 01:11:06 Re: psql missing feature: show permissions for functions
Previous Message Guy Thornley 2004-09-20 23:13:58 Backend with closed connection at 99% CPU