Re: Making the regression tests halt to attach a debugger

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Making the regression tests halt to attach a debugger
Date: 2015-05-18 17:29:36
Message-ID: CAM3SWZRjjBPCxY-5v6nRR1h7Q5aSK9CfUqf59dQ7MBEt0tfXZg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 18, 2015 at 6:44 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Peter Geoghegan <pg(at)heroku(dot)com> writes:
>> I came up with a simple approach to conveniently attaching a debugger
>> when a bug manifested itself from within the regression tests, by
>> patching Postgres. This worked quite well. The backend would look for
>> the occurrence of a magical token within each and every query string.
>
> If your approach involves modifying a target query in a regression test,
> it really seems unnecessary to do all this. Just insert something like
> "select pg_sleep(60)" into the test script before the target query.

That seems less convenient, because I have to wait for the backend to
wake up within GDB.

I use a script that attaches GDB to an inferred-from-ps Postgres
backend, too. But it's possible to imagine that not working that well.
Like with an isolation test, for example. I like that the backend
advertises that I should connect GDB to its PID, and will wait all day
as necessary.

I also wrote a script that infers a useful non-auxiliary backend PID
(in the same way as the other GDB script), but just sends it SIGCONT.
I could then continue the test in a convenient way without attaching a
debugger.

Anyway, it was just an idea. If people aren't sold on the merits of
making this into development infrastructure, I'll leave it at that.
--
Peter Geoghegan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2015-05-18 17:29:45 Re: jsonb concatenate operator's semantics seem questionable
Previous Message Tom Lane 2015-05-18 17:28:33 Re: How does MSVC's fetchRegressOpts() work at all?