Re: Crash report for some ICU-52 (debian8) COLLATE and work_mem values

Daniel Verite <daniel@manitou-mail.org>

From: "Daniel Verite" <daniel@manitou-mail.org>
To: "Tom Lane" <tgl@sss.pgh.pa.us>
Cc: "Peter Geoghegan" <pg@bowt.ie>,"PostgreSQL mailing lists" <pgsql-bugs@postgresql.org>,"Peter Eisentraut" <peter.eisentraut@2ndquadrant.com>
Date: 2017-08-08T23:16:43Z
Lists: pgsql-bugs, pgsql-hackers
	Tom Lane wrote:

> The other class of failures amounts to this loop iterating till it falls
> off the end of memory:
> 
>        while(schar > (tchar = *(UCharOffset+offset))) { /* since the
> contraction codepoints should be ordered, we skip all that are smaller */
>            offset++;
>        }
> 
> which is unsurprising, because (in my core dump) schar is 1113834 which is
> larger than any possible UChar value, so the loop cannot terminate except
> by crashing.  The crash occurred while trying to process this string:
> 
>  buf2 = 0x1614d20 "requ\364\217\273\252te",
> 
> and I do not think it's coincidence that that multibyte character
> there corresponds to U+10FEEA or decimal 1113834.  Apparently
> they've got some bugs with dealing with characters beyond U+FFFF,
> at least in certain locales.

For that failure, this single comparison seems to hit it consistently
with ICU-52:

# SELECT 'ab' < 'abc'||chr(128519) COLLATE "bs-x-icu";

server closed the connection unexpectedly
	This probably means the server terminated abnormally
	before or while processing the request.

128519 is 'SMILING FACE WITH HALO' (U+1F607), and nearby codepoints
cause the same bug.

At least from this simple test we can produce a bug report
to the maintainers who are still interested in pre-53 versions.


Best regards,
-- 
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite


Commits

  1. Reject use of ucol_strcollUTF8() before ICU 53

  2. Rethink behavior of pg_import_system_collations().

  3. Faster expression evaluation and targetlist projection.