Re: [PATCH] Silence Valgrind about SelectConfigFiles() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH] Silence Valgrind about SelectConfigFiles()
Date
Msg-id 188435.1755186377@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCH] Silence Valgrind about SelectConfigFiles()  (Aleksander Alekseev <aleksander@tigerdata.com>)
List pgsql-hackers
Aleksander Alekseev <aleksander@tigerdata.com> writes:
> Makes sense. Here is the corrected patch v2.

LGTM, pushed.

>> Huh ... don't quite see where in that recipe we'd reach a
>> SelectConfigFiles error exit.

> How exactly we reach this code patch is a good question. I tried to
> understand the exact conditions by using my steps to reproduce and an
> ancient debugging technique with sleep(), elog() and `watch` - see
> trick.txt. Unfortunately I was not able to reproduce it again nor
> under Valgrind nor without it. I guess it means that either I did
> something differently before or the right conditions are met under
> rare circumstances.

I think you must have done something involving passing bad arguments
to the postmaster, and then forgotten that (not hard to do late at
night).  I see from the code coverage report that none of the failure
exits from SelectConfigFiles are exercised in our normal regression
tests, so only something very odd could have resulted in getting here
without a manual error being involved.  But I'm content to apply this
on the grounds that it's inconsistent to free the string in only one
of the error exit paths.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Greg Burd
Date:
Subject: Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words
Next
From: David Rowley
Date:
Subject: Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words