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 1tUoIv-002vzy-Rr for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jan 2025 14:42:06 +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 1tUoIt-009MYr-Tf for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jan 2025 14:42:03 +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 1tUoIs-009MWC-GR for pgsql-hackers@lists.postgresql.org; Mon, 06 Jan 2025 14:42:03 +0000 Received: from fout-a8-smtp.messagingengine.com ([103.168.172.151]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tUoIo-000AJb-1Q for pgsql-hackers@lists.postgresql.org; Mon, 06 Jan 2025 14:42:00 +0000 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfout.phl.internal (Postfix) with ESMTP id 2C0C813801E7; Mon, 6 Jan 2025 09:41:57 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Mon, 06 Jan 2025 09:41:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1736174517; x=1736260917; bh=gnXcG/yE38bGis+Pdu9af5INMhK+gJZOFIYlHSLjkek=; b= ndUA5x+x9avFzTwiloHaZPpq3FCVDKXIL0FIsHeojhVAafF8vn9/TUfFk9XgkbdA y+zShQPsOYpJ4MWxOJth5iFNBV4lI+SbXJar3RqbCY6PqQItkXyMMDu9qypfB8BO 7kZW1hKYuODr7ZPpZ+B8JOUkyXeEYTjO5PKFNTkahA6u0if2C4nSVoPugkSXnWE5 yTvl0zWZS5aZ29KYwL463J5PjykS2ZbF8K2GiihgFw6SKsvwkFXL2OoEGw97RZAK fGh0CFs+X5kKy5khWfCDq7T+QykZcoHjooMloQ8y/fIGINkgnqx0rzLbBEIB9Hom yj8iiGCZP3oWgP9y+RRpRA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1736174517; x=1736260917; bh=g nXcG/yE38bGis+Pdu9af5INMhK+gJZOFIYlHSLjkek=; b=H+j6EwbLB5UJuBEY3 q72V46ZtR/LKBf1sJkx/nAu7DF3dfh5VX8/dOh0bGFPCxzxtdilSicPnlgcqaibV I02DLy+7TUHbZiy4lXqmplMzEOJ1ymIHqjwWzvTAMFofaahW8AOPFzHUHMZhNXTg 0tcuFGloSSZkBEp/PT/3VJGUdzuNg8LSO8BdHKiSLajUcFMnHCSdo4mdNHk2ayyI 5uKdJmzsR7r9oRql7UVfp2WMVEwVyvb7ecFRfrS1RdcrJAEe1Of1auISpjMPhR7g eqbZ1ryX8vq5yCW/5uPe7imy/1vxbJo9nQw55Al9/gAXdYSyubj2QDFAFQdbrDvO 9+FSg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudegtddgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvfhfhjggtgfesthejredttddvjeen ucfhrhhomheprfgvthgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhesvghishgvnh htrhgruhhtrdhorhhgqeenucggtffrrghtthgvrhhnpeegueeuvdfhheeuieejtefguddt hfevveefuefgtddvgfetteehjeetleeuvdevudenucffohhmrghinhepphhoshhtghhrvg hsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomhepphgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhgpdhnsggprhgtphhtthhope dvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehkuhhrohgurgdrhhgrhigrthho sehfuhhjihhtshhurdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslh hishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 6 Jan 2025 09:41:56 -0500 (EST) Message-ID: Date: Mon, 6 Jan 2025 15:41:54 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: initdb -c "track_commit_timestamp=on" crashes in case of debug build To: "Hayato Kuroda (Fujitsu)" , "'pgsql-hackers@lists.postgresql.org'" References: Content-Language: en-US From: Peter Eisentraut In-Reply-To: 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 On 06.01.25 14:14, Hayato Kuroda (Fujitsu) wrote: > While working on another thread I found $subject. I've tested only on master, > but I doubt this could happen even on PG16 and 17. You can reproduce by: > ``` > $ initdb -D data -c "track_commit_timestamp=on" > ... > child process was terminated by signal 6: Aborted > initdb: removing data directory "data" > ``` > > Back-trace I got is shown in [1]. > > IIUC the crash was caused at TransactionIdSetCommitTs(), and the primal reason was that > commit_ts module tried to store the bootstrap transaction. > > In the first place I'm not sure we want to fix this because this happens only for > the debug mode... but if needed, the easiest way is not to activate the commit_ts > in the bootstrap mode. I think this fix is enough because pg_last_committed_xact() > and TransactionIdGetCommitTsData() won't seek the un-normal xid. > Attached patch was created based on the idea. Yes, this was previously reported [0] but nothing was done about it. We just need to find some place to "do nothing" in bootstrap mode to avoid the crash. Your patch seems ok to me for that. [0]: https://www.postgresql.org/message-id/8a8fda29-5a68-ba68-a2ff-8d17602b3762@enterprisedb.com