Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJN51-0004C7-7K for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Nov 2017 17:20:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJN50-0008QR-Nl for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Nov 2017 17:20:26 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eJN50-0008Q7-E3 for pgsql-hackers@lists.postgresql.org; Mon, 27 Nov 2017 17:20:26 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eJN4t-0004K7-4c for pgsql-hackers@postgresql.org; Mon, 27 Nov 2017 17:20:24 +0000 Received: by mail-wm0-x243.google.com with SMTP id v186so36460273wma.2 for ; Mon, 27 Nov 2017 09:20:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=XoJ3/0WNjOZANo7RyoVUJvR/WxGMTEIThWbiKeOQGvI=; b=TjFem0iM49kQTxzwyb542WCrGePbFEhHyFVbARfRdYVcSciBji++zJRDWrKegNbdPr vYsH9Q5F3GW2dw6Dri3M2Pja6KOPCI+j6UO0TkI5ckJ0ZkHDFEfWcrqfajJvxwQ0Rt8l mSI92+5JiVa02T6xozWKE9x/7THx9Wlik3s/cn72pB7bGTRt5EfkGS4G7BldqT+byJFD QTSZD76b9+HXBzBtCfoR+a65zm1oJ6PL1uxCJosKeMp59u+h1DIUosKX3a6JfL4AWR1y GV5N1ts3QAPkaidfOGA6GNgvRpLKFW4pm7JDMpG1bitmLelEeuWxAwBCnSLK9FcIJysS lEgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=XoJ3/0WNjOZANo7RyoVUJvR/WxGMTEIThWbiKeOQGvI=; b=Pcty7fWtDFdNuq4N85WQtMVlIpbiN8CD6oMCM9aguXUhv6AjqhCbOiRa+T5YFl5M0U QLj7+rdcW4WQ0D3aWjJ6Mui7rytbQgyjdfZE4j4R7nRG/zYkwn69WDq7MnahklFx2trV 26LjbAcULRIydMIm0TdkWonHoiNgwTtqzmAvvzl2tArOdo4zWxQvIT6aPJE78nvszLxO UkUo7ojIMkZLnTBMBDD+TslZUBDL3heGvSAGZOqnxE0vymCYSHlBFVvwbN4XJqioNES4 g07Ct8fRPKb/gtE2gg1PlFpMZTuzfJ4N9Uhv71Rw0YDSkIbESKnSv8YhvRl+KKbvQqA9 FWqw== X-Gm-Message-State: AJaThX4gFblHxIgbh7CSUTdlGwikimzP7/tGtkGadwSaCPK1s4yWnPE/ ZWQvPhbiF7Qm7BKXjrA3dykvoQ8F X-Google-Smtp-Source: AGs4zMZIEAG+4n5v5sRwSgA1gChlbqzcmgbQzTlFKMowa/lBWkUJBF8McOaKhltg6jPKO8FkZ7LkZg== X-Received: by 10.28.6.6 with SMTP id 6mr13207232wmg.114.1511803215930; Mon, 27 Nov 2017 09:20:15 -0800 (PST) Received: from [10.137.2.19] (ip-78-102-97-226.net.upcbroadband.cz. [78.102.97.226]) by smtp.gmail.com with ESMTPSA id l1sm5575708wmh.42.2017.11.27.09.20.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Nov 2017 09:20:14 -0800 (PST) Subject: Re: [HACKERS] Custom compression methods To: Ildus Kurbangaliev Cc: pgsql-hackers@postgresql.org, Ildar Musin References: <20170907194236.4cefce96@wp.localdomain> <20170912175505.4afa11fd@wp.localdomain> <20171102152836.60c041e4@wp.localdomain> <20171114162356.52e3d388@wp.localdomain> <62e46a47-08a8-6e06-5e4f-6f52e0a13202@2ndquadrant.com> <20171121174717.69ecd8f4@wp.localdomain> <20171123123849.5a686d7b@wp.localdomain> <57daf28d-ed76-c364-a9ca-65d0ff71a36f@2ndquadrant.com> <20171124123800.034c9208@wp.localdomain> <20171127185218.5cddad41@wp.localdomain> From: Tomas Vondra Message-ID: <0158242e-af45-c0f0-4fbb-4d54ca219cfd@2ndquadrant.com> Date: Mon, 27 Nov 2017 18:20:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171127185218.5cddad41@wp.localdomain> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 11/27/2017 04:52 PM, Ildus Kurbangaliev wrote: > ... > > Hi. This looks like a serious bug, but I couldn't reproduce it yet. > Did you upgrade some old database or this bug happened after > insertion of all data to new database? I tried using your 'archie' > tool to download mailing lists and insert them to database, but > couldn't catch any errors. > I can trigger it pretty reliably with these steps: git checkout f65d21b258085bdc8ef2cc282ab1ff12da9c595c patch -p1 < ~/custom_compression_methods_v6.patch ./configure --enable-debug --enable-cassert \ CFLAGS="-fno-omit-frame-pointer -O0 -DRANDOMIZE_ALLOCATED_MEMORY" \ --prefix=/home/postgres/pg-compress make -s clean && make -s -j4 install cd contrib/ make -s clean && make -s -j4 install export PATH=/home/postgres/pg-compress/bin:$PATH pg_ctl -D /mnt/raid/pg-compress init pg_ctl -D /mnt/raid/pg-compress -l compress.log start createdb archie cd ~/archie/sql/ psql archie < create.sql ~/archie/bin/load.py --workers 4 --db archie */* > load.log 2>&1 I guess the trick might be -DRANDOMIZE_ALLOCATED_MEMORY (I first tried without it, and it seemed working fine). If that's the case, I bet there is a palloc that should have been palloc0, or something like that. If you still can't reproduce that, I may give you access to this machine so that you can debug it there. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services