Unix Technical Forum

Crash 8.2.5 backend using tsearch2

This is a discussion on Crash 8.2.5 backend using tsearch2 within the pgsql Bugs forums, part of the PostgreSQL category; --> Hi. I've tracked down some crashes we are having and produced a test case using the nasty data. The ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 11:08 AM
Stuart Bishop
 
Posts: n/a
Default Crash 8.2.5 backend using tsearch2

Hi.

I've tracked down some crashes we are having and produced a test case using
the nasty data. The sample data used to trigger the crash is 6MB in size.It
doesn't crash immediately, instead chewing up CPU for several minutes before
crashing.

http://launchpadlibrarian.net/9501485/crashme.sql

I've only tried reproducing this with latest released Ubuntu packages
(Feisty) for 8.2.5.

Also reported in the Ubuntu bug tracker too:

https://bugs.launchpad.net/ubuntu/+s...ql/+bug/144740

--
Stuart Bishop <stuart@stuartbishop.net>
http://www.stuartbishop.net/


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFG+PhTAfqZj7rGN0oRAgvMAJ990AVqU8E4xpOO/zrri/SEDzuBywCfZeFT
/p4EaEWi369IfQKOFbiIaGw=
=/ZPk
-----END PGP SIGNATURE-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 11:08 AM
Tom Lane
 
Posts: n/a
Default Re: Crash 8.2.5 backend using tsearch2

Stuart Bishop <stuart@stuartbishop.net> writes:
> I've tracked down some crashes we are having and produced a test case using
> the nasty data. The sample data used to trigger the crash is 6MB in size. It
> doesn't crash immediately, instead chewing up CPU for several minutes before
> crashing.


> http://launchpadlibrarian.net/9501485/crashme.sql


This example crashes CVS HEAD as well. It appears that pg_qsort is
going into infinite recursion, which surely ought to be impossible ...
unless the comparison function is giving self-inconsistent results.
Which it looks like it is: compareWORD() is written in such a way that
it will never return zero, which cannot be right. Given two inputs
that are in fact equal, the result will depend on the order in which
they are presented, which is sufficient to confuse any sort algorithm.
And sure enough, that's what is being compared:

(gdb) f 0
#0 0x00000000005d9c37 in compareWORD (a=0x2aaaaeec2048, b=0x2aaaaeec69c8)
at to_tsany.c:37
37 int res = strncmp(
(gdb) p *(ParsedWord *) a
$1 = {len = 1, nvariant = 0, pos = {pos = 16383, apos = 0x3fff},
word = 0x2aaab547da78 "0", alen = 0}
(gdb) p *(ParsedWord *) b
$2 = {len = 1, nvariant = 0, pos = {pos = 16383, apos = 0x3fff},
word = 0x2aaab988c710 "0", alen = 0}
(gdb)

It may be that this is a "not supposed to happen" case because there
shouldn't be any equal items in the sort input; in which case there
is some other bug involved too. But I would say that compareWORD
is broken nonetheless.

Teodor, Oleg, your thoughts?

regards, tom lane


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 11:08 AM
Teodor Sigaev
 
Posts: n/a
Default Re: Crash 8.2.5 backend using tsearch2

> is some other bug involved too. But I would say that compareWORD
> is broken nonetheless.

Fixed, you are right.


--
Teodor Sigaev E-mail: teodor@sigaev.ru
WWW: http://www.sigaev.ru/

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:23 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com