Re: PG 10: could not generate random cancel key

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PG 10: could not generate random cancel key
Date: 2018-07-17 13:04:55
Message-ID: 20180717130455.GA1629@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 17, 2018 at 01:33:11PM +0100, Dean Rasheed wrote:
> Looking for precedents elsewhere, I found [2] which does exactly that,
> although I'm slightly dubious about the need for the for-loop there. I
> also found a thread [3], which recommends simply doing
>
> if (RAND_status() == 0)
> RAND_poll();
>
> which seems preferable. Attached is a patch to do this in pg_strong_random().

Checking for the return result of RAND_poll() would also be good thing
to do. From what I read in OpenSSL code it could fail as well, and
we could combine that with a loop attempted to feed the machinery a
decided amount of times, just failing after successive failures.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Haribabu Kommi 2018-07-17 13:22:19 Re: [bug fix] Produce a crash dump before main() on Windows
Previous Message Tomas Vondra 2018-07-17 13:03:28 Re: [HACKERS] PATCH: multivariate histograms and MCV lists