Re: Unsafe access BufferDescriptors array in BufferGetLSNAtomic()

2025-02-18 Thread Tender Wang
Richard Guo 于2025年2月19日周三 10:30写道: > On Wed, Feb 19, 2025 at 9:58 AM Richard Guo > wrote: > > On Wed, Feb 19, 2025 at 9:44 AM Michael Paquier > wrote: > > > On Wed, Feb 19, 2025 at 09:36:35AM +0900, Richard Guo wrote: > > > > I plan to push this shortly. This is arguably a bug, but it hasn't >

Re: Unsafe access BufferDescriptors array in BufferGetLSNAtomic()

2025-02-18 Thread Richard Guo
On Wed, Feb 19, 2025 at 9:58 AM Richard Guo wrote: > On Wed, Feb 19, 2025 at 9:44 AM Michael Paquier wrote: > > On Wed, Feb 19, 2025 at 09:36:35AM +0900, Richard Guo wrote: > > > I plan to push this shortly. This is arguably a bug, but it hasn't > > > caused any real issues, and nobody has compl

Re: Unsafe access BufferDescriptors array in BufferGetLSNAtomic()

2025-02-18 Thread Richard Guo
On Wed, Feb 19, 2025 at 9:44 AM Michael Paquier wrote: > On Wed, Feb 19, 2025 at 09:36:35AM +0900, Richard Guo wrote: > > I plan to push this shortly. This is arguably a bug, but it hasn't > > caused any real issues, and nobody has complained about it until now, > > so I don't think it needs to b

Re: Unsafe access BufferDescriptors array in BufferGetLSNAtomic()

2025-02-18 Thread Michael Paquier
On Wed, Feb 19, 2025 at 09:36:35AM +0900, Richard Guo wrote: > I plan to push this shortly. This is arguably a bug, but it hasn't > caused any real issues, and nobody has complained about it until now, > so I don't think it needs to be back-patched. Any thoughts? I can see a point in doing a bac

Re: Unsafe access BufferDescriptors array in BufferGetLSNAtomic()

2025-02-18 Thread Richard Guo
On Tue, Feb 4, 2025 at 4:59 PM Richard Guo wrote: > On Thu, Nov 7, 2024 at 7:07 PM Tender Wang wrote: > > While learning gist index insert codes, I find a little issue with > > BufferGetLSNAtomic(). > > At first, it wants to get bufHdr by accessing the buffer descriptor array, > > as below: > >

Re: Unsafe access BufferDescriptors array in BufferGetLSNAtomic()

2025-02-04 Thread Richard Guo
On Thu, Nov 7, 2024 at 7:07 PM Tender Wang wrote: > While learning gist index insert codes, I find a little issue with > BufferGetLSNAtomic(). > At first, it wants to get bufHdr by accessing the buffer descriptor array, as > below: > > BufferDesc *bufHdr = GetBufferDescriptor(buffer - 1); > > Ho

Re: Unsafe access BufferDescriptors array in BufferGetLSNAtomic()

2025-02-03 Thread Tender Wang
Xuneng Zhou 于2025年1月8日周三 13:35写道: > Hi Tender, > > I’ve looked through the patch, and I believe there is a potential issue. > The default size for BufferDescriptors appears to be 16,384. Passing and > casting a negative buffer ID to a large unsigned integer in > GetBufferDescriptor, and then usin

Re: Unsafe access BufferDescriptors array in BufferGetLSNAtomic()

2025-01-07 Thread Xuneng Zhou
Hi Tender, I’ve looked through the patch, and I believe there is a potential issue. The default size for BufferDescriptors appears to be 16,384. Passing and casting a negative buffer ID to a large unsigned integer in GetBufferDescriptor, and then using it as an array subscript, could potentiall