Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pxm2w-0000cZ-0B for pgsql-hackers@arkaria.postgresql.org; Sat, 13 May 2023 10:00:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pxm2t-00027h-8j for pgsql-hackers@arkaria.postgresql.org; Sat, 13 May 2023 10:00:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pxm2s-00027X-Te for pgsql-hackers@lists.postgresql.org; Sat, 13 May 2023 10:00:10 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1pxm2m-002OhB-62 for pgsql-hackers@lists.postgresql.org; Sat, 13 May 2023 10:00:09 +0000 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4f1fe1208a4so9334202e87.2 for ; Sat, 13 May 2023 03:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683972003; x=1686564003; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=6QzXBM710QXZg6ERCk2jShv9dXYI1RYEQBSubunxT+8=; b=rk993xxFm0J11kYUMWqLwKbS2z3sWat23Gx63/A4uf8AHHwzXCKxxz8PsHDBC/tWlZ //QOjdaiyiYsEvB79A9jcMEr0R40jYoNmq6Swufn1kV8eHs1lVv1QDubPnfsi8cx3LNh 2sr4/dYCTbsC74HOhIhpdik0aviypZjyEBRQzwn3NG6nw6c2E+jo6p5oQXKeGpZRIYwA MP8EYeeH267r78tWGDe+GV5LAa3QUGglzRKO6lNfWUqhObuZgB6O2ZZiAXIIYI1lgQNP r7329jMlsHfCBA05H4AJJR7QZsh8E92PQlC4ksZJ1XoVff8geog4TT08NBddHbZ+/3Pj td8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683972003; x=1686564003; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6QzXBM710QXZg6ERCk2jShv9dXYI1RYEQBSubunxT+8=; b=XhzLLST1ACOIls6k6RJsqYSdd989QYGJgGRwMqFrFMtQkMyV6txGGmD9HT3YZOwKe6 O/PLbzTP7QAZfnYQOsLWlz4s4fUwVb9crDYBf2TL6jPWkCkjQhWo7FT4UYH6EsXVRvri 1xlftgNKHnrHz2vRU4Et/scCzPQrJ2fF0JGbQo76iXW0NV7XEBWJCqbEd75j05dI2ipL yBVEUQZ7neYEVIomJlWUKCYkyMqpf/jb8z7x0kdgz9qRpADMJVw/gH+dk4kRMADcwWcI CdP4h2lOV4TMlynUL/F19DNb+nzGzBypheeT7mdivNOnkgS2RHBb91cwUILIljPytbIp O+uA== X-Gm-Message-State: AC+VfDzOt8HBCjJPZQ1o87bIjBNs9F0qRabdhrfvwSZaJlWm7rAYoIQ2 zZzTJc5K+au5iJygk8GwGp8= X-Google-Smtp-Source: ACHHUZ6IYhMxcFCxWZm3rip0QZL94c6dbf61kMMjdLtQPA6ESQzu1URuASQ9kDTcRBMikUDg0Bd6Sg== X-Received: by 2002:ac2:55ae:0:b0:4f1:3716:ab34 with SMTP id y14-20020ac255ae000000b004f13716ab34mr5147614lfg.60.1683972003161; Sat, 13 May 2023 03:00:03 -0700 (PDT) Received: from [1.0.0.7] ([81.23.166.126]) by smtp.gmail.com with ESMTPSA id b11-20020ac2410b000000b004eff6c7bc08sm1791483lfi.75.2023.05.13.03.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 13 May 2023 03:00:02 -0700 (PDT) Message-ID: <2098874d-c111-41e4-9063-30bcf135226b@gmail.com> Date: Sat, 13 May 2023 13:00:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: Order changes in PG16 since ICU introduction To: Jeff Davis , Tom Lane Cc: Daniel Verite , Andrew Gierth , Peter Eisentraut , Sandro Santilli , Regina Obe , pgsql-hackers@lists.postgresql.org References: <543e4ce6-8205-4aea-b54b-12b9ef747bf6@manitou-mail.org> <654a49f7ff7461bcf47be4181430678d45f93858.camel@j-davis.com> <37520ec1ae9591f83132f82dbd625f3fc2d69c16.camel@j-davis.com> <483826.1683582475@sss.pgh.pa.us> From: Alexander Lakhin Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello Jeff, 09.05.2023 00:59, Jeff Davis wrote: > The easiest thing to do is revert it for now, and after we sort out the > memcmp() path for the ICU provider, then I can commit it again (after > that point it would just be code cleanup and should have no functional > impact). On the current master (after 455f948b0, and before f7faa9976, of course) I get an ASAN-detected failure with the following query: CREATE COLLATION col (provider = icu, locale = '123456789012'); ==2929883==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffc491be09c at pc 0x556e8571a260 bp 0x7 ffc491be020 sp 0x7ffc491bd7c8 READ of size 15 at 0x7ffc491be09c thread T0     #0 0x556e8571a25f in __interceptor_strcmp.part.0 (.../usr/local/pgsql/bin/postgres+0x2aa025f)     #1 0x556e86d77ee6 in icu_language_tag .../src/backend/utils/adt/pg_locale.c:2802 ... Address 0x7ffc491be09c is located in stack of thread T0 at offset 76 in frame     #0 0x556e86d77cfe in icu_language_tag .../src/backend/utils/adt/pg_locale.c:2782   This frame has 2 object(s):     [48, 52) 'status' (line 2784)     [64, 76) 'lang' (line 2785) <== Memory access at offset 76 overflows this variable ... Here, uloc_getLanguage(loc_str, lang, ULOC_LANG_CAPACITY, &status) returns status = -124, i.e.,     U_STRING_NOT_TERMINATED_WARNING = -124,/**< An output string could not be NUL-terminated because output length==destCapacity. */ (ULOC_LANG_CAPACITY = 12) this value is not covered by U_FAILURE(status), and strcmp(), that follows, goes out of the lang variable bounds. Best regards, Alexander