Re: Avoid a possible overflow (src/backend/utils/sort/logtape.c) - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Avoid a possible overflow (src/backend/utils/sort/logtape.c)
Date
Msg-id ZOgBeNyoeN3jAo3j@paquier.xyz
Whole thread Raw
In response to Re: Avoid a possible overflow (src/backend/utils/sort/logtape.c)  (Peter Geoghegan <pg@bowt.ie>)
Responses Re: Avoid a possible overflow (src/backend/utils/sort/logtape.c)
Re: Avoid a possible overflow (src/backend/utils/sort/logtape.c)
List pgsql-hackers
On Thu, Aug 24, 2023 at 05:33:15PM -0700, Peter Geoghegan wrote:
> I am in favor of fixing the problem. I don't quite recall what it was
> that made the discussion stall last time around.

I think that you mean this one:
https://www.postgresql.org/message-id/CAH2-WznCscXnWmnj=STC0aSa7QG+BRedDnZsP=Jo_R9GUZvUrg@mail.gmail.com

Still that looks entirely different to me.  Here we have a problem
where the number of free blocks stored may cause an overflow in the
internal routine retrieving a free block, but your other thread
is about long being not enough on Windows.  I surely agree that
there's an argument for improving this interface and remove its use of
long in the long-term but that would not be backpatched.  I also don't
see why we cannot do the change proposed here until then, and it's
backpatchable.

There is a second thread related to logtape.c here, but that's still
different:

https://www.postgresql.org/message-id/flat/CAH2-Wzn5PCBLUrrds%3DhD439LtWP%2BPD7ekRTd%3D8LdtqJ%2BKO5D1Q%40mail.gmail.com
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Ian Lawrence Barwick
Date:
Subject: Re: pg_stat_get_backend_subxact() and backend IDs?
Next
From: Michael Paquier
Date:
Subject: Re: Fix error handling in be_tls_open_server()