From nobody Wed Jul 17 03:54:25 2024 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 4WP2B91yj2z5QtrD for ; Wed, 17 Jul 2024 03:54:25 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WP2B86v8dz4tky for ; Wed, 17 Jul 2024 03:54:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721188465; a=rsa-sha256; cv=none; b=cZ5ERs20Ms7mNhrC4VnOcc0zGqZEZW+V4nusUuH5cUi5/ze/99XGx6/dUiJHuWFozVRels CceWbONQ1Nwsx/ojYTjX1zoTrZ7HacVpLdM4AmgTm9aLHiQrS0XzMHZhoCvLETWjygFy1p 4fDmqXGAO8R79y6gBDAzVw/PMADM63aJ0/beDavVyC9UnEXvL19VqB9SlMcNynNvp91fVO QfDemAwCbf3Sw7sBJ/L/GTVs7dRuun3I4dRTRMXFUIkLdmaCUlXy8N029M8qQgYUpwCysq +wDdHt3S2HZL+tCIquSRCutDXdth5PhtAR9kBUXEa01Si3O754Vs0+AZQAA0rA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721188465; 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=Cy7nMaAJDSdRvBKNWUqGoRnYwHnVgdBwZ36Z+GaYvoU=; b=vrIfLc89Wm0Sl4zYEW3VxtOVIOML2AJPMJ8L8nWWlaWZqvb2U01RxtkEFgMU/OC8akqUC5 YHua9ImdNpZbYARVV8p+AeQnz850tkoN7nCA8J5LTeOAm/a0PJ9zow0Ows6SqYAvdHjuZt f9hj8+YRSbwOaHusqkQv6d4LMnjLG+6vMzPnOXGAYUcaWIWeAefOl52hwkse38Fg9rS3NF r280mt8Xt0ALIkXj6kz1TjCKG0DPqvQgsmz8DQlVTigL+n409twJ62D7gu5x1Sew43sWIX YJCRGdF78Xs/EpC2frDwXlM9jwHHL2HD8QAoDjiUdVq8L3O0H3sTFw1cokYiVw== 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 4WP2B86Tcyz147N for ; Wed, 17 Jul 2024 03:54:24 +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 46H3sONP097455 for ; Wed, 17 Jul 2024 03:54:24 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 46H3sOBe097454 for threads@FreeBSD.org; Wed, 17 Jul 2024 03:54:24 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 280318] fork() can deadlock on rtld_phdr_lock Date: Wed, 17 Jul 2024 03:54:25 +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: 14.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: kib@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: threads@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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: X-BeenThere: freebsd-threads@freebsd.org Sender: owner-freebsd-threads@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D280318 Konstantin Belousov changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kib@FreeBSD.org --- Comment #1 from Konstantin Belousov --- This is expected: we lock phdr lock over the whole dl_iterate_phdr, includi= ng the callback. To make dl_iterate_phdr() functional after the fork, pre-fork code also locks the phdr lock. See ef2c2a692b75d644549827b3aaa9f1736940fe85 for some references about the need of the phdr lock. Since your example blocks in the callback, it is blocked owning the phdr lo= ck, and fork cannot proceed. In principle, dl_iterate_phdr() is not required to be useful after fork(). I can add a knob to select the behavior, but I do not see how could it be made both. --=20 You are receiving this mail because: You are the assignee for the bug.=