Re: BUG #17362: Error "could not find block containing chunk" when using index with icu collation on CentOS 7 - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17362: Error "could not find block containing chunk" when using index with icu collation on CentOS 7
Date
Msg-id 14517.1643824167@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #17362: Error "could not find block containing chunk" when using index with icu collation on CentOS 7  (Pasi Eronen <pe@iki.fi>)
List pgsql-bugs
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



pgsql-bugs by date:

Previous
From: Pasi Eronen
Date:
Subject: Re: BUG #17362: Error "could not find block containing chunk" when using index with icu collation on CentOS 7
Next
From: Pragati Agarwal
Date:
Subject: Re: Postgresql error : PANIC: could not locate a valid checkpoint record