Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gylDT-00084E-0d for pgsql-general@arkaria.postgresql.org; Tue, 26 Feb 2019 22:28:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gylDR-0004GR-OZ for pgsql-general@arkaria.postgresql.org; Tue, 26 Feb 2019 22:28:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gylDR-0004GK-Ca for pgsql-general@lists.postgresql.org; Tue, 26 Feb 2019 22:28:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gylDO-0000FL-Fb for pgsql-general@postgresql.org; Tue, 26 Feb 2019 22:28:44 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x1QMSN1h014939; Tue, 26 Feb 2019 17:28:23 -0500 From: Tom Lane To: Thomas Munro cc: Mike Yeap , Laurenz Albe , pgsql-general@postgresql.org Subject: Re: LDAP authenticated session terminated by signal 11: Segmentation fault, PostgresSQL server terminates other active server processes In-reply-to: References: <82aa3583d44584fa3d3a3761e8df1fa48d68d8e2.camel@cybertec.at> <2280.1550672218@sss.pgh.pa.us> <6823.1551193055@sss.pgh.pa.us> Comments: In-reply-to Thomas Munro message dated "Wed, 27 Feb 2019 10:32:30 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <14937.1551220103.1@sss.pgh.pa.us> Date: Tue, 26 Feb 2019 17:28:23 -0500 Message-ID: <14938.1551220103@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thomas Munro writes: > On Wed, Feb 27, 2019 at 3:57 AM Tom Lane wrote: >> If pthread_is_threaded_np(), or something equivalent, is widely available >> then it might be all right to try solving this going forward by switching >> to libldap_r and seeing if anyone hits those cross-checks. I'd be afraid >> to risk it in the back branches though ... > Hmm. Well here is a new data point: it looks like the Red Hat family > of distributions is in the process of making the same decision as > Debian (namely: to expunge the non-MT variant, because it bites > various projects in the same way that it bites us), but they haven't > quite hasn't pulled the trigger yet: > https://fedoraproject.org/wiki/Changes/OpenLDAPwithoutNonthreadedLibraries Interesting, but that's going to be a very slow change. That says they'll pull the trigger in Fedora 30, which I think is due to be released this spring --- but it won't show up in RHEL till the next major release (8 or maybe even 9 at this point), and the existing major releases have got 10-year support lifespans. > I don't see pthread_is_threaded_np() on any non-Apple systems in my > lab. Yeah, I thought that might be a Mac thing. I wonder if POSIX has any usable equivalent. > Clearly libdap_r is *capable* of creating threads: it contains a > function ldap_pvt_thread_create(), and we can see that slapd and other > OpenLDAP things use that, but AFAICT that's a private facility not > intended for end users to call, so there's no danger if you just use > the documented LDAP client API. That seems promising, but I'd sure be happier if we could cross-check that there's still just one thread at the completion of authentication. regards, tom lane