Re: Backend with closed connection at 99% CPU - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Backend with closed connection at 99% CPU
Date
Msg-id 23781.1095726976@sss.pgh.pa.us
Whole thread Raw
In response to Backend with closed connection at 99% CPU  (Guy Thornley <guy@esphion.com>)
List pgsql-bugs
Guy Thornley <guy@esphion.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

pgsql-bugs by date:

Previous
From: Guy Thornley
Date:
Subject: Backend with closed connection at 99% CPU
Next
From: Alvaro Herrera
Date:
Subject: Re: psql missing feature: show permissions for functions