From nobody Mon Dec 27 12:39:11 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 997D11921C08 for ; Mon, 27 Dec 2021 12:39:31 +0000 (UTC) (envelope-from janm@transactionware.com) Received: from mail3.transactionware.com (mail.transactionware.com [203.14.245.7]) by mx1.freebsd.org (Postfix) with SMTP id 4JMy0d0CYzz3q1l for ; Mon, 27 Dec 2021 12:39:28 +0000 (UTC) (envelope-from janm@transactionware.com) Received: (qmail 26361 invoked by uid 907); 27 Dec 2021 12:39:18 -0000 Received: from i5E86400D.versanet.de (HELO smtpclient.apple) (94.134.64.13) (smtp-auth username janm, mechanism plain) by mail3.transactionware.com (qpsmtpd/0.84) with (ECDHE-RSA-AES256-GCM-SHA384 encrypted) ESMTPSA; Mon, 27 Dec 2021 23:39:18 +1100 From: Jan Mikkelsen Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: closefrom blocking, wchan urdlck Message-Id: <2B3BA665-D42A-4B5F-AD2F-ED10E64A7276@transactionware.com> Date: Mon, 27 Dec 2021 13:39:11 +0100 To: freebsd-hackers@freebsd.org X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4JMy0d0CYzz3q1l X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of janm@transactionware.com has no SPF policy when checking 203.14.245.7) smtp.mailfrom=janm@transactionware.com X-Spamd-Result: default: False [-0.86 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[transactionware.com]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.37)[-0.365]; R_SPF_NA(0.00)[no SPF record]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:17559, ipnet:203.14.245.0/24, country:AU]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Hi, (On 11.2) I am occasionally seeing closefrom() block in a child process created by = a call to pdfork(). When this does happen, it is very early after the process has started, = while other threads are being created elsewhere in the process. I cannot = reproduce it after the thread creation is complete. According to the = sigaction man page, this should be async signal safe. Stack trace from the call to closefrom(): * frame #0: 0x000000080090276c libthr.so.3`_umtx_op_err at = _umtx_op_err.S:37 frame #1: 0x00000008008f6121 = libthr.so.3`__thr_rwlock_rdlock(rwlock=3D, = flags=3D, tsp=3D) at thr_umtx.c:307:10 frame #2: 0x00000008008ff1ac libthr.so.3`_thr_rtld_rlock_acquire = [inlined] _thr_rwlock_rdlock(rwlock=3D0x0000000800911600, flags=3D0, = tsp=3D0x0000000000000000) at thr_umtx.h:232:10 frame #3: 0x00000008008ff19b = libthr.so.3`_thr_rtld_rlock_acquire(lock=3D0x0000000800911600) at = thr_rtld.c:125 frame #4: 0x000000080075332b = ld-elf.so.1`rlock_acquire(lock=3D0x0000000800765270, = lockstate=3D0x00007fffdfbfb8d0) at rtld_lock.c:208:2 frame #5: 0x000000080074ba20 = ld-elf.so.1`_rtld_bind(obj=3D0x0000000800769000, reloff=3D6072) at = rtld.c:861:5 frame #6: 0x0000000800747c7d ld-elf.so.1`_rtld_bind_start at = rtld_start.S:121 frame #7: 0x00000000006562d3 = prog`Twio::ProcHandle::spawn(this=3D, command=3D"/bin/echo", = args=3D0x0000000800d7e000, descriptor_mapping=3D, = descriptor_end=3D3) at prochandle_pdfork.cpp:308:2 Any suggestions on how to approach this? Regards, Jan M.