From: Tomas Vondra <tv@fuzzy.cz>
To: pgsql-bugs@postgresql.org
Subject: Re: overwriting an existing .so while being used crashes the server process
Date: Wed, 30 May 2012 23:08:11 +0200
Message-ID: <4FC68C3B.4060609@fuzzy.cz> (raw)
In-Reply-To: <8227.1338410155@sss.pgh.pa.us>
References: <4FC6833C.6080501@fuzzy.cz>
<8227.1338410155@sss.pgh.pa.us>
On 30.5.2012 22:35, Tom Lane wrote:
> Tomas Vondra <tv@fuzzy.cz> writes:
>> whenever I run a C-function (part of an .so file) and the file is
>> overwritten, the connection crashes. Tested on 9.1.3 and 9.2-beta1.
>
> "Doctor, it hurts when I do this."
> "So don't do that."
>
> What exactly would you expect Postgres to do about such a thing, anyway?
> It has no control over people overwriting its executable files.
Well, I expected the existing connection will use the old .so, while new
connections would use the new version (although they're exactly the
same). I suppose there are issues with that option too, but crashing the
server is a bit unfortunate ...
And it actually happens even when the file is overwritten between two
queries. I wonder how this affects installing new versions of extensions
- does that mean I can't do that while the database is running?
Is this mentioned in the docs, somewhere? IMHO there should be a big red
banner "DON'T DO THIS" but all I found is this:
http://www.postgresql.org/docs/9.1/interactive/xfunc-c.html
After it is used for the first time, a dynamically loaded object
file is retained in memory. Future calls in the same session to the
function(s) in that file will only incur the small overhead of a
symbol table lookup. If you need to force a reload of an object
file, for example after recompiling it, begin a fresh session.
Which kinda looks like my expectation that the session won't crash was
correct. Clearly seems like bug to me.
Tomas
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: tv@fuzzy.cz
Subject: Re: overwriting an existing .so while being used crashes the server process
In-Reply-To: <4FC68C3B.4060609@fuzzy.cz>
References: <4FC6833C.6080501@fuzzy.cz> <8227.1338410155@sss.pgh.pa.us> <4FC68C3B.4060609@fuzzy.cz>
* 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