public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/114359] New: std::binomial_distribution hangs in infinite loop
@ 2024-03-16  3:55 angelo.landi at outlook dot com
  2024-03-16  4:02 ` [Bug libstdc++/114359] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: angelo.landi at outlook dot com @ 2024-03-16  3:55 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114359
           Summary: std::binomial_distribution hangs in infinite loop
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: angelo.landi at outlook dot com
  Target Milestone: ---

Created attachment 57715
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57715&action=edit
minimal example to expose the issue

Due to an integer overflow: in any std::binomial_distribution<IntType>
initialized with 2^n trials with n >= (bit size of IntType) - 2, operator()
will be stuck in the do-while(__reject) loop forever.

The issue was originally found on StackOverflow by user Floyd Everest:
https://stackoverflow.com/questions/75179395/stdbinomial-distribution-hangs-forever-with-certain-inputs/75179982

You can find a more detailed explanation of the issue in my answer to that
post:
https://stackoverflow.com/questions/75179395/stdbinomial-distribution-hangs-forever-with-certain-inputs/75179982#75179982

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

end of thread, other threads:[~2024-05-14  9:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-16  3:55 [Bug libstdc++/114359] New: std::binomial_distribution hangs in infinite loop angelo.landi at outlook dot com
2024-03-16  4:02 ` [Bug libstdc++/114359] " pinskia at gcc dot gnu.org
2024-03-16  5:08 ` angelo.landi at outlook dot com
2024-03-16 10:10 ` redi at gcc dot gnu.org
2024-03-16 10:18 ` redi at gcc dot gnu.org
2024-03-18 13:40 ` redi at gcc dot gnu.org
2024-03-19 16:00 ` cvs-commit at gcc dot gnu.org
2024-03-19 16:02 ` redi at gcc dot gnu.org
2024-05-14  9:52 ` cvs-commit at gcc dot gnu.org
2024-05-14  9:56 ` redi 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).