From owner-freebsd-stable@freebsd.org Sun Feb 9 11:25:17 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 77B0E2356D9 for ; Sun, 9 Feb 2020 11:25:17 +0000 (UTC) (envelope-from joe@truespeed.com) Received: from mail.truespeed.com (mail.truespeed.com [31.210.26.210]) by mx1.freebsd.org (Postfix) with ESMTP id 48Fmt43X7Cz41hW for ; Sun, 9 Feb 2020 11:25:16 +0000 (UTC) (envelope-from joe@truespeed.com) Received: from dspam.truespeed.com (localhost [127.0.0.1]) by mail.truespeed.com (Postfix) with SMTP id 6FC125212E8 for ; Sun, 9 Feb 2020 11:25:15 +0000 (UTC) Received: from wormhole.home (host86-161-111-19.range86-161.btcentralplus.com [86.161.111.19]) (Authenticated sender: joe@truespeed.com) by mail.truespeed.com (Postfix) with ESMTPSA id A2F9C5212D8; Sun, 9 Feb 2020 11:25:13 +0000 (UTC) From: Dr Josef Karthauser Message-Id: <1F45763E-08A1-4308-A77A-B5CA30CF3909@truespeed.com> Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Date: Sun, 9 Feb 2020 11:25:12 +0000 Subject: PAM modules; pthreads not reliably dispatching background threads :(. References: <9E850062-AA7F-4A0F-98B2-7FBE8B58AE76@truespeed.com> Cc: Richard Smith To: freebsd-stable@freebsd.org X-Mailer: Apple Mail (2.3608.40.2.2.4) X-Rspamd-Queue-Id: 48Fmt43X7Cz41hW X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of joe@truespeed.com designates 31.210.26.210 as permitted sender) smtp.mailfrom=joe@truespeed.com X-Spamd-Result: default: False [-0.18 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-0.94)[-0.935,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:31.210.26.210/32]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-stable@freebsd.org]; DMARC_NA(0.00)[truespeed.com]; NEURAL_HAM_LONG(-0.53)[-0.533,0]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FROM_NAME_HAS_TITLE(1.00)[dr]; IP_SCORE(-0.02)[country: GB(-0.08)]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:51048, ipnet:31.210.24.0/21, country:GB]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[19.111.161.86.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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, 09 Feb 2020 11:25:17 -0000 Hi Folks, Has anyone got any experience with PAM and pthreads? We=E2=80=99re using a 2FA module (pam_yubico = https://www.freebsd.org/cgi/man.cgi?query=3Dpam_yubico&sektion=3D8 = ). It=E2=80=99s 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.=20 It seems that the pthreads are not being handled reliably within the PAM = runtime context - the background threads do not complete or dispatch. = It=E2=80=99s very strange. The problem doesn=E2=80=99t 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=3D214540 = ). But that = problem was reported 3 years ago! HELP! If you know something I=E2=80=99d really appreciate a steer! Many thanks, Joe =E2=80=94=20 Dr Josef Karthauser Chief Technical Officer=20 (01225) 300371 / (07703) 596893=20 www.truespeed.com =