Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iWYzl-00028n-Qy for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Nov 2019 04:50:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iWYzj-0003bp-Q5 for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Nov 2019 04:50:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iWYzj-0003bi-IJ for pgsql-bugs@lists.postgresql.org; Mon, 18 Nov 2019 04:50:35 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iWYzb-0001IQ-AM for pgsql-bugs@lists.postgresql.org; Mon, 18 Nov 2019 04:50:34 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 593ED5D3; Sun, 17 Nov 2019 23:50:24 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 17 Nov 2019 23:50:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=Ut7cWqtl3YpEGiwYnyoI3lgD6yH PGlBwmHSqtR+VA7I=; b=PB5IqJnQRcmPnEHm8+Cmv8+uDm0F8EGuvtabJKzUQXu hwQ9GhCq0PUMHRRgqyG4m8LPx87/cit1JxQW5saOyktAqcHaanzv6LaAzhtcTL9A hWffIBAoS84t4WUIVBV2c/3QXxSQppPrd13jycUv7Xw9JzsGirlqk7pCVuZk3a+v QeXH5WXfWqpWW5IyOhiQJtCy4IOC9bIPmLhANBeZGY3tuDKM+rLCQf08wGizCXvf 7Rnv4bTe47wsNBBAd8aVzeuqUg0TqvaYFHjDK09NRFribhF5BvBVQXXBa/dOZurh KQQ9Cq5eRdZj5A1/MJdf4nIyL3rfb8m9pNnCQRajR+A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Ut7cWq tl3YpEGiwYnyoI3lgD6yHPGlBwmHSqtR+VA7I=; b=U8OzZgeuNCGzY6MgUGlSrC /g+rs2OP8e1BDIXBqPTxHPgukdTJsbYEclt35jukP15S1nx7r/P85g0a08/956sQ wkd18k9zQllOr+y4ybarLrGdrBe9OJ6tv27GV/1ZnPwP9TDj3e3U2XM3gJzirXf/ pLmriJejkV+LtzXcXL8wwpk61jpl/KXUO6oh4sfMl2xPjV7zFcxqCp7vHem0JRxN TWJackYNZAicjIAWDpJxV6/lMFpDBnLmdku4ssL8mGySQwZo2xFGFmaCn3chicS8 SqU3fOFKUA61De8SmmFwFpAWlkXJHQl2VXRuXZKv36VVa64+4rYS/A+gIFAwqU7g == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudeggedgjeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdlfeehmdenucfjughrpeffhf fvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhu ihgvrhcuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucfkphepudduuddrud dtvddrudektddrudekheenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhes phgrqhhuihgvrhdrgiihiienucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id BDF5C8005A; Sun, 17 Nov 2019 23:50:22 -0500 (EST) Date: Mon, 18 Nov 2019 13:50:20 +0900 From: Michael Paquier To: adam.c.scott@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16122: segfault pg_detoast_datum (datum=0x0) at fmgr.c:1833 numrange query Message-ID: <20191118045020.GC1543@paquier.xyz> References: <16122-eb35bc248c806c15@postgresql.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="WplhKdTI2c8ulnbP" Content-Disposition: inline In-Reply-To: <16122-eb35bc248c806c15@postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --WplhKdTI2c8ulnbP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Adam, On Mon, Nov 18, 2019 at 01:27:22AM +0000, PG Bug reporting form wrote: > Email address: adam.c.scott@gmail.com > PostgreSQL version: 10.11 > Operating system: Ubuntu & CentOS > Description: =20 Did you see that after updating to 10.11. If you used 10.10 or an older version, did the problem happen? > Seg fault can be repeated by running this query: >=20 > select count(*) from natica_hdu where boundary is not null > and > "dec_range" <@ '[89.9999998611111,90.0000001388889)' AND "ra_range" <@ > '[45.0,45.1]'; It would help if we had a sample of data here able to reproduce the problem. Something looks to be wrong with this range operator when working on numeric ranges, still I cannot reproduce the problem with for example stuff like that: CREATE TABLE aa (a numrange); CREATE INDEX aai ON aa(a); INSERT INTO aa SELECT ('['|| (90.0 - a::numeric/10000000000) || ',' || (90.0 + a::numeric/10000000000) || ')')::numrange FROM generate_series(1,10000) as a; SELECT count(*) FROM aa WHERE a <@ '[89.9999998611111,90.0000001388889)'; Seeing the plan of your query may help as well. Could you run EXPLAIN on it or does it crash before? Perhaps a parallel plan is involved here? > #0 pg_detoast_datum (datum=3D0xffffffff) at fmgr.c:1833 > #1 0x0000557a18c19545 in numeric_sub (fcinfo=3Dfcinfo@entry=3D0x7ffff579= 5e30) > at numeric.c:2288 Hmm. Per the shape of this backtrace, you are indeed processing the range operator, and this portion of memory looks freed. My simplified example above basically goes through the same when planning the query. -- Michael --WplhKdTI2c8ulnbP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl3SIwwACgkQnvQgOdby QH1Pdw/9Er2zvw+JWiIBQRG/AQJELUeGOVyK36ldt+PmzEp8KY2CyutpIvPsbXxl wXFxpLO+IhwK+tnugAKaG5OdaNqc4WkCzlwAbqU4M01MGDAAAyUdNEObL45o6Mkn pGLQ3lzZ7bWBt8hL1CCGXhRxP9GLxDFhD+5tkXu0NlaPc3iFMu9u0ZPpCUkHIZB8 jw05rqu9SigHJrXei4wUMtpI0NFtzHPmxP/U4K59gl/XDURIHbmK3pvXi5XP+82x z9jQN81nDhf7Seqacdswj2rGppG9GlUqSnfuFbnZqMTHh1IzLWgvBZNiU08GYoXV eHHW/qJoFN48URWWg6z1tvL9L8k+ar6nBGrSF04+Yw6Pp4Zobq0Fw6/WDVVbWO4o F0+sh6J+YGVIkhGU8DMn9X2Gu9C9pGyjlJ5RZ5iWc/cqFGWXH6iwK/XU90UsGTPL niZtW7j4TGXctpVTmvj967cOsTwA7MdXm42eBkiL1/emJeJc18JJ8ww2aPgLMw5n erch3CDVaXeCOHcnM7RdVP06QakexWqyhNdx68SQtMU+hD4sOM40D4TNk5gyMp3m kT6DnO5CkQiZJgOz8B7hFbVfWDRcmqA4zhyilpEt0g7rc1xWFvVIuPwHFx8FRRrZ ubwT3feufaacVhHSGc2AvpKgMa6zd2LaLSoipXE+ZxkXkOnt/WY= =3xi3 -----END PGP SIGNATURE----- --WplhKdTI2c8ulnbP--