public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/100806] New: deadlock in std::counting_semaphore
@ 2021-05-27 21:21 gatroubo at squizzy dot net
  2021-05-28 18:08 ` [Bug libstdc++/100806] " rodgertq at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: gatroubo at squizzy dot net @ 2021-05-27 21:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100806

            Bug ID: 100806
           Summary: deadlock in std::counting_semaphore
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gatroubo at squizzy dot net
  Target Milestone: ---

Hi,

there seems to be some sort of deadlock in std::counting_semaphore. In the
following test program, I create 10 threads, each thread tries to acquire a
semaphore (initial value 4), waits 100ms, and then releases the semaphore:

https://wandbox.org/permlink/Zt3d4EC5vNOXtr9W

Most of the time, the program seems to be in a deadlock after 5 threads
acquired/released the semaphore. When I compile and run the same code with
clang 11.1 I get the expected behavoir (all 10 threads aquire/release the
semaphore and the program exits successfully):

https://wandbox.org/permlink/XjQaoyy9C6uiDYlo

Thanks for your effort to create such a great tool!
-Tobias

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-12-24 21:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-27 21:21 [Bug libstdc++/100806] New: deadlock in std::counting_semaphore gatroubo at squizzy dot net
2021-05-28 18:08 ` [Bug libstdc++/100806] " rodgertq at gcc dot gnu.org
2021-06-16 18:45 ` rodgertq at gcc dot gnu.org
2021-06-22 18:07 ` cvs-commit at gcc dot gnu.org
2021-06-22 18:08 ` cvs-commit at gcc dot gnu.org
2022-02-14 17:03 ` rodgertq at gcc dot gnu.org
2022-12-24 21:14 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).