pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix bogus use of "long" in AllocSetCheck()
7+ messages / 1 participants
[nested] [flat]

* pgsql: Fix bogus use of "long" in AllocSetCheck()
@ 2025-10-30 01:48 David Rowley <drowley@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: David Rowley @ 2025-10-30 01:48 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix bogus use of "long" in AllocSetCheck()

Because long is 32-bit on 64-bit Windows, it isn't a good datatype to
store the difference between 2 pointers.  The under-sized type could
overflow and lead to scary warnings in MEMORY_CONTEXT_CHECKING builds,
such as:

WARNING:  problem in alloc set ExecutorState: bad single-chunk %p in block %p

However, the problem lies only in the code running the check, not from
an actual memory accounting bug.

Fix by using "Size" instead of "long".  This means using an unsigned
type rather than the previous signed type.  If the block's freeptr was
corrupted, we'd still catch that if the unsigned type wrapped.  Unsigned
allows us to avoid further needless complexities around comparing signed
and unsigned types.

Author: David Rowley <dgrowleyml@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Backpatch-through: 13
Discussion: https://postgr.es/m/CAApHDvo-RmiT4s33J=aC9C_-wPZjOXQ232V-EZFgKftSsNRi4w@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/50eb4e11815664bfcee883e92f4bf238ac23ec12

Modified Files
--------------
src/backend/utils/mmgr/aset.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix bogus use of "long" in AllocSetCheck()
@ 2025-10-30 01:49 David Rowley <drowley@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: David Rowley @ 2025-10-30 01:49 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix bogus use of "long" in AllocSetCheck()

Because long is 32-bit on 64-bit Windows, it isn't a good datatype to
store the difference between 2 pointers.  The under-sized type could
overflow and lead to scary warnings in MEMORY_CONTEXT_CHECKING builds,
such as:

WARNING:  problem in alloc set ExecutorState: bad single-chunk %p in block %p

However, the problem lies only in the code running the check, not from
an actual memory accounting bug.

Fix by using "Size" instead of "long".  This means using an unsigned
type rather than the previous signed type.  If the block's freeptr was
corrupted, we'd still catch that if the unsigned type wrapped.  Unsigned
allows us to avoid further needless complexities around comparing signed
and unsigned types.

Author: David Rowley <dgrowleyml@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Backpatch-through: 13
Discussion: https://postgr.es/m/CAApHDvo-RmiT4s33J=aC9C_-wPZjOXQ232V-EZFgKftSsNRi4w@mail.gmail.com

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/af3a79e0837d23fa536f859fc927b1379855ae24

Modified Files
--------------
src/backend/utils/mmgr/aset.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix bogus use of "long" in AllocSetCheck()
@ 2025-10-30 01:49 David Rowley <drowley@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: David Rowley @ 2025-10-30 01:49 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix bogus use of "long" in AllocSetCheck()

Because long is 32-bit on 64-bit Windows, it isn't a good datatype to
store the difference between 2 pointers.  The under-sized type could
overflow and lead to scary warnings in MEMORY_CONTEXT_CHECKING builds,
such as:

WARNING:  problem in alloc set ExecutorState: bad single-chunk %p in block %p

However, the problem lies only in the code running the check, not from
an actual memory accounting bug.

Fix by using "Size" instead of "long".  This means using an unsigned
type rather than the previous signed type.  If the block's freeptr was
corrupted, we'd still catch that if the unsigned type wrapped.  Unsigned
allows us to avoid further needless complexities around comparing signed
and unsigned types.

Author: David Rowley <dgrowleyml@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Backpatch-through: 13
Discussion: https://postgr.es/m/CAApHDvo-RmiT4s33J=aC9C_-wPZjOXQ232V-EZFgKftSsNRi4w@mail.gmail.com

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/bd6f986c9e0ed654bd517af3507a0eba723a0913

Modified Files
--------------
src/backend/utils/mmgr/aset.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix bogus use of "long" in AllocSetCheck()
@ 2025-10-30 01:50 David Rowley <drowley@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: David Rowley @ 2025-10-30 01:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix bogus use of "long" in AllocSetCheck()

Because long is 32-bit on 64-bit Windows, it isn't a good datatype to
store the difference between 2 pointers.  The under-sized type could
overflow and lead to scary warnings in MEMORY_CONTEXT_CHECKING builds,
such as:

WARNING:  problem in alloc set ExecutorState: bad single-chunk %p in block %p

However, the problem lies only in the code running the check, not from
an actual memory accounting bug.

Fix by using "Size" instead of "long".  This means using an unsigned
type rather than the previous signed type.  If the block's freeptr was
corrupted, we'd still catch that if the unsigned type wrapped.  Unsigned
allows us to avoid further needless complexities around comparing signed
and unsigned types.

Author: David Rowley <dgrowleyml@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Backpatch-through: 13
Discussion: https://postgr.es/m/CAApHDvo-RmiT4s33J=aC9C_-wPZjOXQ232V-EZFgKftSsNRi4w@mail.gmail.com

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/cdc04a6c339972a4c64b0978bf596f18ebdcff74

