Discussion:
Tsearch1 problem
(too old to reply)
Rajesh Kumar Mallah
2004-02-24 12:29:22 UTC
Permalink
Greetings,

The function txt2txtidx of tsearch1 crashes the backend
in my installation when it is called with a text where '-' is
immediately followed by a number.

Does any one has any solution for it?

Regds
Mallah.



tradein_clients=# SELECT version();
+-----------------------------------------------------------+
| version |
+-----------------------------------------------------------+
| PostgreSQL 7.3 on i686-pc-linux-gnu, compiled by GCC 2.96 |
+-----------------------------------------------------------+
(1 row)

Time: 0.61 ms
tradein_clients=# SELECT txt2txtidx('Hello');
+------------+
| txt2txtidx |
+------------+
| 'hello' |
+------------+
(1 row)

Time: 0.72 ms
tradein_clients=# SELECT txt2txtidx('Hello A');
+------------+
| txt2txtidx |
+------------+
| 'hello' |
+------------+
(1 row)

Time: 0.72 ms
tradein_clients=# SELECT txt2txtidx('Hello A-');
+------------+
| txt2txtidx |
+------------+
| 'hello' |
+------------+
(1 row)

Time: 0.64 ms
tradein_clients=# SELECT txt2txtidx('Hello A-A');
+---------------+
| txt2txtidx |
+---------------+
| 'a-a' 'hello' |
+---------------+
(1 row)

Time: 0.92 ms
tradein_clients=# SELECT txt2txtidx('Hello A-1');
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!#
Oleg Bartunov
2004-02-24 13:41:12 UTC
Permalink
Post by Rajesh Kumar Mallah
Greetings,
The function txt2txtidx of tsearch1 crashes the backend
in my installation when it is called with a text where '-' is
immediately followed by a number.
example, please. Cut'n paste from psql console would be fine.
Also, what's version of postgresql ?
Post by Rajesh Kumar Mallah
Does any one has any solution for it?
Regds
Mallah.
tradein_clients=# SELECT version();
+-----------------------------------------------------------+
| version |
+-----------------------------------------------------------+
| PostgreSQL 7.3 on i686-pc-linux-gnu, compiled by GCC 2.96 |
+-----------------------------------------------------------+
(1 row)
Time: 0.61 ms
tradein_clients=# SELECT txt2txtidx('Hello');
+------------+
| txt2txtidx |
+------------+
| 'hello' |
+------------+
(1 row)
Time: 0.72 ms
tradein_clients=# SELECT txt2txtidx('Hello A');
+------------+
| txt2txtidx |
+------------+
| 'hello' |
+------------+
(1 row)
Time: 0.72 ms
tradein_clients=# SELECT txt2txtidx('Hello A-');
+------------+
| txt2txtidx |
+------------+
| 'hello' |
+------------+
(1 row)
Time: 0.64 ms
tradein_clients=# SELECT txt2txtidx('Hello A-A');
+---------------+
| txt2txtidx |
+---------------+
| 'a-a' 'hello' |
+---------------+
(1 row)
Time: 0.92 ms
tradein_clients=# SELECT txt2txtidx('Hello A-1');
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!#
Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: ***@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
Sam Barnett-Cormack
2004-02-24 14:08:53 UTC
Permalink
Post by Oleg Bartunov
Post by Rajesh Kumar Mallah
Greetings,
The function txt2txtidx of tsearch1 crashes the backend
in my installation when it is called with a text where '-' is
immediately followed by a number.
example, please. Cut'n paste from psql console would be fine.
Also, what's version of postgresql ?
That would be what's below.
Post by Oleg Bartunov
Post by Rajesh Kumar Mallah
Does any one has any solution for it?
Regds
Mallah.
tradein_clients=# SELECT version();
+-----------------------------------------------------------+
| version |
+-----------------------------------------------------------+
| PostgreSQL 7.3 on i686-pc-linux-gnu, compiled by GCC 2.96 |
+-----------------------------------------------------------+
(1 row)
Time: 0.61 ms
tradein_clients=# SELECT txt2txtidx('Hello');
+------------+
| txt2txtidx |
+------------+
| 'hello' |
+------------+
(1 row)
Time: 0.72 ms
tradein_clients=# SELECT txt2txtidx('Hello A');
+------------+
| txt2txtidx |
+------------+
| 'hello' |
+------------+
(1 row)
Time: 0.72 ms
tradein_clients=# SELECT txt2txtidx('Hello A-');
+------------+
| txt2txtidx |
+------------+
| 'hello' |
+------------+
(1 row)
Time: 0.64 ms
tradein_clients=# SELECT txt2txtidx('Hello A-A');
+---------------+
| txt2txtidx |
+---------------+
| 'a-a' 'hello' |
+---------------+
(1 row)
Time: 0.92 ms
tradein_clients=# SELECT txt2txtidx('Hello A-1');
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!#
Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
phone: +007(095)939-16-83, +007(095)939-23-83
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
--
Sam Barnett-Cormack
Software Developer | Student of Physics & Maths
UK Mirror Service (http://www.mirror.ac.uk) | Lancaster University

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match
Oleg Bartunov
2004-02-24 14:25:34 UTC
Permalink
Post by Sam Barnett-Cormack
Post by Oleg Bartunov
Post by Rajesh Kumar Mallah
Greetings,
The function txt2txtidx of tsearch1 crashes the backend
in my installation when it is called with a text where '-' is
immediately followed by a number.
example, please. Cut'n paste from psql console would be fine.
Also, what's version of postgresql ?
That would be what's below.
Ah, sorry :) Just tested on 7.4 and it works fine (as expected).

