Re: function for testing that causes the backend to terminate

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Joe Conway <mail(at)joeconway(dot)com>, Dave Cramer <davecramer(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: function for testing that causes the backend to terminate
Date: 2021-05-01 15:56:45
Message-ID: d72c21cb-5ed9-7170-2741-a6b1f1113d0c@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 4/29/21 4:16 PM, Joe Conway wrote:
> On 4/29/21 6:56 AM, Dave Cramer wrote:
>> For testing unusual situations I'd like to be able to cause a backend
>> to terminate due to something like a segfault. Do we currently have
>> this in testing ?
>
> If you can run SQL as a superuser from that backend, try:
>
> COPY (SELECT pg_backend_pid())
>  TO PROGRAM 'xargs kill -SIGSEGV';
>
> HTH,
>
> Joe
>

or a plperlu function that does 'kill 11, $$;' should do it.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Dilger 2021-05-01 16:13:49 Re: Granting control of SUSET gucs to non-superusers
Previous Message Bharath Rupireddy 2021-05-01 15:31:48 Re: Enhanced error message to include hint messages for redundant options error