Re: Strange hanging bug in a simple milter

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

On 13.09.2013 22:26, Heikki Linnakangas wrote:
> I'm afraid the "move_locks.diff" patch you posted earlier is also
> broken; close_SSL() is called in error scenarios from
> pqsecure_open_client(), while already holding the mutex. So it will
> deadlock with itself if the connection cannot be established.

Actually, I think there's a pre-existing bug there in git master. If the
SSL_set_app_data or SSL_set_fd call in pqsecure_open_client fails for
some reason, it will call close_SSL() with conn->ssl already set, and
the mutex held. close_SSL() will call
pqsecure_destroy()->destroy_SSL()->destory_ssl_system(), which will try
to acquire the mutex again.

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-09-13 19:32:36 Re: dynamic shared memory
Previous Message Heikki Linnakangas 2013-09-13 19:26:07 Re: Strange hanging bug in a simple milter