Modified Files
--------------
src/backend/utils/mmgr/aset.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix bogus use of "long" in AllocSetCheck()
@ 2025-10-30 01:50 David Rowley <drowley@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: David Rowley @ 2025-10-30 01:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix bogus use of "long" in AllocSetCheck()

Because long is 32-bit on 64-bit Windows, it isn't a good datatype to
store the difference between 2 pointers.  The under-sized type could
overflow and lead to scary warnings in MEMORY_CONTEXT_CHECKING builds,
such as:

WARNING:  problem in alloc set ExecutorState: bad single-chunk %p in block %p

However, the problem lies only in the code running the check, not from
an actual memory accounting bug.

Fix by using "Size" instead of "long".  This means using an unsigned
type rather than the previous signed type.  If the block's freeptr was
corrupted, we'd still catch that if the unsigned type wrapped.  Unsigned
allows us to avoid further needless complexities around comparing signed
and unsigned types.

Author: David Rowley <dgrowleyml@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Backpatch-through: 13
Discussion: https://postgr.es/m/CAApHDvo-RmiT4s33J=aC9C_-wPZjOXQ232V-EZFgKftSsNRi4w@mail.gmail.com

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f3420e006ec08a6466b9d5fd3f6797f04c4ad709

Modified Files
--------------
src/backend/utils/mmgr/aset.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix bogus use of "long" in AllocSetCheck()
@ 2025-10-30 01:51 David Rowley <drowley@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: David Rowley @ 2025-10-30 01:51 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix bogus use of "long" in AllocSetCheck()

Because long is 32-bit on 64-bit Windows, it isn't a good datatype to
store the difference between 2 pointers.  The under-sized type could
overflow and lead to scary warnings in MEMORY_CONTEXT_CHECKING builds,
such as:

WARNING:  problem in alloc set ExecutorState: bad single-chunk %p in block %p

However, the problem lies only in the code running the check, not from
an actual memory accounting bug.

Fix by using "Size" instead of "long".  This means using an unsigned
type rather than the previous signed type.  If the block's freeptr was
corrupted, we'd still catch that if the unsigned type wrapped.  Unsigned
allows us to avoid further needless complexities around comparing signed
and unsigned types.

Author: David Rowley <dgrowleyml@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Backpatch-through: 13
Discussion: https://postgr.es/m/CAApHDvo-RmiT4s33J=aC9C_-wPZjOXQ232V-EZFgKftSsNRi4w@mail.gmail.com

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/86bd9497f87ddcddc1533903cfdd624d7a3d61f1

Modified Files
--------------
src/backend/utils/mmgr/aset.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix bogus use of "long" in AllocSetCheck()
@ 2025-10-30 01:51 David Rowley <drowley@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: David Rowley @ 2025-10-30 01:51 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix bogus use of "long" in AllocSetCheck()

Because long is 32-bit on 64-bit Windows, it isn't a good datatype to
store the difference between 2 pointers.  The under-sized type could
overflow and lead to scary warnings in MEMORY_CONTEXT_CHECKING builds,
such as:

WARNING:  problem in alloc set ExecutorState: bad single-chunk %p in block %p

However, the problem lies only in the code running the check, not from
an actual memory accounting bug.

Fix by using "Size" instead of "long".  This means using an unsigned
type rather than the previous signed type.  If the block's freeptr was
corrupted, we'd still catch that if the unsigned type wrapped.  Unsigned
allows us to avoid further needless complexities around comparing signed
and unsigned types.

Author: David Rowley <dgrowleyml@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Backpatch-through: 13
Discussion: https://postgr.es/m/CAApHDvo-RmiT4s33J=aC9C_-wPZjOXQ232V-EZFgKftSsNRi4w@mail.gmail.com

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7b955c2279f4b485f328a95bf60a3cdf048b6e2d

Modified Files
--------------
src/backend/utils/mmgr/aset.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2025-10-30 01:51 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-10-30 01:48 pgsql: Fix bogus use of "long" in AllocSetCheck() David Rowley <drowley@postgresql.org>
2025-10-30 01:49 pgsql: Fix bogus use of "long" in AllocSetCheck() David Rowley <drowley@postgresql.org>
2025-10-30 01:49 pgsql: Fix bogus use of "long" in AllocSetCheck() David Rowley <drowley@postgresql.org>
2025-10-30 01:50 pgsql: Fix bogus use of "long" in AllocSetCheck() David Rowley <drowley@postgresql.org>
2025-10-30 01:50 pgsql: Fix bogus use of "long" in AllocSetCheck() David Rowley <drowley@postgresql.org>
2025-10-30 01:51 pgsql: Fix bogus use of "long" in AllocSetCheck() David Rowley <drowley@postgresql.org>
2025-10-30 01:51 pgsql: Fix bogus use of "long" in AllocSetCheck() David Rowley <drowley@postgresql.org>

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