Re: gcov coverage data not full with immediate stop - Mailing list pgsql-hackers

(Strangely, I was just thinking about these branches of mine as I
closed my week last Friday...)

On 2020-May-10, Alexander Lakhin wrote:

> So if we want to make the coverage reports more precise, I see the three
> ways:
> 1. Change the stop mode in teardown_node to fast (probably only when
> configured with --enable-coverage);
> 2. Explicitly stop nodes in TAP tests (where it's important) -- seems
> too tedious and troublesome;
> 3. Explicitly call __gcov_flush in SIGQUIT handler (quickdie)?

I tried your idea 3 a long time ago and my experiments didn't show an
increase in coverage [1].  But I like this idea the best, and maybe I
did something wrong.  Attached is the patch I had (on top of
fc115d0f9fc6), but I don't know if it still applies.

(The second attachment is another branch I had on this, I don't remember
why; that one was on top of 438e51987dcc.  The curious thing is that I
didn't add the __gcov_flush to quickdie in this one.  Maybe what we need
is a mix of both.)

I think we should definitely get this fixed for pg13 ...

[1] https://postgr.es/m/[email protected]

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Andy Fan
Date:
Subject: Re: No core file generated after PostgresNode->start
Next
From: Alvaro Herrera
Date:
Subject: Re: Add -Wold-style-definition to CFLAGS?