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

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Rider <oceanustz(at)gmail(dot)com>
Cc: Steven Niu <niushiji(at)gmail(dot)com>, 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-06 01:05:07
Message-ID: aLuIw2LsAAuSFjp2@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 error scenario.

Please see details in utils/elog.h, if you want to study this area of
the code of course. There is a large portion about volatile variables
and compiler expectations which is also very interested to know about.
And that's useful if you write your own extension code, outside of the
core Postgres code.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2025-09-06 01:12:11 Re: pg_upgrade: transfer pg_largeobject_metadata's files when possible
Previous Message Michael Paquier 2025-09-06 01:01:24 Re: 回复: Fix segfault while accessing half-initialized hash table in pgstat_shmem.c