Re: Replacing abort() with __builtin_trap()?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Replacing abort() with __builtin_trap()?
Date: 2023-07-02 21:50:47
Message-ID: 212007.1688334647@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> On 2023-07-02 13:55:53 -0400, Tom Lane wrote:
>> Andres Freund <andres(at)anarazel(dot)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: Illegal instruction
> 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

Hm, I do *not* like "Illegal instruction" in place of SIGABRT;
that looks too much like we vectored off into never-never land.
I'd rather live with the admittedly-ugly stack traces.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2023-07-02 23:32:07 Re: possible bug in handling of contrecords in dd38ff28ad (Fix recovery_prefetch with low maintenance_io_concurrency)
Previous Message David Rowley 2023-07-02 21:27:25 Re: Making empty Bitmapsets always be NULL