Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rDjPb-002wVM-RE for pgsql-bugs@arkaria.postgresql.org; Thu, 14 Dec 2023 10:57:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rDjPZ-006xX9-IA for pgsql-bugs@arkaria.postgresql.org; Thu, 14 Dec 2023 10:57:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rDjPZ-006xX1-9P for pgsql-bugs@lists.postgresql.org; Thu, 14 Dec 2023 10:57:49 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rDjPW-00ALbk-6n for pgsql-bugs@lists.postgresql.org; Thu, 14 Dec 2023 10:57:48 +0000 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3332efd75c9so6840722f8f.2 for ; Thu, 14 Dec 2023 02:57:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702551463; x=1703156263; darn=lists.postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=2/fOcYyqrINguWiD/Le6UE1To5JPOKmj9P54WtiwMII=; b=V5679LM5lxb+tWOkZzVgiOXaqogmrjvtzxRRi3JuFOzcjwAEOQ068n1iMLAuUWlaLp Wlf2mVOfP8YE9uoST5gP5QOZU0gwosHRPbOX8/WJ3gBM2j09PW8g/syZm6eex85M97j/ lHzZGTMmCIRuLCq8nldJLTKc9MSb4cQQ75zDRoR2AF2tR++OnUBq+RpAUZs/ly+KC8Fe BXsONyntwwBN8ll3r7GEEv2fLDUEDnJ7ue19hCbC30PTOopMl1i2wUPbT2g34tO5+VfS +TcwSoBDjKRW1fGJCM9zKBfjGLY85Y7IoNYAws+Zw9DMXo9V7xdahPbb4Tg0iiKCkjco lHBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702551463; x=1703156263; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2/fOcYyqrINguWiD/Le6UE1To5JPOKmj9P54WtiwMII=; b=YQBnBibnV9DIFwsndL+dlTGOPiP/bLjoIYqtGrg7VPK5Is4YfgEo+g9V9MPV07Q5AD zz087aJhAbIFwv8x0XBkYiDbBYecHhe70sBWMV4JmnDLGjqluwDtRgH7eiFJGZyBKtJL +cxwqaxcLRl9yqR5qLJ72ZokdOaII0dcWnXPGRSoa78wVT72Cg/a+roNBlbbDUIzNFGK jUY5feIsuuiz+PIpOsf/y+nihCveaEF7+Md4XbuCzhKaYATQOWUp9V6s2bzWN6uGtPxP AGF/jaLvXHFUKanEdYNMX2eKOudbGNsNt81y7ACNKMMm6XkYKo1SqJbTL+4hXKCehoD3 1xQg== X-Gm-Message-State: AOJu0YwZuGwQH+uDRXWmMmZAiQ6b80WVMtsvHjEEZCHniftfq0gzcCIR MYEXpNwNJmGBo5kQYDBtw8M= X-Google-Smtp-Source: AGHT+IFQurkY27VonIvay99LlYWfhdnI7GXbaXkDL/sgxB1yW27pslwQJQ4eRrkxhKBpSTjKY9ua+w== X-Received: by 2002:adf:edc4:0:b0:336:41f7:f979 with SMTP id v4-20020adfedc4000000b0033641f7f979mr565907wro.237.1702551463120; Thu, 14 Dec 2023 02:57:43 -0800 (PST) Received: from jrouhaud ([2a01:e0a:c:bcf0:9169:d12f:aadc:d32]) by smtp.gmail.com with ESMTPSA id w14-20020a5d608e000000b003333c2c313bsm15741150wrt.100.2023.12.14.02.57.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 02:57:42 -0800 (PST) Date: Thu, 14 Dec 2023 11:57:40 +0100 From: Julien Rouhaud To: Richard Guo Cc: rekgrpth@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18247: Integer overflow leads to negative width Message-ID: References: <18247-11ac477f02954422@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Dec 14, 2023 at 06:34:44PM +0800, Richard Guo wrote: > On Thu, Dec 14, 2023 at 5:29 PM PG Bug reporting form < > noreply@postgresql.org> wrote: > > > EXPLAIN SELECT * FROM t; > > QUERY PLAN > > ------------------------------------------------------------ > > Seq Scan on t (cost=0.00..10.00 rows=1 width=-2113929008) > > (1 row) > > > Interesting. In an Assert-enabled build this query will cause the > Assert failure in set_rel_width(). > > Assert(tuple_width >= 0); > > Can we just error out when an overflow occurs? I'm worried that it could have quite a broad impact, as the same problem could easily arise in some more conventional cases, e.g. after joining some already large relations. I'm sure that some people already hit that in production without looking at explain plans, and wouldn't be happy to see it broken during the next update.