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 1h1jZm-0006K1-Jv for pgsql-general@arkaria.postgresql.org; Thu, 07 Mar 2019 03:20:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h1jZj-0000HV-Q8 for pgsql-general@arkaria.postgresql.org; Thu, 07 Mar 2019 03:20:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1jZj-0000HM-AT for pgsql-general@lists.postgresql.org; Thu, 07 Mar 2019 03:20:03 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1jZg-00089y-SR for pgsql-general@postgresql.org; Thu, 07 Mar 2019 03:20:02 +0000 Received: by mail-pf1-x444.google.com with SMTP id a3so10267383pff.11 for ; Wed, 06 Mar 2019 19:20:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=zMXakTkt6bj8hMS+MEqxY/FrIwx7DzzR0fsMgjgqLDI=; b=LDjaO3/O/Vl0bJmzsWCwj4xjXr0W8M1WCOP0uzl+B7uc2tR1+uKfQTGRyuAmHlMp48 FvHphkUzs6eClzFjy7CQPIrBTycCJPpx3PmwQ7NQRlpp3NDmih/uXwDbvFjkN2uXGpnc W21sR42xYOFAsiwHCknfN1fcY5J4APsBvDKYI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=zMXakTkt6bj8hMS+MEqxY/FrIwx7DzzR0fsMgjgqLDI=; b=R+pgVALNrRAeNJmr2f3A7ZMscLdmXs6nQz61n9k/zkUywHljDyD/eMlwpGsTfG4q5Q hwMqwcMEUNwrlQW+nXR3dC1dGVp0IKOgncr7QCgHYEldMmHCVXMwADwG+8Sizxl/0k9i 1+HlYgHuZcMqR+bsWdxwLDSMialmC/ppRQILJVm/iBKDFyqd2FoIPrlnzK3Qz74OQOFd pBDOVL9A3F6MlxZWJKGsKyjaOwQwpiEtloBB6WDRtGhkeG03XHwLZwzPD5xH200Vp6iu n+kd19023V6jJmNby5mP5XTHdWij74gjIge4z/+7lpEO4IKLeHWIJsgS3dyG+AFSo2EV bWNg== X-Gm-Message-State: APjAAAW0/FL/CtCsy5WGj3oMRPbqc8j08wns82Go5nJd+n+PAEcraBuD PYCCZyLSP4tTT3C6/c8RNJEy5A== X-Google-Smtp-Source: APXvYqwFHUsUpTDKqNh7f1gn2kz6oTN+OIuOCmEv9A3qP1MIObMHpx4pafb+j4RCVAONgMRHDeojRA== X-Received: by 2002:a62:b40b:: with SMTP id h11mr10583888pfn.108.1551928798430; Wed, 06 Mar 2019 19:19:58 -0800 (PST) Received: from rfd.leadboat.com (108-233-125-46.lightspeed.sntcca.sbcglobal.net. [108.233.125.46]) by smtp.gmail.com with ESMTPSA id y14sm6562748pgs.47.2019.03.06.19.19.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Mar 2019 19:19:56 -0800 (PST) Date: Wed, 6 Mar 2019 19:19:54 -0800 From: Noah Misch To: Mike Yeap , Thomas Munro Cc: Tom Lane , Laurenz Albe , pgsql-general@postgresql.org Subject: Re: LDAP authenticated session terminated by signal 11: Segmentation fault, PostgresSQL server terminates other active server processes Message-ID: <20190307031954.GA1797215@rfd.leadboat.com> References: <82aa3583d44584fa3d3a3761e8df1fa48d68d8e2.camel@cybertec.at> <2280.1550672218@sss.pgh.pa.us> <6823.1551193055@sss.pgh.pa.us> <14938.1551220103@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Mar 07, 2019 at 10:45:56AM +1300, Thomas Munro wrote: > On Wed, Feb 27, 2019 at 11:28 AM Tom Lane wrote: > > Thomas Munro writes: > > > 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. > > I don't see anything like that (the concept doesn't seem very > portable). I'm not aware of one. > > > 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. > > Ok, here's that patch again with a commit message and with the > configure version warning removed, and a make-sure-we're-not-threaded > patch for FreeBSD. > > I'm not sure what to do about the LDAP test in > contrib/dblink/sql/dblink.sql. Do we still want this? Mike, does the dblink test suite not fail on your system? It's designed to catch this exact problem. Has anyone else reproduced this? > I propose this for master only, for now. I also think it'd be nice to > consider back-patching it after a while, especially since this > reported broke on CentOS/RHEL7, a pretty popular OS that'll be around > for a good while. Hmm, I wonder if it's OK to subtly change library > dependencies in a minor release; I don't see any problem with it since > I expect both variants to be provided by the same package in every > distro but we'd certainly want to highlight this to the package > maintainers if we did it. It's not great to change library dependencies in a minor release. If every RHEL 7 installation can crash this way, changing the dependencies is probably the least bad thing.