Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bV3uY-00068O-VA for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Aug 2016 21:41:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bV3uY-0005GV-Ek for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Aug 2016 21:41:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bV3tC-0003cz-Gd for pgsql-hackers@postgresql.org; Wed, 03 Aug 2016 21:39:46 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bV3t9-0004oQ-Ej for pgsql-hackers@postgresql.org; Wed, 03 Aug 2016 21:39:45 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u73Lda2b020001; Wed, 3 Aug 2016 17:39:36 -0400 From: Tom Lane To: Andreas Seltenreich cc: pgsql-hackers@postgresql.org, Oleg Bartunov , Teodor Sigaev Subject: Re: [sqlsmith] FailedAssertion("!(k == indices_count)", File: "tsvector_op.c", Line: 511) In-reply-to: <87invhoj6e.fsf@credativ.de> References: <87invhoj6e.fsf@credativ.de> Comments: In-reply-to Andreas Seltenreich message dated "Wed, 03 Aug 2016 19:29:13 +0200" Date: Wed, 03 Aug 2016 17:39:36 -0400 Message-ID: <20000.1470260376@sss.pgh.pa.us> X-Pg-Spam-Score: -3.1 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Andreas Seltenreich 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