Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4RKu-0002Ed-04 for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Oct 2017 12:51:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e4RKt-0005TY-BI for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Oct 2017 12:51:07 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e4RJL-0002hn-61 for pgsql-hackers@postgresql.org; Tue, 17 Oct 2017 12:49:31 +0000 Received: from mail-it0-x229.google.com ([2607:f8b0:4001:c0b::229]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1e4RJH-00041i-Gf for pgsql-hackers@postgresql.org; Tue, 17 Oct 2017 12:49:30 +0000 Received: by mail-it0-x229.google.com with SMTP id p138so2326803itp.2 for ; Tue, 17 Oct 2017 05:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=1UuJtBp58JYGysGZ0rI//LD0jwh1kzKLJiU91dNbdYA=; b=mO8RxaVFqrzq9dcLv/eOBllR7cwq4cbSVHTVdGVaiL46KhpfkDdBNtoQg4tAqDglXD /bRWf8c4ZxniwZ2f+C44p+DgpcqcBiKTg08VfJAujT8qhH4HWQn/RvdIyj7YTk3S9vx1 Lg2UDqztVPIB9bWeLAq6nd1iQr3JkunQIPk1Nf2zlRZIuRIxbpnm2S6GH594+4owN2PA WgTbdD7urddJZkvuxLl5gpp3VrznFIuyAzDxeqfIXE38xBH/0lrTdUlgBs7oIYmaZZIM aZgMyh8iFdxW9mmzCEUl9KpKVZ3BJ4cinj8EMQY7vd3Uy3lEfc13jm1RsCSloIM9cz8P zVgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=1UuJtBp58JYGysGZ0rI//LD0jwh1kzKLJiU91dNbdYA=; b=qiIyhJZAXFRUAWvjmikUXOc70UyyPGUjNYXrkr2gMxr5CNTj+f41cJ15FWbRxaIHtM wgDozWnhu1geKjOb9gD7/J1Xaj82s9TxD1h0rGh+Sc7SzfJhu5Uv56xWQrOq54/iy5/M XO6OIF1iSHcWRKOCnjNriy8aEhm7HQj03O4BXGtIvRGl6PnvDeFH4UO/L6pk8NpQxbNt h2/kS8PJr+zb4wDS1VsT+aZwxNO/1/DGoaz8a79EAcfejXv+w8Aha0Dzaxc4asnVjGtQ UJaC79r39Ec63w9rXnmAYpdj4NzBiW/38gJWAnOPQKcMgoaEuJ8l0FXT2IZTfncZuTe3 33FQ== X-Gm-Message-State: AMCzsaUHEbyfHDFpohLdssKTAd9fP7fE7q6pEJOTMmYnvH8v+25xX/wf FRg4HZPwdEHgpZTqekfCKT3afefjHVY= X-Google-Smtp-Source: ABhQp+TU5DLxSCYFMrCDXwqx0NHn9ejIDhdt06qO8ywrRDK6o7ek+cVwoSwGbkDXh3GkMfuMVZpWwg== X-Received: by 10.36.190.199 with SMTP id i190mr5019861itf.20.1508244565657; Tue, 17 Oct 2017 05:49:25 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id u125sm4760547ioe.65.2017.10.17.05.49.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Oct 2017 05:49:25 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id 4C4F580129D; Tue, 17 Oct 2017 07:49:24 -0500 (CDT) Date: Tue, 17 Oct 2017 07:49:24 -0500 From: Justin Pryzby To: Alvaro Herrera Cc: pgsql-hackers@postgresql.org Subject: Re: SIGSEGV in BRIN autosummarize Message-ID: <20171017124924.GA4398@telsasoft.com> References: <20171014224220.GB22678@telsasoft.com> <20171017105916.3rvmznxnuphn3uph@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171017105916.3rvmznxnuphn3uph@alvherre.pgsql> User-Agent: Mutt/1.5.23 (2014-03-12) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On Tue, Oct 17, 2017 at 12:59:16PM +0200, Alvaro Herrera wrote: > Justin Pryzby wrote: > > > #1 0x00000000006a52e9 in perform_work_item (workitem=0x7f8ad1f94824) at autovacuum.c:2676 > > cur_datname = 0x298c740 "no 1 :vartype 1184 :vartypmod -1 :varcollid 0 :varlevelsup 0 :varnoold 1 :varoattno 1 :location 146} {CONST :consttype 1184 :consttypmod -1 :constcollid 0 :constlen 8 :constbyval true :constisnull fal"... > > cur_nspname = 0x298c728 "s ({VAR :varno 1 :varattno 1 :vartype 1184 :vartypmod -1 :varcollid 0 :varlevelsup 0 :varnoold 1 :varoattno 1 :location 146} {CONST :consttype 1184 :consttypmod -1 :constcollid 0 :constlen 8 :constbyv"... > > cur_relname = 0x298cd68 "cdrs_eric_msc_sms_2017_10_14_startofcharge_idx" > > __func__ = "perform_work_item" > > cur_datname here seems corrupted -- it points halfway into cur_nspname, > which is also a corrupt value. And I think that's because we're not > checking that the namespace OID is a valid value before calling > get_namespace_name on it. And I'm betting that these values are all not > what we expect, because we're not checking that we're in the correct > database before trying to execute the work item. I don't quite > understand how this results in an invalid string rather than just a > NULL, as I would have expected. I'm happy to try the patch, but in case it makes any difference, we have few DBs/schemas: postgres=# \dn List of schemas Name | Owner --------+---------- public | postgres (1 row) postgres=# \l+ List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges | Size | Tablespace | Description -----------+----------+----------+-------------+-------------+-----------------------+---------+------------+-------------------------------------------- gtt | pryzbyj | UTF8 | en_US.UTF-8 | en_US.UTF-8 | | 2215 GB | pg_default | postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | | 76 GB | pg_default | default administrative connection database template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +| 7625 kB | pg_default | unmodifiable empty database | | | | | postgres=CTc/postgres | | | template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | postgres=CTc/postgres+| 7485 kB | pg_default | default template for new databases | | | | | =c/postgres | | | (4 rows) Note that db:postgres is of substantial size since I set log_statement=all and log_destination=stderr,csv, and import all CSVs into a table heirarchy in db:postgres. There are 3 BRIN indices per (daily child) table in db:gtt (and none in postgres, although that's probably a good idea for the timestamp column once all our customers are upgraded to PG10). Justin -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers