Re: Dereference before NULL check (src/backend/storage/ipc/latch.c)

2020-11-24 Thread Thomas Munro
On Thu, Nov 5, 2020 at 10:47 AM Ranier Vilela wrote: > Em ter., 3 de nov. de 2020 às 22:09, Kyotaro Horiguchi > escreveu: >> If we call WaitLatch(OrSocket) that waits on the latch, it immediately >> returns because the latch is set. If we called ResetLatch before the >> next call to WaitLatch(),

Re: Dereference before NULL check (src/backend/storage/ipc/latch.c)

2020-11-04 Thread Ranier Vilela
Em ter., 3 de nov. de 2020 às 22:09, Kyotaro Horiguchi < horikyota@gmail.com> escreveu: > At Tue, 3 Nov 2020 20:44:23 +1300, Thomas Munro > wrote in > > On Tue, Nov 3, 2020 at 12:50 AM Kyotaro Horiguchi > > wrote: > > > With the fix patch, it changes to: > > > > > > [16632] LOG: FALSE LATCH

Re: Dereference before NULL check (src/backend/storage/ipc/latch.c)

2020-11-03 Thread Kyotaro Horiguchi
At Tue, 3 Nov 2020 20:44:23 +1300, Thomas Munro wrote in > On Tue, Nov 3, 2020 at 12:50 AM Kyotaro Horiguchi > wrote: > > With the fix patch, it changes to: > > > > [16632] LOG: FALSE LATCH: > > Nice repo. But is it OK to not reset the Win32 event in this case? > Does it sti

Re: Dereference before NULL check (src/backend/storage/ipc/latch.c)

2020-11-02 Thread Thomas Munro
On Tue, Nov 3, 2020 at 12:50 AM Kyotaro Horiguchi wrote: > With the fix patch, it changes to: > > [16632] LOG: FALSE LATCH: Nice repo. But is it OK to not reset the Win32 event in this case? Does it still work correctly if you wait on the latch after that happened, and perhaps

Re: Dereference before NULL check (src/backend/storage/ipc/latch.c)

2020-11-02 Thread Kyotaro Horiguchi
At Mon, 02 Nov 2020 17:25:04 +0900 (JST), Kyotaro Horiguchi wrote in > I called SetLatch() during WaitLatch(NULL, ) but that doesn't fire > WL_LATCH_SET event for me on Windows. (I got it fired on Linux..) On > Windows, the latch is detected after exiting the WaitLatch() > call. Seems like MyLa

Re: Dereference before NULL check (src/backend/storage/ipc/latch.c)

2020-11-02 Thread Ranier Vilela
Em seg., 2 de nov. de 2020 às 05:25, Kyotaro Horiguchi < horikyota@gmail.com> escreveu: > At Mon, 02 Nov 2020 14:33:40 +0900 (JST), Kyotaro Horiguchi < > horikyota@gmail.com> wrote in > > At Mon, 2 Nov 2020 16:22:09 +1300, Thomas Munro > wrote in > > > On Mon, Nov 2, 2020 at 1:49 PM Kyota

Re: Dereference before NULL check (src/backend/storage/ipc/latch.c)

2020-11-02 Thread Kyotaro Horiguchi
At Mon, 02 Nov 2020 14:33:40 +0900 (JST), Kyotaro Horiguchi wrote in > At Mon, 2 Nov 2020 16:22:09 +1300, Thomas Munro > wrote in > > On Mon, Nov 2, 2020 at 1:49 PM Kyotaro Horiguchi > > wrote: > > > At Sat, 31 Oct 2020 11:40:53 -0300, Ranier Vilela > > > wrote in > > > > Per Coverity. > >

Re: Dereference before NULL check (src/backend/storage/ipc/latch.c)

2020-11-01 Thread Kyotaro Horiguchi
At Mon, 2 Nov 2020 16:22:09 +1300, Thomas Munro wrote in > On Mon, Nov 2, 2020 at 1:49 PM Kyotaro Horiguchi > wrote: > > At Sat, 31 Oct 2020 11:40:53 -0300, Ranier Vilela > > wrote in > > > Per Coverity. > > > > > > If test set->latch against NULL, is why it can be NULL. > > > ResetEvent can

Re: Dereference before NULL check (src/backend/storage/ipc/latch.c)

2020-11-01 Thread Thomas Munro
On Mon, Nov 2, 2020 at 1:49 PM Kyotaro Horiguchi wrote: > At Sat, 31 Oct 2020 11:40:53 -0300, Ranier Vilela wrote > in > > Per Coverity. > > > > If test set->latch against NULL, is why it can be NULL. > > ResetEvent can dereference NULL. > > If the returned event is WL_LATCH_SET, set->latch cann

Re: Dereference before NULL check (src/backend/storage/ipc/latch.c)

2020-11-01 Thread Kyotaro Horiguchi
At Sat, 31 Oct 2020 11:40:53 -0300, Ranier Vilela wrote in > Hi, > > Per Coverity. > > If test set->latch against NULL, is why it can be NULL. > ResetEvent can dereference NULL. If the returned event is WL_LATCH_SET, set->latch cannot be NULL. We shouldn't inadvertently ignore the unexpected

Dereference before NULL check (src/backend/storage/ipc/latch.c)

2020-10-31 Thread Ranier Vilela
Hi, Per Coverity. If test set->latch against NULL, is why it can be NULL. ResetEvent can dereference NULL. regards, Ranier Vilela fix_dereference_before_null_check_latch.patch Description: Binary data