Обсуждение: Segmentation fault in 6.3.1 when using libpgtcl !!!

Поиск
Список
Период
Сортировка

Segmentation fault in 6.3.1 when using libpgtcl !!!

От
Constantin Teodorescu
Дата:
I upgraded today to PostgreSQL 6.3.1 and I understood that are some
libpgtcl improvments (Randy Kunkee).

But I have encountered a bug (probably located in libpgtcl) that crash
the client (PgAccess).

To reproduce the error only with tclsh (not with PgAccess) you have to
follow exactly the following steps :

1. Get the database demo for PgAccess from the last PgAccess
distribution (0.86) or directly from
http://www.flex.ro/pgaccess/formdemo.sql (shift-click the link)
2. Create a database called formdemo and fill it with objects from
formdemo.sql (psql -e formdemo <formdemo.sql)
3. launch tclsh
4. Enter the following commands into tclsh

% load libpgtcl.so
% set dbc [pg_connect formdemo]
% pg_select $dbc "select * from pga_forms" rcd { puts $rcd(formname) }

You will get a segmentation fault immediatly after printing the first
form name ("A simple demo form")

If the last command would be
% pg_select $dbc "select formname from pga_forms" rcd { puts
$rcd(formname) }

you will get the names of the two forms founded in table pga_forms ("A
simple demo form","Phone book") without any error.
===================================================================
The PostgreSQL record for the form "Phone book" is big enough (2824
bytes) but less than 8Kb (record limit).
I think that it's a bug in the latest libpgtcl library in pg_select
function !

Please, Randy could you check it?

--
Constantin Teodorescu
FLEX Consulting Braila, ROMANIA

Re: Segmentation fault in 6.3.1 when using libpgtcl !!!

От
Randy Kunkee
Дата:
> I upgraded today to PostgreSQL 6.3.1 and I understood that are some
> libpgtcl improvments (Randy Kunkee).
>
> But I have encountered a bug (probably located in libpgtcl) that crash
> the client (PgAccess).
>
> To reproduce the error only with tclsh (not with PgAccess) you have to
> follow exactly the following steps :
>
> 1. Get the database demo for PgAccess from the last PgAccess
> distribution (0.86) or directly from
> http://www.flex.ro/pgaccess/formdemo.sql (shift-click the link)
> 2. Create a database called formdemo and fill it with objects from
> formdemo.sql (psql -e formdemo <formdemo.sql)
> 3. launch tclsh
> 4. Enter the following commands into tclsh
>
> % load libpgtcl.so
> % set dbc [pg_connect formdemo]
> % pg_select $dbc "select * from pga_forms" rcd { puts $rcd(formname) }
>
> You will get a segmentation fault immediatly after printing the first
> form name ("A simple demo form")
>
> If the last command would be
> % pg_select $dbc "select formname from pga_forms" rcd { puts
> $rcd(formname) }
>
> you will get the names of the two forms founded in table pga_forms ("A
> simple demo form","Phone book") without any error.
> ===================================================================
> The PostgreSQL record for the form "Phone book" is big enough (2824
> bytes) but less than 8Kb (record limit).
> I think that it's a bug in the latest libpgtcl library in pg_select
> function !
>
> Please, Randy could you check it?
>
> --
> Constantin Teodorescu
> FLEX Consulting Braila, ROMANIA
>

I am downloading 6.3.1 right now.  Unfortunately I'm really under
a crunch right now and may not be able to get back with you for a week.
An initial look at this code tells me that it's one of the fewest
changed routines in there.  The only change is how the connection
handle is retrieved.  I'll try to build and test 6.3.1 on my machine
at home today.

Randy