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  <[EMAIL PROTECTED]>
 http://home.zf.jcu.cz/~zakkr/
 
 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to