qq=# select version();
version
------------------------------------------------------------------------
PostgreSQL 7.4.1 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.2
(1 row)
qq=# SELECT txt2txtidx('Hello A-1');
txt2txtidx
-------------------
'1' 'a-1' 'hello'

Also, I run test on 7.3.3

qq=# select version();
version
---------------------------------------------------------------
PostgreSQL 7.3.3 on i686-pc-linux-gnu, compiled by GCC 2.95.3
(1 row)

qq=# SELECT txt2txtidx('Hello A-1');
txt2txtidx
-------------------
'1' 'a-1' 'hello'
(1 row)

Everything is ok.

I see your version of postgresql is outdated (you may upgrade at least
to 7.3.5 !) and most suspicious is the version of your compiler 2.96 !
I don't remember 2.96 was officially released ! I'd recommend to think twice
about your compiler. Don't know if postgresql supports unoffical releases.


Oleg
Post by Sam Barnett-Cormack
Post by Oleg Bartunov
Post by Rajesh Kumar Mallah
Does any one has any solution for it?
Regds
Mallah.
tradein_clients=# SELECT version();
+-----------------------------------------------------------+
| version |
+-----------------------------------------------------------+
| PostgreSQL 7.3 on i686-pc-linux-gnu, compiled by GCC 2.96 |
+-----------------------------------------------------------+
(1 row)
Time: 0.61 ms
tradein_clients=# SELECT txt2txtidx('Hello');
+------------+
| txt2txtidx |
+------------+
| 'hello' |
+------------+
(1 row)
Time: 0.72 ms
tradein_clients=# SELECT txt2txtidx('Hello A');
+------------+
| txt2txtidx |
+------------+
| 'hello' |
+------------+
(1 row)
Time: 0.72 ms
tradein_clients=# SELECT txt2txtidx('Hello A-');
+------------+
| txt2txtidx |
+------------+
| 'hello' |
+------------+
(1 row)
Time: 0.64 ms
tradein_clients=# SELECT txt2txtidx('Hello A-A');
+---------------+
| txt2txtidx |
+---------------+
| 'a-a' 'hello' |
+---------------+
(1 row)
Time: 0.92 ms
tradein_clients=# SELECT txt2txtidx('Hello A-1');
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!#
Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
phone: +007(095)939-16-83, +007(095)939-23-83
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: ***@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ***@postgresql.org so that your
message can get through to the mailing list cleanly
Donald Fraser
2004-02-24 15:27:05 UTC
Permalink
----- Original Message -----
From: "Oleg Bartunov" <***@sai.msu.su>
To: "Sam Barnett-Cormack" <s.barnett-***@lancaster.ac.uk>
Cc: "Rajesh Kumar Mallah" <***@trade-india.com>;
<pgsql-***@postgresql.org>

