Re: experimental pg_qcache patch

From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: Neil Conway <nconway(at)klamath(dot)dyndns(dot)org>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: experimental pg_qcache patch
Date: 2002-04-14 20:39:32
Message-ID: 20020414223932.A13461@zf.jcu.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Apr 14, 2002 at 10:13:17PM +0200, Karel Zak wrote:

> > (2) Sometimes executing a PREPARE gives this warning:
> >
> > nconway=> prepare q1 as select * from pg_class;
> > WARNING: AllocSetFree: detected write past chunk end in TransactionCommandContext 0x83087ac
> > PREPARE
> >
> > Does anyone know what problem this indicates?
>
> The memory managment is diffrent between 7.0 and 7.2. There is
> needful port cache shared-memory managment. I will look at it.

Hmm, I probably found it be first look to patch file.

The WARNING message is from leak detection. I'm sure that you see
this message if you use SHARE cache type.

- PREPARE_KEY_PREFIX_SIZE is 4 not 3

- in the PrepareKey() is needful fix:

+ if (store == PREPARE_STORE_SHARE) { /* shared between same DB */
+ *flag |= QCF_SHARE_NOTREMOVEABLE;
+ key = (char *) palloc(strlen(name) + PREPARE_KEY_PREFIX_SIZE
+ + strlen(DatabaseName) +1);
^^^^^^^
must be 3

+ sprintf(key, "%s_%s_", DatabaseName, PREPARE_KEY_PREFIX);
^^^^^^
the space for '_' is not allocated :-(

It's my bug probably, I good knew why we need leak detection :-)

Karel

PS. Sorry that I don't send a patch, but now I haven't my computer there.
--
Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
http://home.zf.jcu.cz/~zakkr/

C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Gray 2002-04-14 20:43:09 Re: command.c breakup
Previous Message Rod Taylor 2002-04-14 20:30:23 Re: command.c breakup