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

Re: 8.3.5: Crash in CountActiveBackends() - lockless race?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Marko Kreen <markokr(at)gmail(dot)com>, Postgres Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 8.3.5: Crash in CountActiveBackends() - lockless race?
Date: 2009-03-30 14:18:29
Message-ID: 3072.1238422709@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
> Marko Kreen wrote:
>> Without reset in ProcArrayRemove we may use some ancient pointer that
>> may point to garbage?  I don't think it's good coding style to allow
>> that to happen.  

> Well, that can happen anyway. CountActiveBackends() could fetch the 
> pointer and determine that it's not NULL, just before ProcArrayRemove 
> clears it.

Dead PGPROC entries are just put into a list for reuse, so the pointer
would still point at storage that looked like a PGPROC.  I concur with
Heikki's theory that the observed crash must have been from fetching a
pointer that was never yet not NULL.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Robert HaasDate: 2009-03-30 14:22:34
Subject: Re: PQinitSSL broken in some use casesf
Previous:From: Bruce MomjianDate: 2009-03-30 14:16:43
Subject: Re: PQinitSSL broken in some use casesf

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