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 1iICx9-0000eH-6m for pgsql-bugs@arkaria.postgresql.org; Wed, 09 Oct 2019 14: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 1iICx7-0000rs-4Z for pgsql-bugs@arkaria.postgresql.org; Wed, 09 Oct 2019 14:28:33 +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 1iICx6-0000rl-No for pgsql-bugs@lists.postgresql.org; Wed, 09 Oct 2019 14:28:32 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iICx3-0002eb-Lp for pgsql-bugs@lists.postgresql.org; Wed, 09 Oct 2019 14:28:32 +0000 Received: by mail-wm1-x342.google.com with SMTP id m18so2871310wmc.1 for ; Wed, 09 Oct 2019 07:28:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-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=zRpDCGrp16SLAWun3B30L+6ZVI8Hdk9G+h6jAK6su7k=; b=1BEONs59HvFiIDEDYgmu+5NtCitjIhULcfuW/9Y+dM+NmJD42G311bAF4hUZIn1ptT Tx6YGwYAGXYtKI/hMbEMl2/72Pya++zaZS5x4SPLuYkjTbxICpuAQ6RdwzHMYvFLhiei VvluQHBH68kScJo2sDlrFn/ZebHgd9v6y4yZkg+CgjDJTU+Tnfu/dEeDKJO+nc0UaJ7P +jytJHZeiPd997hd8QVDC6A7UdQgyhaXJsr+CuoSjOzdIfVZzCw8khK2GU7zyOhvPPXq M47Noy/GogYS4JbP8Q5PyABlYmBknbtUl4Hg3Ly6hiHls3c2rjmN9j+0+t7rhRXNHq3D 21XQ== 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=zRpDCGrp16SLAWun3B30L+6ZVI8Hdk9G+h6jAK6su7k=; b=CoVooLbJ0zwKmXpN9ZuQk1xi1dESTC3UMX+bfQOxrjlVqcXrI0R9V1rLmSfjNCCEPb nEA7AlVd4fBqNyM3mkQk0cy6CybHO16dsM3YI9DUYbiIn2MPIKDhIjvAbxGk+LDmtaUv YleDCfMMZC7NGrcVnxVsmM8Us3KNoIisGIGz62+pdYKhnpCvaLMmjQa26EF3GXaVGXOi YMNB8TkV82fVKm5wV1e5kkaYrtcxKeWIT4GdRIKGapVbdrnIPfFGovobI5JiN1fZr3dh 2yuBWeNm5xuZkJGjpypoT4NrjdJ/NS1TMbA0ccu+l0dmC61NQKCdPO3OmvBsb8/gTqtX 2LcA== X-Gm-Message-State: APjAAAXqxDhFLcjz7mpCdQmywYEXo6cd+wN8uorZo8goB7dI+RQH96Fa aC5omXsuPsHPtxltI9N0zoAVHQ== X-Google-Smtp-Source: APXvYqzTwZrqyON3vxcDycXk0UZk5h2Cb9/lUjy6PAdAwcCRFG/EHDrsOHWbvvwl3SmD+yVBN8GS3g== X-Received: by 2002:a7b:c444:: with SMTP id l4mr2901155wmi.49.1570631308651; Wed, 09 Oct 2019 07:28:28 -0700 (PDT) Received: from localhost (static-84-42-175-93.net.upcbroadband.cz. [84.42.175.93]) by smtp.gmail.com with ESMTPSA id z189sm4485247wmc.25.2019.10.09.07.28.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2019 07:28:27 -0700 (PDT) Date: Wed, 9 Oct 2019 16:28:27 +0200 From: Tomas Vondra To: Tom Lane Cc: buschmann@nidsa.net, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16045: vacuum_db crash and illegal memory alloc after pg_upgrade from PG11 to PG12 Message-ID: <20191009142827.6eph24m3se4clcwh@development> References: <16045-673e8fa6b5ace196@postgresql.org> <20191009132436.uugh4r3be6vw6ex4@development> <20191009135907.km2b5nrzflcz6xey@development> <20543.1570630021@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20543.1570630021@sss.pgh.pa.us> User-Agent: NeoMutt/20180716 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Oct 09, 2019 at 10:07:01AM -0400, Tom Lane wrote: >Tomas Vondra writes: >> FWIW I can reproduce this - it's enough to do this on the 11 cluster > >I failed to reproduce any problem from your example, but I was trying >in C locale on a Linux machine. What environment are you testing? > > regards, tom lane test=# show lc_collate ; lc_collate ------------ C.UTF-8 (1 row) I can reproduce this pretty easily like this: 1) build 11 git checkout REL_11_STABLE ./configure --prefix=/home/user/pg-11 --enable-debug --enable-cassert && make -s clean && make -s -j4 install 2) build 12 git checkout REL_12_STABLE ./configure --prefix=/home/user/pg-12 --enable-debug --enable-cassert && make -s clean && make -s -j4 install 3) create the 11 cluster /home/user/pg-11/bin/pg_ctl -D /tmp/data-11 init /home/user/pg-11/bin/pg_ctl -D /tmp/data-11 -l /tmp/pg-11.log start /home/user/pg-11/bin/createdb test /home/user/pg-11/bin/psql test 4) create the table create table q_tbl_archiv as with qseason as ( select table_name,column_name, ordinal_position ,replace(column_name,'_season','') as col_qualifier -- ,'id_'||replace(column_name,'_season','') as id_column from information_schema.columns order by table_name ) select qs.*,c.column_name as id_column, c.column_default as id_default from qseason qs left join information_schema.columns c on c.table_name=qs.table_name and c.column_name like 'id_%'; 5) shutdown the 11 cluster /home/user/pg-11/bin/pg_ctl -D /tmp/data-11 stop 6) init 12 cluster /home/user/pg-12/bin/pg_ctl -D /tmp/data-12 init 7) do the pg_upgrade thing /home/user/pg-12/bin/pg_upgrade -b /home/user/pg-11/bin -B /home/user/pg-12/bin -d /tmp/data-11 -D /tmp/data-12 -k 8) start 12 cluster /home/user/pg-12/bin/pg_ctl -D /tmp/data-12 -l /tmp/pg-12.log start 9) kabooom /home/user/pg-12/bin/psql test -c "analyze q_tbl_archiv" On my system (Fedora 30 in x86_64) this reliably results a crash (and various other crashes as demonstrated in my previous message). regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services