From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EC799385842E; Mon, 1 May 2023 12:52:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC799385842E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1682945547; bh=yuDcuGXvFF11IVGoHZdZbcVE25JIDonmafQMVt1DwZ0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=USGfEqaTVzrHB0hUSECKErAob3spmrNEMLKd4+i1b0ACwCqwYF82DZucxwe1HC2sB dbC8qPIFa690/7kGASMg7Of3uhchEBmuMLnxSMPJ+mMQNrb5hGgUG1IeKMAX0vAnFq t4tRAhAk8va5n9m0XmCDdQAciEDxl3Oc9slPnkfI= From: "carlos at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug nptl/25847] pthread_cond_signal failed to wake up pthread_cond_wait due to a bug in undoing stealing Date: Mon, 01 May 2023 12:52:18 +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.27 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: carlos at redhat dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: carlos at redhat dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_reconfirmed_on bug_status everconfirmed 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=3D25847 Carlos O'Donell changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2023-05-01 Status|UNCONFIRMED |ASSIGNED Ever confirmed|0 |1 --- Comment #54 from Carlos O'Donell --- I'm back on this bug and reviewing Frank's approach to __wseq-relative sign= als. I am intent to seeing this fixed for glibc 2.38 (August release). There are generally speaking 3 possible solutions: (1) Initially it seems like pthread_cond_wait*() could and should have decremented __g_size, but in order to do that it must take the internal con= dvar lock and also possibly quiesce and swap the groups e.g. everything that a signaller needs to do. Needing to signal in the middle of a wait complicates the acquire/release ordering of the algorithm in the wait case. Pros: Performance is preserved. Cons: Complicates algorithm. (2) Detect the missed wakeups and wake all waiters to reset the state of the condition variable. This is costly to performance but conceptually simple. Pros: Simple. Cons: Negatively impacts performance. (3) Frank's design: Make __g_signal relative to __wseq. Make it possible to know exactly when you stole a signal by putting signal order into the same total global order sequencing from __wseq. Pros: Simplifies algorithm by removing all signal stealing code. Cons: ABA case for _g_signal overflow? It goes without saying that (3), which others have tested, is the preferred solution. What I need to make sure is that we haven't introduced another regression and review the remaining acquire/release semantics and that the cleanups work correctly (which drop the use of LSB flags in several places). --=20 You are receiving this mail because: You are on the CC list for the bug.=