From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1DFAB385B535; Fri, 5 May 2023 23:44:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1DFAB385B535 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1683330275; bh=TR0vQEwp2CyP9xxvnmpQtr/ssdREVauKBZheeAXrcac=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nSeSib8CMrBVYhk7BrcyHmNTcc3yddfOqJqRy6On5xQZcvCvuDYY/RXX9HBewg4hM 1U7oeboC1XteKakdbFaxMudiPakUWYH8bLfrw7AMgs/Gvx+6AMqtz93MkQy4pJjgJL voPcsT1SM1nGpzJ3sxe/T7ZA6dv8RUXuT9yGWWHQ= 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: Fri, 05 May 2023 23:44:32 +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: 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 --- Comment #59 from Carlos O'Donell --- I can walk the reproducer with 8 threads to the point where the state looks like this: $210 =3D "pthread_cond_t" =3D { __wseq >> 1 =3D 4 __wseq G2 =3D 1 __g1_start >> 1 =3D 2 __g1_start G2 =3D 1 __g1_orig_size >> 2 =3D 2 __g1_orig_size UNLOCKED =3D 0 __wrefs >> 3 =3D 4 __g_refs =3D { 0 / 0 , 0 / 0 } __g_signals =3D { 0 / 0, 0 / 0 } __g_size =3D { 1 , 0 } __wrefs CLOCK_REALTIME __wrefs Private =3D } At this point a pthread_cond_signal will consider a quiesce based on __g_size[0] (since __wseq G2 is 1, so G1 is 0) and will not because __g_siz= e[0] =3D=3D 1. The thread will not see a __g1_start larger than its own sequence number. I agree that at this point we seem stuck with a lost signal because __g_siz= e[0] =3D=3D 1 out of sync with the delivery of the signal. --=20 You are receiving this mail because: You are on the CC list for the bug.=