Re: [HACKERS] logical replication launcher crash on buildfarm - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [HACKERS] logical replication launcher crash on buildfarm
Date
Msg-id 20170316185505.mtztedkngd34z4i4@alap3.anarazel.de
Whole thread Raw
In response to Re: [HACKERS] logical replication launcher crash on buildfarm  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [HACKERS] logical replication launcher crash on buildfarm  (Robert Haas <robertmhaas@gmail.com>)
Re: [HACKERS] logical replication launcher crash on buildfarm  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
On 2017-03-16 09:27:59 -0400, Robert Haas wrote:
> On Thu, Mar 16, 2017 at 5:13 AM, Petr Jelinek
> <petr.jelinek@2ndquadrant.com> wrote:
> > Hmm now that you mention it, I remember discussing something similar
> > with you last year in Dallas in regards to parallel query. IIRC Windows
> > should not have this problem but other systems with EXEC_BACKEND do.
> > Don't remember the details though.
> 
> Generally, extension code can't use bgw_main safely, and must use
> bgw_library_name and bgw_function_name.  But bgw_main is supposedly
> safe for core code.

I indeed think it's not safe, and it's going to get less and less safe
on windows (or EXEC_BACKEND).  I don't think we can afford to disable
ASLR in the long run (I indeed supect that'll just be disallowed at some
point), and that's the only thing making it safe-ish in combination with
EXEC_BACKEND.


> If it's not even safe there, then I guess we should remove it entirely
> as a useless foot-gun.

I indeed think that's the right consequence.  One question is what to
replace it with exactly - are we guaranteed we can dynamically lookup
symbols by name in the main binary on every platform?  Alternatively we
can just hardcode a bunch of bgw_function_name values that are matched
to specific functions if bgw_library_name is NULL - I suspect that'd be
the easiest / least worrysome portability-wise.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Andrew Borodin
Date:
Subject: Re: [HACKERS] Review: GIN non-intrusive vacuum of posting tree
Next
From: Peter Geoghegan
Date:
Subject: Re: [HACKERS] Review: GIN non-intrusive vacuum of posting tree