pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: Jeremy Evans <code@jeremyevans.net>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15367: Crash in pg_fe_scram_free when using foreign tables
Date: Sat, 8 Sep 2018 12:39:14 -0700
Message-ID: <20180908193914.GI32058@paquier.xyz> (raw)
In-Reply-To: <3979.1536433320@sss.pgh.pa.us>
References: <20180906222843.GF17425@jeremyevans.local>
	<20180907165103.GH17425@jeremyevans.local>
	<20180907175518.GI17425@jeremyevans.local>
	<20180907181522.GB32058@paquier.xyz>
	<20016.1536351535@sss.pgh.pa.us>
	<20180907204403.GC32058@paquier.xyz>
	<16558.1536407783@sss.pgh.pa.us>
	<18398.1536410055@sss.pgh.pa.us>
	<87o9d8rv08.fsf@news-spur.riddles.org.uk>
	<3979.1536433320@sss.pgh.pa.us>

On Sat, Sep 08, 2018 at 03:02:00PM -0400, Tom Lane wrote:
> I tried setting up a scram-auth-based postgres_fdw connection on
> my RHEL6 box and forcing it through the questionable code path
> by issuing a dummy ALTER USER MAPPING command from another session.
> It worked fine, so the problem doesn't seem to be present on Linux.
> 
> Repeating the same thing on a nearby OpenBSD 6.0 image ... kaboom!
> It fails exactly as Jeremy describes.  Furthermore, I can confirm
> that the attached patch fixes it.

That's not good!  I have tried the report on Linux only, with pgbench -C
doing many foreign scans through postgres_fdw which connects to the
remote using SCRAM authentication, and this was stable.  Anything newer
than ec136d19 is impacted.  I am surprised this has not been seen
earlier to be honest.

> I wonder which other platforms we have that behave like this?
> And how come we've not seen symptoms before?  It's hard to believe
> that src/common/saslprep.c is the only thing libpq imports
> that has FRONTEND-vs-not-FRONTEND behavior differences.

libpq is quite particular in the fact that it compiles directly with
stuff in src/common, src/port, etc.  I think that the same problem
exists for pg_md5_encrypt().  So I like the solution proposed.  I guess
you have made sure that postgres_fdw becomes stable this way?  Have you
tried to stress it more with pgbench -C doing only foreign scans and
dozens of clients running in parallel?
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (33+ messages)  latest in thread

Message-ID: <20180908193914.GI32058@paquier.xyz>
Permalink:  ../20180908193914.GI32058@paquier.xyz/
Also on:    postgresql.org/message-id/20180908193914.GI32058@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: michael@paquier.xyz, tgl@sss.pgh.pa.us, andrew@tao11.riddles.org.uk, code@jeremyevans.net, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #15367: Crash in pg_fe_scram_free when using foreign tables
  In-Reply-To: <20180908193914.GI32058@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox