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 1h9w7E-0006MP-II for pgsql-committers@arkaria.postgresql.org; Fri, 29 Mar 2019 18:20:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h9w7C-0002HK-S5 for pgsql-committers@arkaria.postgresql.org; Fri, 29 Mar 2019 18:20:30 +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 1h9w7C-0002HC-Ld for pgsql-committers@lists.postgresql.org; Fri, 29 Mar 2019 18:20:30 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h9w79-0006W1-I5 for pgsql-committers@lists.postgresql.org; Fri, 29 Mar 2019 18:20:30 +0000 Received: by mail-wr1-x443.google.com with SMTP id r4so3708946wrq.8 for ; Fri, 29 Mar 2019 11:20:27 -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=aIuKrEwqDEtOrm/7iE1b3neQnGxWOngcS9O1RtAorxM=; b=fUcDtgeJLv27BXf3Y53AcFV7Ko/NhU0c+xPtLUwp3IBeRc6wZrCdLCLqXOYSg1MGym rcZtjT0Fztlgq8Q9Acyl4Y5wcjwp6bXUv8j5KVkbefeJ0jDm4vZ2IhAYWo63JRbrAA/x WdHHdhEUg02rE0AP+ly4g1nWtroUMHM8btYLnZrNXIKegWbjUZPoNfQ6kPSHIB02ElxZ nQ97M7jALheJWieX7tqGRqPuTOOTaDoJmgo2Hsf0wVk8Ce13vcQAZ7kYrUqgIPGk5TrL vPU8vcjhWEY/pLsZqp0FZWEQ8/i6Vwt3J59gRVlFGFPN+3oJ02vjb3vxBfaXwBw/fppz lhag== 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=aIuKrEwqDEtOrm/7iE1b3neQnGxWOngcS9O1RtAorxM=; b=SZRJtlqUKNX8myfGbxItQLWM5hgrVGiWZ+PKCbCq4NpkHUzukPujIXXo1URQOq1wGv xcFLaP7Ozk2IuyFDaHXIGAlb9nuA3bjUHKGrcbTVWYADnxP06cFwbX53sZFXJeR8fXrC Vbvyr9qBaXfk4KVELWmy8usTltg+4dIUCApUZN0gdVmVg2X3K7q0drFOBJWwKUIxSvMf DZM2C3mPPBoNhgDDkhE1F75CkY01t87EXjgHkXF8+ZRwZJKZkuUXuMhSR0cZl0bYzEWP 5x/4G5IlPBdCTpLc/qasP8AnygM0QGDsx5d3Eqg7UgfezXKj/v+4d7N+wU9tpH5n5P3A MpYw== X-Gm-Message-State: APjAAAXO1p4X0GpMOB5Efi9d/uvipztTLhqS34NXlSxh16T34CR+Q4Mt oz5VlAqsSuufxgBI8RnGgbCz1w== X-Google-Smtp-Source: APXvYqxKcAOpwxkSCWOvLjZXoy+4uE5H3OaeufJXSADjkXACkExM8T8MIaje0WfsK7J9L8hk2xHvpw== X-Received: by 2002:adf:ea43:: with SMTP id j3mr30593617wrn.210.1553883625616; Fri, 29 Mar 2019 11:20:25 -0700 (PDT) Received: from localhost (static-84-42-175-93.net.upcbroadband.cz. [84.42.175.93]) by smtp.gmail.com with ESMTPSA id y9sm4751296wrn.18.2019.03.29.11.20.14 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 29 Mar 2019 11:20:14 -0700 (PDT) Date: Fri, 29 Mar 2019 19:20:13 +0100 From: Tomas Vondra To: Peter Geoghegan Cc: Andres Freund , Tomas Vondra , pgsql-committers Subject: Re: pgsql: Add support for multivariate MCV lists Message-ID: <20190329182013.GB8733@development> References: <20190327190406.3gmupkthnbx7lvho@alap3.anarazel.de> <20190327201346.GB21957@development> <20190327203353.GC21957@development> <20190328012752.GD4406@development> <20190328183336.GB16397@development> <20190328193711.GC16397@development> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20190328193711.GC16397@development> User-Agent: Mutt/1.11.3 (2019-02-01) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Mar 28, 2019 at 08:37:11PM +0100, Tomas Vondra wrote: >On Thu, Mar 28, 2019 at 07:33:36PM +0100, Tomas Vondra wrote: >>On Thu, Mar 28, 2019 at 11:29:12AM -0700, Peter Geoghegan wrote: >>>On Wed, Mar 27, 2019 at 6:27 PM Tomas Vondra >>> wrote: >>>>It's a bit too late for pushing emergency fixes over here, so I'll do >>>>more testing tomorrow and then push. >>> >>>The buildfarm is still almost all-red now. Can you estimate how long >>>it will take to push a fix? >>> >> >>Half an hour, at most. I have a fix and I'm running tests on it to make >>sure it does break something else. >> > >OK, I've pushed the fix. As explained in the commit message, the >deserialization was borked in two ways. Firstly, it was vulnerable to >use-after-free. Secondly, the serialization/deserialization of data for >by-value types did not work for bigendian systems. > >I believe this should fix prion (which was tripping on the first issue, >due to using -DRELCACHE_FORCE_RELEASE -DCATCACHE_FORCE_RELEASE) and at >least some of the bigendian boxes (I've tested it on s390x). > OK, this apparently worked fine for all x86 and s390 machines. > >I do think there's one remaining issue - the deserialized value is >allocated as a single chunk, and is then "sliced" into smaller buffers. >But the code ignores alignment, which I think may trigger SIGBUS on some >platforms - for example grison, skate or gull fail like this, and those >are ARMv7 and sparc machines. > >I do have a fix for that too, but I decided not to push it yet before >testing it a bit more. > I've pushed a fix for this. The short version is that the serialized representation was not respecting memory alignment requirements, which was causing issues in machines sensitive to this (ia64, sparc, hppa). It's a blind attempt, as I currently don't have access to any such machine. FWIW I've pushed this now so that the machines can test the other stuff, like jsonpath. I think the serialization/deserialization would deserve a second look, and I'm wondering if it should work more like ArrayType (i.e. relying on att_align_* instead of explicit MAXALIGN). regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services