dedebugging and a functions that just don't work on debian flavour

From: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
To: pgsql-hackers(at)postgresql(dot)org
Subject: dedebugging and a functions that just don't work on debian flavour
Date: 2010-02-28 13:43:12
Message-ID: 20100228144312.00a7b066@dawn.webthatworks.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote a function that turns tsvectors into tsqueries.
I can't see any evident error and actually the function return the
expected results but just for a strange set of queries. Otherwise it
causes tsqueryout to exit with errors when the result is returned.

It seems that tsqueryout is running beyond what it should and most
likely it could be some dirty memory/allocation issue.
(ERROR: unrecognized operator type: or ERROR: stack depth limit
exceeded)

The queries that succede and the one that fail belong to a pretty
curious set:

SUCCEDE:
select tsvector_to_tsquery(ft1idx, '|', 'ABCD', 22::smallint)
from catalog_items limit 2; -- q1

select itemid, tsvector_to_tsquery(ft1idx, '|', 'ABCD', 22::smallint)
from catalog_items; -- q2

select tsvector_to_tsquery(ft1idx, '|', 'ABCD', 22::smallint)
from catalog_items where itemid=10 or itemid=15 or itemid=27; -- q3

select tsvector_to_tsquery(ft1idx, '|', 'ABCD', 22::smallint)
from catalog_items order by random() limit 3; -- q4

FAIL:
select tsvector_to_tsquery(ft1idx, '|', 'ABCD', 22::smallint)
from catalog_items limit 3; -- q5

If I compile my function with -O0 all queries succeed.

Then I created a table
create table tsvectors(i serial, tsv tsvector);
in the same DB of catalog_items and filled it with some data.
Length of tsvector is similar, just catalog_items contains more
fields and records.
All queries above succeeded.

I then compiled from scratch postgresql with default configure
options, loaded the whole DB containing catalog_items and no errors.

Then I looked into configure options used by debian, copied nearly
all with the exception of tcl stuff and rpath, compiled once more...
tested my function and no error.

I've no idea what to do next other than asking if someone can give a
look to the code and check my comprehension of what a tsquery should
be in memory.

http://www.webthatworks.it/d1/files/ts_utilities.tar.bz2

thanks

--
Ivan Sergio Borgonovo
http://www.webthatworks.it

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2010-02-28 13:54:48 Re: Re: Hot Standby query cancellation and Streaming Replication integration
Previous Message Boszormenyi Zoltan 2010-02-28 09:56:51 Re: Anyone know if Alvaro is OK?