pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andreas Seltenreich <seltenreich@gmx.de>
Cc: pgsql-hackers@postgresql.org
Cc: Oleg Bartunov <obartunov@gmail.com>
Cc: Teodor Sigaev <teodor@sigaev.ru>
Subject: Re: [sqlsmith] FailedAssertion("!(k == indices_count)", File: "tsvector_op.c", Line: 511)
Date: Wed, 03 Aug 2016 17:39:36 -0400
Message-ID: <20000.1470260376@sss.pgh.pa.us> (raw)
In-Reply-To: <87invhoj6e.fsf@credativ.de>
References: <87invhoj6e.fsf@credativ.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Andreas Seltenreich <seltenreich@gmx.de> writes:
> the following statement triggers an assertion in tsearch:

> select ts_delete(array_to_tsvector('{smith,smith,smith}'::text[]),  '{smith,smith}'::text[]);
> -- TRAP: FailedAssertion("!(k == indices_count)", File: "tsvector_op.c", Line: 511)

Confirmed here.  I notice that the output of array_to_tsvector() is
already fishy in this example:

regression=# select array_to_tsvector('{smith,smith,smith}'::text[]);
    array_to_tsvector    
-------------------------
 'smith' 'smith' 'smith'
(1 row)

Shouldn't those have been merged together?  You certainly don't get
results like that from other tsvector-producing operations:

regression=# select to_tsvector('smith smith smith');
  to_tsvector  
---------------
 'smith':1,2,3
(1 row)
regression=# select 'smith smith smith'::tsvector;
 tsvector 
----------
 'smith'
(1 row)

However, that does not seem to be the proximate cause of the crash
in ts_delete, because this non-duplicated case still crashes:

select ts_delete(array_to_tsvector('{smith,smithx,smithy}'::text[]),  '{smith,smith}'::text[]);

It kinda looks like you need more than one deletion request for
the first entry in the sorted tsvector, because for example
{smith,foo,toolbox} works but not {smith,too,toolbox}.

I'm thinking there are two distinct bugs here.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (8+ messages)  latest in thread

Message-ID: <20000.1470260376@sss.pgh.pa.us>
Permalink:  ../20000.1470260376@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20000.1470260376@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, seltenreich@gmx.de, obartunov@gmail.com, teodor@sigaev.ru
  Subject: Re: [sqlsmith] FailedAssertion("!(k == indices_count)", File: "tsvector_op.c", Line: 511)
  In-Reply-To: <20000.1470260376@sss.pgh.pa.us>
  References: <87invhoj6e.fsf@credativ.de> <20000.1470260376@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox