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 1isBe6-0004zn-MA for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Jan 2020 20:21:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1isBe5-0007bj-2Z for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Jan 2020 20:21:37 +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 1isBe4-0007bc-PT for pgsql-hackers@lists.postgresql.org; Thu, 16 Jan 2020 20:21:36 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1isBdz-0008F9-PS for pgsql-hackers@postgresql.org; Thu, 16 Jan 2020 20:21:36 +0000 Received: by mail-wr1-x444.google.com with SMTP id q6so20414975wro.9 for ; Thu, 16 Jan 2020 12:21:31 -0800 (PST) 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; bh=DPmfcT7ry5bYXc2ttpHlhodUJrsH1O/buYNM4ivA7qs=; b=oIma/a+50OYNoqi7zMPiRcVrS161ZEU2ttaSnftXy1wsfZB638oedUhi6m7ZjEocwU +7nsqhc7e408J5CvNxlvgBalE7REcbg1ulrE+HekrVEQrJgbWUgp228XG0XddxJaq3t7 Vc7Sc5xhDHiC7cl77gNu421cv94C3nnP4tdVg6q19kUcTtUM0sWeKE3B1fwwacAw80VV Ie3914PUOCbIGkMDIzLo4ZKY06naodJf+4TojBRyeLOIgWZ7a1gkpgK04GNZ06r6wkpX aRKiG0mVLP67z+Ox7flerZIdzYzVB6WjmzAV8jf6jYHWY2p9BD5gFJqBHIQb8DoC9Eul Oouw== 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; bh=DPmfcT7ry5bYXc2ttpHlhodUJrsH1O/buYNM4ivA7qs=; b=P9RsffFNSzEl4pXR5BSZ3pJUH55WodE9stRLPQgMJGYPUeUXBHRuYrl8KD8is7oULC JED1DkVVk6Bz3xtryaqLnPx6W46D8dq7FEbM8ayoAAIKI7Qk7ETrO4gW0h2T/SvuntM1 4Wqf+OnKQ3c0eIastu4OPq+EQ//vkbhgiWkThl6rjaqTJyY9C5PBf52ID/EUAccRbJeK x+Rg5TNFHbJkZtR2VZNJ3PDIM9W0BXtbe/mUKrX2HBdBpfPcbKeuSyjsk1z+oK5g8kJH HUVmcqWLs27+XbyGkZlfShYujsRDpRzu8dfwJLJ8ewRnDd4cBYlg+jBsmv+Yja5ew09s pAvg== X-Gm-Message-State: APjAAAU9ruapLk9t+82ADfJXLw8X9rRwFWUM02iZCEHt95NLUrRwXgfJ +Pf/rewgkfshywTlLBrMfBNL+IR6vmQ= X-Google-Smtp-Source: APXvYqwlGJcYmjLXO4KZTO73QVV/EDW+GGiU7sYzGPYDEDigAeNmlL0t8eQ+7TGnzrP0eHNtjM4Qcw== X-Received: by 2002:a5d:4752:: with SMTP id o18mr5002413wrs.330.1579206090539; Thu, 16 Jan 2020 12:21:30 -0800 (PST) Received: from localhost (ip-86-49-253-92.net.upcbroadband.cz. [86.49.253.92]) by smtp.gmail.com with ESMTPSA id t12sm30535277wrs.96.2020.01.16.12.21.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jan 2020 12:21:29 -0800 (PST) Date: Thu, 16 Jan 2020 21:21:28 +0100 From: Tomas Vondra To: Tom Lane Cc: Andres Freund , Tomas Vondra , pgsql-hackers@postgresql.org Subject: Re: SlabCheck leaks memory into TopMemoryContext Message-ID: <20200116202128.m7b76msbd5d6asmi@development> References: <20200116061732.vvpyexenaortpu5y@alap3.anarazel.de> <27213.1579155900@sss.pgh.pa.us> <20200116064143.opcu2vhcktddpzbh@alap3.anarazel.de> <19743.1579188421@sss.pgh.pa.us> <20200116162500.pcgxmykirm677mt6@development> <20200116164849.75rzho6zn4qppnf3@alap3.anarazel.de> <20200116170153.qp36chsyhikvgvxt@development> <2646.1579195983@sss.pgh.pa.us> <20200116200038.rfqfnqsrjcdv5kwk@development> <15906.1579205741@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <15906.1579205741@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Jan 16, 2020 at 03:15:41PM -0500, Tom Lane wrote: >Tomas Vondra writes: >> I think the one possible argument against this approach might be that it >> adds a field to the struct, so if you have an extension using a Slab >> context, it'll break if you don't rebuild it. But that only matters if >> we want to backpatch it (which I think is not the plan) and with memory >> context checking enabled (which does not apply to regular packages). > >Huh? That struct is private in slab.c, no? Any outside code relying >on its contents deserves to break. > Ah, right. Silly me. >I do think we ought to back-patch this, given the horrible results >Andres showed. > OK. -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services