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.96) (envelope-from ) id 1w2kTI-000Z0z-2W for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Mar 2026 06:33:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w2kTH-0081Oh-26 for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Mar 2026 06:33:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w2kTH-0081OZ-16 for pgsql-hackers@lists.postgresql.org; Wed, 18 Mar 2026 06:33:35 +0000 Received: from mail-yw1-x112c.google.com ([2607:f8b0:4864:20::112c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w2kTE-00000000stQ-1rnp for pgsql-hackers@postgresql.org; Wed, 18 Mar 2026 06:33:35 +0000 Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-79a7109f568so7276197b3.1 for ; Tue, 17 Mar 2026 23:33:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773815611; cv=none; d=google.com; s=arc-20240605; b=S1urJxfvFl+AeR3naklUvnxLl9sdXHYMQbQwyh8j/yuidyHSZduR/Z1d3BlTv5O+a5 LXGLdu2yC3bkeW2vPmFk2yPfaGm2J8TDX0zkfykKDGDRUUGXPhpzbf25g68w83cloJ0b O+APD6ry8jwzRmfpUnFoqqKg09NC/tiBavxOFHRKluTY4EgphLZowei4XsNbA9CUa4oJ bJNSnP6/ODy920RZY0W+bCe9UVvF7wZa4a3bAMVPug2V0iW2TXxoqdc8UjoR5T+myPE4 9KeKeKdvjRw1OmO6nyRbdAHH7UKofmNHDeH6PaTp/+oO6gFmAYSROprdtSnWL7aP3eUV VBEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=+6EbT6dUSY/upMAfxibLMaDpH/rkQpiSP5hlkezPVCo=; fh=xy1n9usNULSJQ3q8CeGeF9RNIaXWCtTdteVFpl4diyI=; b=IVLQhNT8K9PGpplXoJvX5a0wd1KyqUbigTWB6k/bjVzW52/OUko6xmqRkDmDmO8edS 8cmbWnNrZ/fuiwsvVzqQLn9REfID5QJUNvoVIHGy77E8sf4SSJ6Y5vyGmt0w8esernfN Gk2Sn1YnGVBBjMCsfMtUURm4rCZNcZxweONFJL2+OTjNu5a4I3/H6e4/JEUCl+WIR5tT EeWLsGuiu1JdlpzMweCtTbHiXX5vSbXE9pgsG60RZGso/WejNI66pO6j8yy0D90v/Gti 7xGk3hvKW56qVw4EABc/1eml/DJVXOP9rt9DocCko23a7LrnrzNOMnDWEibe8oePOFwe TIEw==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=percona.com; s=google; t=1773815611; x=1774420411; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+6EbT6dUSY/upMAfxibLMaDpH/rkQpiSP5hlkezPVCo=; b=aSmLucT0hDEbEUutrgCuF8fQfL6Uko9fUH1y22pqC75sO+rG1wWzkmnu1wq7hrTCYo A7UoPk3ZjybeCprkc3rqp2xy7EvbNgYeUrB7AzqQcGQetUWmUPYVJTtIUS9m10VF8IRB RZzgX5Bdn9iaBxL0WKMiIqcKOe4noeiItWOd0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773815611; x=1774420411; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+6EbT6dUSY/upMAfxibLMaDpH/rkQpiSP5hlkezPVCo=; b=d1l7bIhxkcvSO7daAsK1IOc9U0M+UYAzwapond0mA9dfG8l7hFzkyhKpVmcKh0RkbG bxPwnJgYEDGdNUf27KmnX3IYqeY1dngk9Y2mpfVyiist8BKnqNDC+GlB/2eXEGV5pQZM umz0TtWst3scakXYkS0fSoq9dGjsg/8lqIEci/EeCX762BeTGY5zP2ELwsDiv9RJDvUf nv8wlEoL7FKtwDKuuXo4+apJTYm6mUML6mm0VRU/O4oy0Qks0Flfaw/3APbrKmuMfa+J kjbYQ1D0s1tL81XMjFV81K3SMu7yqsxRAGfQdGspNkNvTYiTWnziVXHy4LIlEBCSq/uT e44A== X-Forwarded-Encrypted: i=1; AJvYcCXNZd7TbGCGlWAJXvaTZa7AhoXstbCMCj5e7e9Sw9MsXwvsKMfpOrTAjLN5zwYthjtkx4+GWuuxjTe4T14J@postgresql.org X-Gm-Message-State: AOJu0YwtbWGs/JtBPAMDwh9U8hbJ+SbN6rcr4KONFDBT1bxT05kG4VXq gKbfTphcPtoGqjSQ8Qy3GkRfxOUzprF0+OJCfu8KoOQySzFmt6O0dPr4UVWHxU54J8vhmROMX42 6QjZnhDQPDM102Fq0kG/LkFwzb4vqN6pO9bkudfuwrO732MOa2GvjLXFeYCHzbdDsBaJ2QFlRm+ vBWj1azUoz2v5A9tTwEHEZZJW4RGgBNW6U0tL7A40VQpVnopBLNfshkQxUAgM+W/q5vT94JRvXj PjJ/HFRYOgthcDbTisLonogVokkME9x7WPCS+hwFWaQTJ/Z3wg= X-Gm-Gg: ATEYQzygI21ss09zpzBJbZtbxwI8QsWI9e3U9QLODBC6G9Vou0Xb6+M0U6g24j5LIEb 11oaVjHNvKmtfu4PEBUqjzwLAQcQF1K6mM2JkrxTPwMR3M9Njj/TwHE7zY77DfcVwALh6UwMCDr 1RdK3CE/4PgwsdfcnEioEG+RjhTus4zTj4ClRnpV473qOsdHngF5rFe04ldl58T2R+v66nTl6QK G+ctpbfu6gaIMNgNeWhf8qZXuNhv20WxKByqhDsDZy2oqN7uRLXfIKkXijqJz7NKgY9S7AeNnO/ GnRTCV5W06U7aOKT4nON72sTCvza1DOHfDOvvkq9fMYTHhriVrZLsqicmv5U1yd/nkmD X-Received: by 2002:a05:690c:6c06:b0:79a:6d65:c34b with SMTP id 00721157ae682-79a71bdfeedmr21098107b3.32.1773815611281; Tue, 17 Mar 2026 23:33:31 -0700 (PDT) MIME-Version: 1.0 References: <70674869-2829-4b06-ab93-2f82ea51578c@iki.fi> In-Reply-To: From: Zsolt Parragi Date: Wed, 18 Mar 2026 06:33:21 +0000 X-Gm-Features: AaiRm51F7Pz9T631K0XwfIlXGel81L2Nw6LL1qpzJSyUI3G6OU52UuENhXY6CTo Message-ID: Subject: Re: Fix uninitialized xl_running_xacts padding To: Michael Paquier Cc: Bertrand Drouvot , Alexander Kuzmenkov , Heikki Linnakangas , Andres Freund , Anthonin Bonnefoy , Thomas Munro , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" X-CLOUD-SEC-AV-Sent: true X-CLOUD-SEC-AV-Info: percona,google_mail,monitor X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thank you for the feedback! > but the invasiveness and the footprint this involves in > the WAL insertion code paths makes it a no-go for me. Invasiveness is an option I choose, not a requirement. In an alternative version, this could work in a "less strict" mode, on top of Alexander's memset patch, verifying that: if we see a function that uses XLogRegisterData, and the variable passed to it is defined in the same function/translation unit (which is most of the case), we require that variable to be well initialized - either all fields have to be specified by hand, or it needs an initializer block/memset at the beginning -- or if it has compiler generated padding inside, it requires memset, as that's the only thing guaranteed to initialize it. Similarly instead of requiring explicit padding added to the end of the struct, it could instead verify that 1. the SizeOf macros are correctly defined, refer to the proper size 2. if a SizeOf macro is defined, the struct is properly memset at every location where it it used In that version, there would be little or no change over Alexander's previous patch, other than adding pg-tidy itself to the build. I can also create a version with that approach, it should be relatively simply as I won't have to modify the WAL structs/calls like in this version. > Valgrind has proved to be quite useful over the years. Sure, it takes > more time to run it, but for this specific issue I don't see why we > should not continue relying on it I'm not saying that we should rely on valgrind, it is a good tool and it possibly catches things this wouldn't. This would be an additional tool, offering the advantage of being quick and integrated into the build. (Valgrind is also integrated, but it is also slow, I don't think everyone runs it regularly as part of normal development)