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 1kPmsb-0003Ja-VP for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Oct 2020 13:19:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kPmsa-0005pp-Ed for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Oct 2020 13:19:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPmsa-0005pi-2y for pgsql-hackers@lists.postgresql.org; Tue, 06 Oct 2020 13:19:44 +0000 Received: from meesny.iki.fi ([195.140.195.201]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPmsS-0007AZ-NZ for pgsql-hackers@postgresql.org; Tue, 06 Oct 2020 13:19:43 +0000 Received: from [192.168.1.113] (dsl-hkibng22-54faa4-119.dhcp.inet.fi [84.250.164.119]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by meesny.iki.fi (Postfix) with ESMTPSA id 680DD2007C; Tue, 6 Oct 2020 16:19:31 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1601990371; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0xpDb+JJB1o+vxffeX7SH4zFliveALFjexTTI0A8t7w=; b=qtq/MTf2POOpeHfGGenOLk9uyGgkJRpxm7s2CxHCrjW9j9HCN3vaxwKZfAo7FmCFKJYFH3 gvs+F34FGtJSULnmn4DTR7EiJJrvR8U/WyCGLSxEaAyopAKqWnZiMjITW5pRrNfmn4sdeN eQM364aYhJlQ4CMcp0t5K1zztJDTk2s= Subject: Re: Yet another fast GiST build To: Pavel Borisov Cc: "Andrey M. Borodin" , Tom Lane , Justin Pryzby , =?UTF-8?Q?Darafei_Kom=d1=8fpa_Praliaskouski?= , Thomas Munro , Michael Paquier , Alexander Korotkov , pgsql-hackers References: <7d9158ca-d7cb-88f0-dbbd-1d5cec32b1ae@iki.fi> <8516B6A8-11B2-41A8-B7EB-D0C38ADD06C3@yandex-team.ru> <50e03197-6e75-faec-16dc-41a2a38f080c@iki.fi> <123F5F32-9A85-4D0B-9C7A-1686E6BBE15D@yandex-team.ru> <85df399a-e8a4-2369-f723-fd1a3a872575@iki.fi> <884200.1600634472@sss.pgh.pa.us> <891385.1600636205@sss.pgh.pa.us> <20200920224446.GF30557@telsasoft.com> <896113.1600643169@sss.pgh.pa.us> <8269ca22-d275-0afe-633c-2342c7ba11e6@iki.fi> <47CD54A6-EE59-433A-96E2-6F4E5973CEF4@yandex-team.ru> <422beff9-0e01-9ce6-edb9-c2a2289e8eb9@iki.fi> <0A1DDF47-CAB7-4D6A-9677-B1800FFB6984@yandex-team.ru> <4D68C21F-9FB9-41DA-B663-FDFC8D143788@yandex-team.ru> <4098005f-e4b5-5904-4b33-335dd106c132@iki.fi> <3520A18A-5C38-4697-A2E3-F3BDE3496CD5@yandex-team.ru> <282f7007-326a-f3d6-7394-0e5ea52df84f@iki.fi> From: Heikki Linnakangas Message-ID: <867aacfd-d1af-3eed-5e40-dfc334668d65@iki.fi> Date: Tue, 6 Oct 2020 16:19:31 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1601990371; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0xpDb+JJB1o+vxffeX7SH4zFliveALFjexTTI0A8t7w=; b=gF+Ee1OdSwPkEJ5LAlwjvKIfAXdFVGRPcUBRK1Lx6cujScmOMeJOMDtB9dZjgXV8JhjR64 xE1aJocNm+f44sx1IEyhHNVvD5eNqoWO+Q1lnm28sWsdmjpH9NbInq0ufJrlEySq8lciLx YyyLKvwRGaA4s7TFixppFE6b62JTrvc= ARC-Seal: i=1; s=meesny; d=iki.fi; t=1601990371; a=rsa-sha256; cv=none; b=FrxNYyQlxt+cLD0QomEtE1mEZDRYLPwVwCUGO7i/6lzS6oAuJv691uZFxSNKlr35EOuZl8 7tlIIH7t73NHbalmke+QIOk9UXx3TIxTG0AZEStbQV7HsqQVtbPUcQN0eAzc0uJupltutl /zym+TL/SI50vrW8sid6CTGZM/f+cno= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 06/10/2020 14:05, Pavel Borisov wrote: > I've been making tests with memory sanitizer Thanks! > and got one another error > in regression test create_index: > CREATE INDEX gpointind ON point_tbl USING gist (f1); > server closed the connection unexpectedly > > with logfile: > gistproc.c:1714:28: runtime error: 1e+300 is outside the range of > representable values of type 'float' > SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior gistproc.c:1714:28 > > gistproc.c: > 1714     z = point_zorder_internal(p->x, p->y); > > Consider this a minor issue but unrelated to the other issues discussed. > It is reproduced on the last master > commit 0a3c864c32751fd29d021929cf70af421fd27370 after all changes into > Gist committed. > > cflags="-DUSE_VALGRIND -Og -O0 -fsanitize=address -fsanitize=undefined > -fno-sanitize-recover=all -fno-sanitize=alignment -fstack-protector" You get the same error with: select (float8 '1e+300')::float4; float.c:1204:11: runtime error: 1e+300 is outside the range of representable values of type 'float' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior float.c:1204:11 in It boils down to casting a C double to float, when the value doesn't fit in float. I'm surprised that's undefined behavior, but I'm no C99 lawyer. The code in dtof() expects it to yield Inf. I'm inclined to shrug this off and say that the sanitizer is being over-zealous. Is there some compiler flag we should be setting, to tell it that we require specific behavior? Any other ideas? - Heikki