Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qDeKj-0004y8-SW for pgsql-bugs@arkaria.postgresql.org; Mon, 26 Jun 2023 05:00:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qDeKi-0007Bl-KO for pgsql-bugs@arkaria.postgresql.org; Mon, 26 Jun 2023 05:00:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qDeKi-0007Bb-Bm for pgsql-bugs@lists.postgresql.org; Mon, 26 Jun 2023 05:00:12 +0000 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qDeKc-000U2h-2s for pgsql-bugs@lists.postgresql.org; Mon, 26 Jun 2023 05:00:11 +0000 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4f86dbce369so3496823e87.0 for ; Sun, 25 Jun 2023 22:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687755603; x=1690347603; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=oBZiq+7qIZJlnQvhepJKYJLFHj9OIeqOhHBiIrISPYY=; b=TerZsOTiArYNqvtjgl5MrVWqrBRV/pQwGmyPErVZdA2R+JQ85xyW17+zFXjDrTFJ5A 11NZGIFLwoAzHviEcf6PihxBuxNVYcdTsotaWIyvQaeta6dv1EkAEHwFdLAMr9TZ10RL 6udrfIN2Tvor9yhqMM9fMJXQ6YUeei/Kr2sHVH0JWk1EsfNBf53rO3+bFLOzDNhhZSLV txaJJFyYMpr9KNBPuBlZKQW6JYSyW3nsyGlNi1YkcsK1v4/CtgdWMLyKf3R6c/7a9nri dXWGUSlfczFA0QkXqaxPwRWHNX7mPplaBTIURd931Q8l0f0o1yux5tumT+yC48oe1LuJ lEuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687755603; x=1690347603; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oBZiq+7qIZJlnQvhepJKYJLFHj9OIeqOhHBiIrISPYY=; b=ircC6NnzgMl5HlwG/bv3wSEUj1qaJ/ldQ/9f2itKfCdQJV28hpN0aAZNhtdEQRzPeA wXJHutVMLTmueH7lp02B/Yfwl2UjJY/kpWf3uUMo1FsU2yyCQ+rhW3z2NRE1HPjhM3qN eNBBLun5Fq+35rb27o2d8EYDiznEd6dIbySF+QnwttM3A5+BeXH19CeXgLuWmBcF7z9a x6dih0yh6BaG75HSj/q8W4xxt84S94xKT37okhB7qpigpvpE77r2mE5TD9GjBQbjJ6lm UTAj/AjCJNtNhraO7edjZsmsKbIy94CvMRyARQi5y5w3F5K0q3qdQfzLckdldAEknal8 86MA== X-Gm-Message-State: AC+VfDxz70YNYEz3SWmezObSACu3quzITgwyHYefOQjP0pxJ0pUnHt0E fK8PNQeXO3SRUOSZvhXnvVY= X-Google-Smtp-Source: ACHHUZ6eT99QnAfh/nFGi+3bEY9FTeC5UXg9NiVnJwCHeShSUTzB6Yx+qyrLxg8L9IidtIgroLv4pQ== X-Received: by 2002:ac2:5b83:0:b0:4f8:75af:e917 with SMTP id o3-20020ac25b83000000b004f875afe917mr11162922lfn.41.1687755603052; Sun, 25 Jun 2023 22:00:03 -0700 (PDT) Received: from [1.0.0.7] ([178.155.23.108]) by smtp.gmail.com with ESMTPSA id l17-20020a19c211000000b004f86d3e52c0sm737754lfc.4.2023.06.25.22.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 25 Jun 2023 22:00:02 -0700 (PDT) Message-ID: <916440ee-5c84-abce-e2c8-562dc5775404@gmail.com> Date: Mon, 26 Jun 2023 08:00:01 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: BUG #17995: Segmentation fault caused by UPDATE statement Content-Language: en-US To: Tom Lane , Michael Paquier Cc: zuming.jiang@inf.ethz.ch, pgsql-bugs@lists.postgresql.org, kyzevan23@mail.ru References: <17995-9f20ff3e6389db4c@postgresql.org> <285547.1687636319@sss.pgh.pa.us> <68148dac-a574-f421-2905-51ebde2fe000@gmail.com> <636983.1687753628@sss.pgh.pa.us> From: Alexander Lakhin In-Reply-To: <636983.1687753628@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 26.06.2023 07:27, Tom Lane wrote: > I hadn't looked at the patch yet, but ... mcxt.c? How is that recursive? > Even if there is some path that recurses through that, wouldn't the > check be better placed in a less-hot part of the loop? In that thread Egor Chindyaskin showed proofs for stack overflow in all the functions, that the fixes were proposed for. For example: #MemoryContextStatsInternal (n=1000000; printf "BEGIN;"; for ((i=1;i<=$n;i++)); do printf "SAVEPOINT s$i;"; done; printf "SELECT pg_log_backend_memory_contexts(pg_backend_pid())") | psql >/dev/null Though maybe for some of those functions less-hot places could be found to check the stack. Best regards, Alexander