From: Tom Lane <tgl@sss.pgh.pa.us>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Cc: Maxim Orlov <orlovmg@gmail.com>
Cc: Alexander Korotkov <aekorotkov@gmail.com>
Cc: wenhui qiu <qiuwenhuifx@gmail.com>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: POC: make mxidoff 64 bits
Date: Sun, 14 Dec 2025 17:55:36 -0500
Message-ID: <1827755.1765752936@sss.pgh.pa.us> (raw)
In-Reply-To: <2d9282d3-7f24-4e1c-af5f-cd33316dead7@iki.fi>
References: <202512110804.hmukvd7jna34@alvherre.pgsql>
<2d9282d3-7f24-4e1c-af5f-cd33316dead7@iki.fi>
Heikki Linnakangas <hlinnaka@iki.fi> writes:
> Ok, I have pushed this. Thanks!
Coverity is unhappy about this bit:
/srv/coverity/git/pgsql-git/postgresql/src/bin/pg_upgrade/multixact_read_v18.c: 282 in GetOldMultiXactIdSingleMember()
276 if (!TransactionIdIsValid(*xactptr))
277 {
278 /*
279 * Corner case 2: we are looking at unused slot zero
280 */
281 if (offset == 0)
>>> CID 1676077: Control flow issues (DEADCODE)
>>> Execution cannot reach this statement: "continue;".
282 continue;
283
284 /*
285 * Otherwise this is an invalid entry that should not be
It sees the earlier test for offset == 0, and evidently is assuming
that the loop's "offset++" will not wrap around. Now I think that
the point of this check is exactly that "offset++" could have wrapped
around, but the commentary is not so clear that I'm certain this is a
false positive. If that is the intention, what do you think of
rephrasing this comment as "we have wrapped around to unused slot
zero"?
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, hlinnaka@iki.fi, alvherre@alvh.no-ip.org, ashutosh.bapat.oss@gmail.com, orlovmg@gmail.com, aekorotkov@gmail.com, qiuwenhuifx@gmail.com, pgsql-hackers@lists.postgresql.org
Subject: Re: POC: make mxidoff 64 bits
In-Reply-To: <1827755.1765752936@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox