pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pasi Eronen <pe@iki.fi>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #17362: Error "could not find block containing chunk" when using index with icu collation on CentOS 7
Date: Wed, 02 Feb 2022 12:49:27 -0500
Message-ID: <14517.1643824167@sss.pgh.pa.us> (raw)
In-Reply-To: <CAGtiUvnysMFJqv0NLtJKu-ww1QBid76nV7TBqKn=rGDQQ1VFow@mail.gmail.com>
References: <17362-63967721ee562fa7@postgresql.org>
	<CAH2-Wz=K4AZqQentZ0VgYjk3RpRA8n6oVrt2Cv0b977dA4qrDQ@mail.gmail.com>
	<3869d444-2f89-f157-318d-a71ed712dcb7@enterprisedb.com>
	<efd06d12-549b-8490-54f4-e43f7fb1d2cc@enterprisedb.com>
	<CAGtiUvnysMFJqv0NLtJKu-ww1QBid76nV7TBqKn=rGDQQ1VFow@mail.gmail.com>

Pasi Eronen <pe@iki.fi> writes:
> In varlena.c, ssup_extra->buf1 and buf2 are initialized to 1024-byte
> buffers, allocated from the ssup->ssup_cxt memory context.  That
> strange-looking test string in my bug report just happens to be 1044
> bytes, so a larger buffer is needed at some point.

> If growing the buffer happens in "varstrfastcmp_locale", it uses
> MemoryContextAlloc(ssup->ssup_cxt, ...). But if growing the buffer
> happens in "varstr_abbrev_convert", it just calls "palloc" - and
> apparently the current memory context is not ssup_cxt at this point
> (at least according to debugging printf's I added).

> Might this be causing the problem?

Indeed.  The whole thing seems flat-out wrong to me: repalloc
would be shorter, safer, and more idiomatic.

			regards, tom lane





view thread (8+ messages)

Message-ID: <14517.1643824167@sss.pgh.pa.us>
Permalink:  ../14517.1643824167@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/14517.1643824167@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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pe@iki.fi, peter.eisentraut@enterprisedb.com, pg@bowt.ie, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17362: Error "could not find block containing chunk" when using index with icu collation on CentOS 7
  In-Reply-To: <14517.1643824167@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