From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6694C39540A3; Tue, 1 Dec 2020 23:07:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6694C39540A3 From: "tuliom at ascii dot art.br" To: glibc-bugs@sourceware.org Subject: [Bug nptl/26964] pthread_mutex_timedlock returning EAGAIN after futex is locked Date: Tue, 01 Dec 2020 23:07:26 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: nptl X-Bugzilla-Version: 2.33 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tuliom at ascii dot art.br X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: lamm at linux dot ibm.com X-Bugzilla-Target-Milestone: 2.33 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: target_milestone resolution bug_status 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 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2020 23:07:26 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26964 Tulio Magno Quites Machado Filho changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.33 Resolution|--- |FIXED Status|ASSIGNED |RESOLVED --- Comment #1 from Tulio Magno Quites Machado Filho --- Fixed with: commit 61855081017dff30c577855cda882740356b5d98 Author: Lucas A. M. Magalhaes Date: Tue Dec 1 18:05:07 2020 -0300 nptl: Fix __futex_clocklock64 return error check [BZ #26964] The earlier implementation of this, __lll_clocklock, calls lll_clockwait that doesn't return the futex syscall error codes. It always tries aga= in if that fails. However in the current implementation, when the futex returns EAGAIN, __futex_clocklock64 will also return EGAIN, even if the futex is taken. This patch fixes the EAGAIN issue and also adds a check for EINTR. As futex syscall can return EINTR if the thread is interrupted by a signal. In this case I'm assuming the function should continue trying to lock as there is no mention to about it on POSIX. Also add a test for both scenarios. --=20 You are receiving this mail because: You are on the CC list for the bug.=