Re: Second call for platform testing

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mark Knox <segfault(at)hardline(dot)org>
Cc: PostgreSQL Hackers Mailing List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Second call for platform testing
Date: 2001-12-03 19:01:30
Message-ID: 18188.1007406090@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Mark Knox <segfault(at)hardline(dot)org> writes:
>> Had a look at 7.2b3 and sadly it's failing several tests. I saw several
>> "ERROR: PGSTAT: Creation of DB hash table failed" which I haven't seen before.

That error is coming from the following ugly coding:

*dbhash = hash_create("Databases hash", PGSTAT_DB_HASH_SIZE, &hash_ctl,
HASH_ELEM | HASH_FUNCTION | mcxt_flags);
if (pgStatDBHash == NULL)
/* raise error */

AFAICT dbhash always points at the static variable pgStatDBHash, so the
code is not quite incorrect, though it's certainly trouble waiting to
happen as soon as someone changes things so that dbhash might point
elsewhere. What I'm wondering is if your compiler is missing the
potential for aliasing and is emitting code that loads pgStatDBHash
before the store through dbhash occurs. Does it help if you change
the second line (line 2094 in src/backend/postmaster/pgstat.c) to:

if (*dbhash == NULL)

I'm going to commit this change in CVS anyway, but I'm wondering if it
explains your problem or not.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephan Szabo 2001-12-03 19:16:14 Re: An easy question about creating a primary key
Previous Message Bruce Momjian 2001-12-03 18:45:16 Re: [HACKERS] JDBC improvements