<snip,snip>
Post by Oleg Bartunov
I see your version of postgresql is outdated (you may upgrade at least
to 7.3.5 !) and most suspicious is the version of your compiler 2.96 !
I don't remember 2.96 was officially released ! I'd recommend to think twice
about your compiler. Don't know if postgresql supports unoffical releases.
2.96 is an official release under Redhat
Linux version 2.4.7-10 (gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98))
#1 Thu Sep 6 17:27:27 EDT 2001

I am also using postgres 7.3.4, but unfortunatley I am using tsearch2 so I
cannot run the same tests.

Donald Fraser


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
Tom Lane
2004-02-24 15:39:36 UTC
Permalink
Post by Oleg Bartunov
Also, I run test on 7.3.3
Everything is ok.
I see your version of postgresql is outdated (you may upgrade at least
to 7.3.5 !) and most suspicious is the version of your compiler 2.96 !
There was at least one post-7.3 bug fix in tsearch, according to the CVS
logs. Could this be it?

2002-12-06 00:15 momjian

* contrib/tsearch/morph.c (REL7_3_STABLE): Thank you very much, you
catch it :). This bug had a long life, because it exists if and
only if locale of postmaster was a different from C (or
ru_RU.KOI8-R).

Please, apply patch for current CVS & 7.3.1
Post by Oleg Bartunov
Ok, I nailed the bug, but i'm not sure what the correct fix is.
Attached tsearch_morph.diff that remedies this problem by
avoiding it.
Post by Oleg Bartunov
Also there's a debug aid patch if someone would like to know how
i
Post by Oleg Bartunov
finally found it out :)
There problem in the lemmatize() function is that GETDICT(...)
returned
Post by Oleg Bartunov
a value not handled (BYLOCALE).
The value (-1) and later used as an index into the dicts[] array.
After that everything went berserk stack went crazy somehow so
trapping
Post by Oleg Bartunov
the fault sent me to the wrong place, and every time i read the
value it
Post by Oleg Bartunov
was positive ;)
So now i just return the initial word passed to the lemmatize
function,
Post by Oleg Bartunov
because i don't know what to do with it.
Magnus Naeslund

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match
Oleg Bartunov
2004-02-24 18:28:07 UTC
Permalink
Post by Tom Lane
Post by Oleg Bartunov
Also, I run test on 7.3.3
Everything is ok.
I see your version of postgresql is outdated (you may upgrade at least
to 7.3.5 !) and most suspicious is the version of your compiler 2.96 !
There was at least one post-7.3 bug fix in tsearch, according to the CVS
logs. Could this be it?
Most probable !
Post by Tom Lane
2002-12-06 00:15 momjian
* contrib/tsearch/morph.c (REL7_3_STABLE): Thank you very much, you
catch it :). This bug had a long life, because it exists if and
only if locale of postmaster was a different from C (or
ru_RU.KOI8-R).
Please, apply patch for current CVS & 7.3.1
Post by Oleg Bartunov
Ok, I nailed the bug, but i'm not sure what the correct fix is.
Attached tsearch_morph.diff that remedies this problem by
avoiding it.
Post by Oleg Bartunov
Also there's a debug aid patch if someone would like to know how
i
Post by Oleg Bartunov
finally found it out :)
There problem in the lemmatize() function is that GETDICT(...)
returned
Post by Oleg Bartunov
a value not handled (BYLOCALE).
The value (-1) and later used as an index into the dicts[] array.
After that everything went berserk stack went crazy somehow so
trapping
Post by Oleg Bartunov
the fault sent me to the wrong place, and every time i read the
value it
Post by Oleg Bartunov
was positive ;)
So now i just return the initial word passed to the lemmatize
function,
Post by Oleg Bartunov
because i don't know what to do with it.
Magnus Naeslund
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match
Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: ***@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Loading...