On Sat, Sep 06, 2025 at 10:01:24AM +0900, Michael Paquier wrote:
> A last thing that I was not able to spend much time on is how much it
> is possible to mess up with the shared memory state. If it is worse
> than I suspected initially, where an OOM in a first session can cause
> crashes because o
___
From: Michael Paquier
Sent: Thursday, September 04, 2025 14:30
To: Steven Niu
Cc: Mikhail Kot; pgsql-hackers@lists.postgresql.org; t...@myrrc.dev
Subject: Re: 回复: Fix segfault while accessing half-initialized hash table in
pgstat_shmem.c
On Thu, Sep 04
On Thu, Sep 04, 2025 at 03:49:19PM +0800, Rider wrote:
> And, the PG_RE_THROW() within the PG_CATCH block causes a non-local jump,
> immediately aborting the current execution path to handle the error at a
> higher level. This guarantees that the code following PG_END_TRY is
> unreachable in the er
On Fri, Sep 05, 2025 at 09:46:55PM +0100, Mikhail Kot wrote:
> Do you want me to update the patch based on your suggestion on fault
> injection, or update the try/catch to the callers as discussed, or
> it's good to be included in Postgres?
I would prefer the approach of letting the callers deal w
Hi,
Do you want me to update the patch based on your suggestion on fault
injection, or update the try/catch to the callers as discussed, or
it's good to be included in Postgres?
On Thu, Sep 04, 2025 at 02:31:34AM +, Steven Niu wrote:
> If pgstat_init_entry() errors on OOM, what would it returns to shheader, NULL?
> That would bring trouble to dshash_delete_entry().
Based on the proposal of patch 0002, the code would throw an error
after cleaning up the shared memory s
; To: Steven Niu
> Cc: Mikhail Kot; pgsql-hackers@lists.postgresql.org; t...@myrrc.dev
> Subject: Re: 回复: Fix segfault while accessing half-initialized hash table
> in pgstat_shmem.c
>
> On Thu, Sep 04, 2025 at 02:31:34AM +, Steven Niu wrote:
> > If pgstat_init_entry() errors
Hi, Mikhail,
If pgstat_init_entry() errors on OOM, what would it returns to shheader, NULL?
That would bring trouble to dshash_delete_entry().
Thanks,
Steven
发件人: Mikhail Kot
已发送: 2025 年 9 月 04 日 星期四 05:39
收件人: pgsql-hackers@lists.postgresql.org
抄送: t...@myrrc
发件人: Michael Paquier
已发送: 2025 年 9 月 03 日 星期三 17:43
收件人: Steven Niu
抄送: Mikhail Kot; pgsql-hackers@lists.postgresql.org; t...@myrrc.dev
主题: Re: 回复: Fix segfault while accessing half-initialized hash table in
pgstat_shmem.c
On Wed, Sep 03, 2025 at 07:22
On Wed, Sep 03, 2025 at 07:22:00AM +, Steven Niu wrote:
> So unless dsa_allocate() can ensure never returns InvalidDsaPointer,
> there is risk of SegV. In fact the function dsa_allocate() does
> return InvalidDsaPointer in some cases.
>
> So, maybe should we add pointer check in all places wh
I found there are many cases of following pattern:
ptr_1 = dsa_allocate();
ptr_2 = dsa_get_address(xxx, ptr_1);
ptr_2->yyy = zzz;
Inside dsa_get_address(dsa_area *area, dsa_pointer dp):
/* Convert InvalidDsaPointer to NULL. */
if (!DsaPointerIsValid(dp))
return NULL;
So
11 matches
Mail list logo