Re: experimental pg_qcache patch

Поиск
Список
Период
Сортировка
Искать
От
Karel Zak
Тема
Re: experimental pg_qcache patch
Дата
Msg-id
20020414223932.A13461@zf.jcu.cz
Ответ на
Список
Дерево обсуждения
experimental pg_qcache patch Neil Conway <nconway@klamath.dyndns.org>
Re: experimental pg_qcache patch Bruce Momjian <pgman@candle.pha.pa.us>
Re: experimental pg_qcache patch Karel Zak <zakkr@zf.jcu.cz>
Re: experimental pg_qcache patch Karel Zak <zakkr@zf.jcu.cz>
Re: experimental pg_qcache patch Neil Conway <nconway@klamath.dyndns.org>
Re: experimental pg_qcache patch Jean-Paul ARGUDO <jean-paul.argudo@idealx.com>
Re: experimental pg_qcache patch Bruce Momjian <pgman@candle.pha.pa.us>
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 seethis 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  http://home.zf.jcu.cz/~zakkr/C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz

В списке pgsql-hackers по дате отправления
От: Rod Taylor
Дата:
Сообщение: Re: command.c breakup
От: John Gray
Дата:
Сообщение: Re: command.c breakup
FAQ