Re: Strange hanging bug in a simple milter

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Vesa-Matti J Kari <vmkari(at)cc(dot)helsinki(dot)fi>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Strange hanging bug in a simple milter
Date: 2013-09-13 17:00:49
Message-ID: 20130913170049.GB1330627@alap2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2013-09-13 12:40:11 -0400, Stephen Frost wrote:
> Heikki, all,
>
> * Stephen Frost (sfrost(at)snowman(dot)net) wrote:
> > Very curious. Out of time right now to look into it, but will probably
> > be back at it later tonight.
>
> Alright, I was back at this a bit today and decided to go with a hunch-
> and it looks like I might have been right to try.
>
> Leaving the locking callback hooks in place appears to prevent the
> deadlocks from happening, at least with this little app.
>
> IOW, in destroy_ssl_system(), simply arrange to not have
> CRYPTO_set_locking_callback(NULL); and CRYPTO_set_id_callback(NULL);
> called. I've done this with the very simple attached patch. Per the
> comment above destroy_ssl_system(), this doesn't seem to be an
> acceptable solution because libpq might get unloaded from the
> application, but perhaps it points the way towards what the issue is.

It'd be interesting to replace the origin callbacks with one immediately
doing an abort() or similar to see whether they maybe are called after
they shouldn't be and from where.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2013-09-13 17:15:34 Re: Strange hanging bug in a simple milter
Previous Message Stephen Frost 2013-09-13 16:40:11 Re: Strange hanging bug in a simple milter