Re: 回复: Fix segfault while accessing half-initialized hash table in pgstat_shmem.c

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Steven Niu <niushiji(at)gmail(dot)com>
Cc: Mikhail Kot <mikhail(dot)kot(at)databricks(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "to(at)myrrc(dot)dev" <to(at)myrrc(dot)dev>
Subject: Re: 回复: Fix segfault while accessing half-initialized hash table in pgstat_shmem.c
Date: 2025-09-04 06:30:49
Message-ID: aLkyGUyEdNwDt79l@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Sep 04, 2025 at 02:31:34AM +0000, 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 state. The generation and
refcount number assigned inside pgstat_init_entry() would not matter
as well because the entry created by dshash_find_or_insert() would be
entirely gone. So I am not sure what's the point you are trying to
make here.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2025-09-04 06:35:16 Re: Improve pg_sync_replication_slots() to wait for primary to advance
Previous Message John Naylor 2025-09-04 06:20:45 Re: [PATCH] Hex-coding optimizations using SVE on ARM.