Re: ¿¿¿past chunk end???

From: imad <immaad(at)gmail(dot)com>
To: "luis garcia" <ldgarc(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: ¿¿¿past chunk end???
Date: 2006-11-01 19:18:09
Message-ID: 1f30b80c0611011118t158cf65obd3a58c7e73f6cec@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Carefully check all the palloc's you are doing in your code.
This warning is shown when you write some extra bytes to the memory
and size of your data goes beyond the allocated size.

--Imad
EnterpriseDB (www.enterprisedb.com)

On 11/1/06, luis garcia <ldgarc(at)gmail(dot)com> wrote:
>
> Hi We have been making some modifications to postgres catalog, but
> it seems to be a problem with one of the fields we just added, exactly
> in the time when inserting the right values to that specific field.
>
> 1. This is what It happens:
>
> **************************************
> template1=# CREATE TABLE test() AS VALID EVENT 2 WITH FREQUENCY
> '00:00:50.00' AS REAL TIME;
> WARNING: detected write past chunk end in CacheMemoryContext 0xb7212e0c
> CREATE TABLE
> **************************************
>
> The creation it's possible, in fact, We have added 7 fields to Postgres
> catalog (in pg_class) and there are no problems with the other fields
> values,
> just with this one.
>
>
> 2. The field is defined this way:
> // FILE: Parsenodes.h
> // STRUCTURE: frequencyDefinition
>
> typedef struct FrequencyDefinition
> {
> NodeTag type;
> bool timeFrequency;
> FrequencyType fttype;
> const char *frequencyMeasure; // THIS ONE
> } FrequencyDefinition;
>
>
> 3. The values are inserted this way:
> // FILE: relcache.c
> // FUNCTION: RelationBuildLocalRelation
>
> **************************************
> rel->rd_rel->relhasfrequency = freqDef->timeFrequency; // Perfect
> Asignation
>
> if((freqDef->fttype) == REAL_TIME)
>
> namestrcpy(&rel->rd_rel->relfrequencytype,(const char
> *)"REAL TIME");
> else
>
> namestrcpy(&rel->rd_rel->relfrequencytype,(const char
> *)"HISTORIC");
>
> namestrcpy(&rel->rd_rel->relfrequency,freqDef->frequencyMeasure)
> **************************************
>
>
> We can see the other values whit a SELECT over PG_CLASS:
>
> template1=# SELECT relname, relhasfrequency, relfrequencytype, relfrequency
> FROM pg_class WHERE relhasfrequency=true;
>
> relname | relhasfrequency | relfrequencytype | relfrequency
> - - - - - - + - - - - - - - - - - - - + - - - - - - - - - - - - - + - - -
> - - - - - -
> test | t | REAL TIME | 0
> (1 row)
>
> We have realized that in the assignation it takes just the first CHAR from
> '00:00:50.00',
> and we tested the same assignation but just like this:
>
> ***************************************
> namestrcpy(&rel->rd_rel->relfrequencytype,freqDef->frequencyMeasure);
> //namestrcpy(&rel->rd_rel->relfrequency,freqDef->frequencyMeasure)
> ***************************************
>
> And the result to the same query was:
>
> template1=# SELECT relname, relhasfrequency, relfrequencytype, relfrequency
> FROM pg_class WHERE relhasfrequency=true;
>
> relname | relhasfrequency | relfrequencytype | relfrequency
> - - - - - - + - - - - - - - - - - - - + - - - - - - - - - - - - - + - - -
> - - - - - -
> test | t | '00:00:50.00' | 0
> (1 row)
>
>
> So please, anybody could tell me how to fix this?
>
> Thanks...
> --
> Luis D. García M.
> Telf: 0414-3482018
>
> - FACYT - UC -
> - Computación -

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-11-01 19:59:00 Re: ¿¿¿pas
Previous Message Henry B. Hotz 2006-11-01 18:43:01 Re: Design Considerations for New Authentication Methods