Re: [PATCHES] putting CHECK_FOR_INTERRUPTS in qsort_comparetup() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] putting CHECK_FOR_INTERRUPTS in qsort_comparetup()
Date
Msg-id 3410.1152902615@sss.pgh.pa.us
Whole thread Raw
Responses Re: [PATCHES] putting CHECK_FOR_INTERRUPTS in qsort_comparetup()  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
"Charles Duffy" <charles.duffy@gmail.com> writes:
> [ CHECK_FOR_INTERRUPTS inside qsort comparison routine ]

It occurs to me that there's a nonzero risk of problems here, because if
the interrupt occurs qsort() will lose control.  I'm wondering whether
there are any implementations of qsort() that allocate memory and then
release it before returning.  If so, interrupting the sort would lead to
memory leaked permanently (till backend exit anyway).

We might have to just tolerate this, but if it occurs on a lot of
platforms I'd have second thoughts about applying the patch.  Anyone
familiar with the internals of glibc's qsort, in particular?

            regards, tom lane

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: src/tools/pginclude considered harmful (was Re: [PATCHES] toast index entries again)
Next
From: Andrew Dunstan
Date:
Subject: Re: contrib promotion?