From nobody Fri May 19 11:56:04 2023 X-Original-To: threads@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 4QN5050Mk0z4Brhf for ; Fri, 19 May 2023 11:56:05 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QN5046MJvz4cxX for ; Fri, 19 May 2023 11:56:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684497364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FQ5Nan0TczfWJpUlaG0eGprr0+nFCSUDdfvCnaGm4HM=; b=kXfYb8VsKzx0CAo1W5oZsvcOla7jXVFxUfI7U75006EnFITLX6rSFTh3pqiKrroluYCi2K lAEo/glZQWfCNZM1J9Xx+n1LZO7I5HlOWidk/YSSta3LMitxNRG01Yx5ho4RFbgkP3EsaY Avqg6r14iAlvt1KAf5iDRQl0FiZ0a9Mf9Gu/MgeATFE7tqzOLdfpLsa1R38UBdxdEAlII5 8hFnguVjfyGVZy+yOxlKkheZKXYsVzTBjxLWtyDH5jDCnNBob0fEaU//rtJpkMjJyMRWxs g2ze4Ta8ZyFcdJO/rOBJ20r6gS/RWmbGi3SF8qNEv1M9KTXVnlAb9KZAeBGLoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684497364; a=rsa-sha256; cv=none; b=eep9MEJ1AmOT2bjjBTUGCEsvHtggyoxOsf3K4pH34E91CZqv4QrFoxNhkLZJwX4u9aJmSY +U3v8/fU+jLTfpnNXHHjY+iJkfTuxv2PMh6PCbBklMWKiZ1npeBaJdiuVSmwPtT74raapz mLAEUASu2pTBSouGJ26FDOhkILaGdcPbjIhc6m9ztkT4rUPajMMOMdIXdUTX18qc4ZCVsp uODA/wxocR7Eo18l+zLZqA9BsQODki8mel0wWhnykh2jUUipJhN1UHjsvq+VcIhDoE4IoQ U68UaDAGgujX2PYloAnG2lBTNSD6IeAO9PfRnOShJEDf6v2keYFI3m0q9wID0A== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QN5045MQ4zRrh for ; Fri, 19 May 2023 11:56:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 34JBu4Yg005216 for ; Fri, 19 May 2023 11:56:04 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 34JBu4xx005215 for threads@FreeBSD.org; Fri, 19 May 2023 11:56:04 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: threads@FreeBSD.org Subject: [Bug 271490] Deadlock between _rtld_atfork_pre and _thr_attr_init Date: Fri, 19 May 2023 11:56:04 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: threads X-Bugzilla-Version: 13.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: kj@kjtsanaktsidis.id.au X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: threads@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Threading List-Archive: https://lists.freebsd.org/archives/freebsd-threads List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-threads@freebsd.org X-BeenThere: freebsd-threads@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271490 --- Comment #9 from KJ Tsanaktsidis --- Ahah! I managed to make an isolated program which causes the issue. See the file `reproduction.c` I added as an attachment. This will eventually hang not printing anything, and attaching GDB to the c= hild process (not the parent) will show a similar stack trace going through `_rtld_atfork_pre`: ``` clang -std=3Dc11 reproduction.c -lpthread -o reproduction while true; do ./reproduction; done; ``` However, this will _NOT_ hang: ``` while true; do LD_BIND_NOW=3Dyes ./reproduction; done; ``` (on my machine, in any case). The trick seems to be doing a multithreaded fork, followed by _another_ multithreaded fork. Thanks again for having a look at this Konstantin! --=20 You are receiving this mail because: You are the assignee for the bug.=