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 1goK4h-0000Lt-Jb for pgsql-general@arkaria.postgresql.org; Tue, 29 Jan 2019 03:28:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1goK4g-0007pZ-5V for pgsql-general@arkaria.postgresql.org; Tue, 29 Jan 2019 03:28:34 +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 1goK4f-0007pS-TX for pgsql-general@lists.postgresql.org; Tue, 29 Jan 2019 03:28:33 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1goK4d-0006lq-DM for pgsql-general@lists.postgresql.org; Tue, 29 Jan 2019 03:28:33 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x0T3STEG022880; Mon, 28 Jan 2019 22:28:29 -0500 From: Tom Lane To: pabloa98 cc: pgsql-general@lists.postgresql.org Subject: Re: postgresql v11.1 Segmentation fault: signal 11: by running SELECT... JIT Issue? In-reply-to: References: Comments: In-reply-to pabloa98 message dated "Mon, 28 Jan 2019 19:17:03 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <22878.1548732509.1@sss.pgh.pa.us> Date: Mon, 28 Jan 2019 22:28:29 -0500 Message-ID: <22879.1548732509@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk pabloa98 writes: > I just migrated our databases from PostgreSQL version 9.6 to version 11.1. > We got a segmentation fault while running this query: > SELECT f_2110 as x FROM baseline_denull > ORDER BY eid ASC > limit 500 > OFFSET 131000; > the table baseline_denull has 1765 columns, mainly numbers, like: Hm, that sounds like it matches this recent bug fix: Author: Andres Freund Branch: master [b23852766] 2018-11-27 10:07:03 -0800 Branch: REL_11_STABLE [aee085bc0] 2018-11-27 10:07:43 -0800 Fix jit compilation bug on wide tables. The function generated to perform JIT compiled tuple deforming failed when HeapTupleHeader's t_hoff was bigger than a signed int8. I'd failed to realize that LLVM's getelementptr would treat an int8 index argument as signed, rather than unsigned. That means that a hoff larger than 127 would result in a negative offset being applied. Fix that by widening the index to 32bit. Add a testcase with a wide table. Don't drop it, as it seems useful to verify other tools deal properly with wide tables. Thanks to Justin Pryzby for both reporting a bug and then reducing it to a reproducible testcase! Reported-By: Justin Pryzby Author: Andres Freund Discussion: https://postgr.es/m/20181115223959.GB10913@telsasoft.com Backpatch: 11, just as jit compilation was This would result in failures on wide rows that contain some null entries. If your table is mostly-not-null, that would fit the observation that it only crashes on a few rows. Can you try REL_11_STABLE branch tip and see if it works for you? regards, tom lane