From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DAEB13858418; Tue, 23 May 2023 18:43:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DAEB13858418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1684867411; bh=13EmaQQsAlNLlrDghRmuMob6uERzi0spu0xhOTFjyEE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ttWc0Rr9B5QnHke96T7W28Jmt7f6ELCzk5+jPUIEU4C8gS6JY2VxlQecrCf+tRum6 qJw7UR1ddQrkg2cAbOon6/NgfrGVahPvLsCc1wHWK4uIIdnlkMLWE73mpwrzJmDKUa KYoF5Yzol0OTuPdYqbHzkNyqrHIQA/Gge6bZY3Qs= From: "cvs-commit at gcc dot gnu.org" To: glibc-bugs@sourceware.org Subject: [Bug libc/20975] Deferred cancellation triggers in __check_pf and looses lock leading to deadlock. Date: Tue, 23 May 2023 18:43:30 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: 2.25 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- 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: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D20975 --- Comment #4 from cvs-commit at gcc dot gnu.org --- The release/2.37/master branch has been updated by H.J. Lu : https://sourceware.org/git/gitweb.cgi?p=3Dglibc.git;h=3Df5d377c896b95fefc71= 2b0fd5e5804ae3f48d392 commit f5d377c896b95fefc712b0fd5e5804ae3f48d392 Author: H.J. Lu Date: Thu Apr 27 13:06:15 2023 -0700 __check_pf: Add a cancellation cleanup handler [BZ #20975] There are reports for hang in __check_pf: https://github.com/JoeDog/siege/issues/4 It is reproducible only under specific configurations: 1. Large number of cores (>=3D 64) and large number of threads (> 3X of the number of cores) with long lived socket connection. 2. Low power (frequency) mode. 3. Power management is enabled. While holding lock, __check_pf calls make_request which calls __sendto and __recvmsg. Since __sendto and __recvmsg are cancellation points, lock held by __check_pf won't be released and can cause deadlock when thread cancellation happens in __sendto or __recvmsg. Add a cancellati= on cleanup handler for __check_pf to unlock the lock when cancelled by another thread. This fixes BZ #20975 and the siege hang issue. (cherry picked from commit a443bd3fb233186038b8b483959ecb7978d1abea) --=20 You are receiving this mail because: You are on the CC list for the bug.=