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 1uvf9E-00Gy96-Qr for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Sep 2025 16:55:21 +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 1uvf9D-006HK6-HE for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Sep 2025 16:55:19 +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 1uvf9D-006HJy-7Y for pgsql-hackers@lists.postgresql.org; Mon, 08 Sep 2025 16:55:19 +0000 Received: from mail-il1-x12b.google.com ([2607:f8b0:4864:20::12b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uvf9B-001Buj-2A for pgsql-hackers@postgresql.org; Mon, 08 Sep 2025 16:55:18 +0000 Received: by mail-il1-x12b.google.com with SMTP id e9e14a558f8ab-40e925deaa1so1564875ab.1 for ; Mon, 08 Sep 2025 09:55:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757350517; x=1757955317; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=nf9hXTZoaHfPDQ3ppLafkdLVSlbxtUPfQwpFSdoUWBE=; b=i27FR4fd3ZSN7PT8Vz0BXXYCb1agVAAPT0GnRlENmBd03Fjhig+g9jJJmOta7eS9pi 2tTOGYqIt+i2a0rLyvK6iHrBUmgu9eQMpZVbjKn4tg3NSVzfTgRDe90+cRxRP1vM8dBa 75dGmSr2d7+mvVmunftahSdchhvipOn66yUHv3GCxwRfpnnLMpJjoUBEf7gsBcLcyEH1 CfLv+IXRKexJLaSu5hJ/bM2FqDSKHBBqVWxpFRjckerWCsJYueXIn7rKDASogcPExAg6 nvGCCcFlcVT5FKqBTNG2qZYUXxXGxggO/7MmttuICiZkHt2GxsOcyRggjF4Zy40k9KUn 8i3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757350517; x=1757955317; h=in-reply-to: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=nf9hXTZoaHfPDQ3ppLafkdLVSlbxtUPfQwpFSdoUWBE=; b=aMsNl4wnMI22D62Y5QukTn7b2Fvxa2Zv1ujRfx/rHIZXds358f3QmT+BaY2vcTsBkn rOwDA5aWYIanMM/zgCnB86z8womDxKXuTI1mRHj6xuJjY3VoyOP6+3PwY2icTuun1NO/ c79jOzJmS+b4wYl/1qEsCiYMxuDeyXBiSam8mJL+LJ7GedlcQ1hW2CYvRUKcy5FB90ev VAVhBT+7rKZEBzx0YNsbCEGNglXQf38+rFpf/v+yj7TXLRGrf2goWubW28Z/ADCj64Og g87zwXM4fwPp1zaYwj0VnJxRHUEIudtjXrbIqWhKIbuINH07soT4Lczj5YxRyOf/ILSt 0lIA== X-Gm-Message-State: AOJu0Yz/jxNtMkjGAwKOXg5jRqCnTEijCMXGrv+8EFKc/sD5b3tWxwTu FOxWDossxYThKTUAXkWHgIOhPXRw/KMlOndOoK5FScWlx+AU4HG+KnBgwlzYBQ== X-Gm-Gg: ASbGnctCS3xu3fyjsl2kcnzYBzqvq1+eAfjZNFmYwyejDyOx2VWldO7pqzxhYOKTreB TusmPNm4b5ZEf0tssF1edD4qd4aNDiNcYDkN8W9J8AikEYkeCXWG180KT8YPZS2ln/nZSqOWuPE PQzqYfxNlqBlGld566KaMtu20xNIGlpPe+/S0hGh8oXTy0SWdoK5QMpDgHPKAaPX0LB/i1tgsvd 7R3Cn/3JTh2EcanTf4UX9vgvwlNcD3yalsHYD60StZE/K5+llZKzoqnmszcXYWMsO5CD3FImTgz XAnjYqvQ1ggfopGhDTLcXNcNdrD0oaWeULx3NZfVOOeftVZy8DVz6EJrFr7oE/GEtwJ+lgCmdNx 21jkc76Z8a+G4F5jsw9PQHjlyJqP8GbWEWTjZowkNjSdT78SbZ2p7DmSaoR3SWukKOm8d8gb3hd q3BUBQhrnsoqXN X-Google-Smtp-Source: AGHT+IH3pTtqrn3tXPB9iAFiy0oryZWInGY+JUw0PeYKzU+fjzba8GtqvcUQcy72Mf+N9JqiJQ3NKg== X-Received: by 2002:a05:6e02:1b06:b0:3ee:a3ff:96c7 with SMTP id e9e14a558f8ab-3fd881150cdmr120458085ab.17.1757350516503; Mon, 08 Sep 2025 09:55:16 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-510304bcb51sm5871816173.83.2025.09.08.09.55.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Sep 2025 09:55:15 -0700 (PDT) Date: Mon, 8 Sep 2025 11:55:14 -0500 From: Nathan Bossart To: Sami Imseih Cc: pgsql-hackers Subject: Re: GetNamedLWLockTranche crashes on Windows in normal backend Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Sep 04, 2025 at 08:35:13PM -0500, Nathan Bossart wrote: > On Thu, Sep 04, 2025 at 04:12:09PM -0500, Sami Imseih wrote: >>> Yeah, I think modeling this after commit 4f2400c is a reasonable thing to >>> explore. >> >> Here it is as described above. > > Thanks. This looks like the right idea to me, but let's give some time for > others to comment. I've started preparing this for commit, and I realized that restricting GetNamedLWLockTranche() to shmem_startup_hook is not sufficient. EXEC_BACKEND builds will run this hook in every backend, so unless it's guarded behind some sort of "if (!found)" condition (i.e., only run in the postmaster), it'll still crash. I think we just need to add some extra notes to the docs and check for !IsUnderPostmaster, as discussed upthread. -- nathan