pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: lcampbell@asascience.com
Cc: pgsql-bugs@postgresql.org
Cc: pgsql-hackers@postgresql.org
Subject: Re: BUG #8782: Segmentation Fault during initialization
Date: Sun, 12 Jan 2014 15:30:26 -0500
Message-ID: <20140112203026.GB1729862@tornado.leadboat.com> (raw)
In-Reply-To: <21537.1389406247@sss.pgh.pa.us>
References: <E1W1jnD-0002VQ-Do@wrigleys.postgresql.org>
	<21537.1389406247@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On Fri, Jan 10, 2014 at 09:10:47PM -0500, Tom Lane wrote:
> 3. Move the MemoryContextInit() call to before set_pglocale_pgservice().

> #3 is not too nice either, because it would mean calling MemoryContextInit
> in main.c which doesn't seem like a great place for it.  On the other
> hand, there is a whole lot of rather random junk getting called from
> main.c; who wants to bet that none of the rest of it can call elog(),
> either now or in the future?
> 
> After a few moments' thought, I lean a bit towards #3, but it's a
> weakly held position.  Anyone have other ideas?

I, too, would pick #3.  Not much has reason to run before MemoryContextInit();
the only candidate that comes to mind is pgwin32_install_crashdump_handler().

> One other point here is that I'm pretty sure MemoryContextInit itself
> will try to elog() if it fails.  I don't know if it's worth trying
> to unwind that circularity.  As long as we do it early enough, the
> odds of failure should be about negligible --- certainly I don't
> recall ever seeing a report of a crash there.
> 
> Possibly it'd be worth having some check in elog.c that ErrorContext has
> been created, with a very simple "print some fixed text to stderr and die"
> behavior if not.  That would at least be more useful than a bare crash.

Not sure about what more to do here.

Thanks,
nm

-- 
Noah Misch
EnterpriseDB                                 http://www.enterprisedb.com


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (3+ messages)

Message-ID: <20140112203026.GB1729862@tornado.leadboat.com>
Permalink:  ../20140112203026.GB1729862@tornado.leadboat.com/
Also on:    postgresql.org/message-id/20140112203026.GB1729862@tornado.leadboat.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noah@leadboat.com, tgl@sss.pgh.pa.us, lcampbell@asascience.com, pgsql-hackers@postgresql.org
  Subject: Re: BUG #8782: Segmentation Fault during initialization
  In-Reply-To: <20140112203026.GB1729862@tornado.leadboat.com>
  References: <E1W1jnD-0002VQ-Do@wrigleys.postgresql.org> <21537.1389406247@sss.pgh.pa.us> <20140112203026.GB1729862@tornado.leadboat.com>

* 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