Re: Replacing abort() with __builtin_trap()? - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Replacing abort() with __builtin_trap()?
Date
Msg-id 20230702180944.hlwjlvmr3vkhakgq@awork3.anarazel.de
Whole thread Raw
In response to Re: Replacing abort() with __builtin_trap()?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Replacing abort() with __builtin_trap()?
List pgsql-hackers
Hi,

On 2023-07-02 13:55:53 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > I'd like to propose that we do a configure test for __builtin_trap() and use
> > it, if available, before the abort() in ExceptionalCondition(). Perhaps also
> > for PANIC, but it's not as clear to me whether we should.
>
> Does that still result in the same process exit signal being reported to
> the postmaster?

It does not on linux / x86-64.

2023-07-02 10:52:55.103 PDT [1398197][postmaster][:0][] LOG:  server process (PID 1398207) was terminated by signal 4:
Illegalinstruction
 
vs today's
2023-07-02 11:08:22.674 PDT [1401801][postmaster][:0][] LOG:  server process (PID 1401809) was terminated by signal 6:
Aborted

It wouldn't be bad for postmaster to be able to distinguish between PANIC and
Assert(), but I agree that the non-determinism is a bit annoying.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Replacing abort() with __builtin_trap()?
Next
From: Tomas Vondra
Date:
Subject: Re: possible bug in handling of contrecords in dd38ff28ad (Fix recovery_prefetch with low maintenance_io_concurrency)