From owner-freebsd-stable@freebsd.org Sun Feb 16 19:14:54 2020 Return-Path: Delivered-To: freebsd-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A350823F139 for ; Sun, 16 Feb 2020 19:14:54 +0000 (UTC) (envelope-from crest@rlwinm.de) Received: from mail.rlwinm.de (mail.rlwinm.de [138.201.35.217]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48LGyj3jM5z3FkC for ; Sun, 16 Feb 2020 19:14:53 +0000 (UTC) (envelope-from crest@rlwinm.de) Received: from hexe.rlwinm.de (200116b864710000feaa14fffe7af214.dip.versatel-1u1.de [IPv6:2001:16b8:6471:0:feaa:14ff:fe7a:f214]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.rlwinm.de (Postfix) with ESMTPSA id EC5D91C491 for ; Sun, 16 Feb 2020 19:14:44 +0000 (UTC) Subject: Re: PAM modules; pthreads not reliably dispatching background threads :(. To: freebsd-stable@freebsd.org References: <9E850062-AA7F-4A0F-98B2-7FBE8B58AE76@truespeed.com> <1F45763E-08A1-4308-A77A-B5CA30CF3909@truespeed.com> From: Jan Bramkamp Message-ID: <410daeeb-df13-fa7d-2c58-302222f9d87d@rlwinm.de> Date: Sun, 16 Feb 2020 20:14:43 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <1F45763E-08A1-4308-A77A-B5CA30CF3909@truespeed.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: 48LGyj3jM5z3FkC X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of crest@rlwinm.de designates 138.201.35.217 as permitted sender) smtp.mailfrom=crest@rlwinm.de X-Spamd-Result: default: False [-4.18 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-stable@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; DMARC_NA(0.00)[rlwinm.de]; IP_SCORE(-1.88)[ip: (-8.82), ipnet: 138.201.0.0/16(1.01), asn: 24940(-1.56), country: DE(-0.02)]; RECEIVED_SPAMHAUS_PBL(0.00)[4.1.2.f.a.7.e.f.f.f.4.1.a.a.e.f.0.0.0.0.1.7.4.6.8.b.6.1.1.0.0.2.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:138.201.0.0/16, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2020 19:14:54 -0000 On 09.02.20 12:25, Dr Josef Karthauser wrote: > Hi Folks, > > Has anyone got any experience with PAM and pthreads? > > We’re using a 2FA module (pam_yubico https://www.freebsd.org/cgi/man.cgi?query=pam_yubico&sektion=8 ). > > It’s proving unreliable. Digging deeper it uses libcurl to communication to an HTTP endpoint, and libcurl is using pthreads for to make asynchronous DNS lookup requests. > > It seems that the pthreads are not being handled reliably within the PAM runtime context - the background threads do not complete or dispatch. It’s very strange. > > The problem doesn’t happen if we use the same code running from a user land process. The pthreads are reliably in this context. > > Is there a known issue with PAM and pthreads? Hints are that there are (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214540 ). But that problem was reported 3 years ago! > > HELP! > > If you know something I’d really appreciate a steer! Is the "host" process multithreaded or at least built with Pthread support?