public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "arakawamasahiro at jp dot fujitsu.com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/113761] New: Abnormal program termination using libstdc++ Date: Mon, 05 Feb 2024 08:38:34 +0000 [thread overview] Message-ID: <bug-113761-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113761 Bug ID: 113761 Summary: Abnormal program termination using libstdc++ Product: gcc Version: 12.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: arakawamasahiro at jp dot fujitsu.com Target Milestone: --- If you compile the following program with g++-11.4.0 and run it using libstdc++ 12.3.0, the executable program will terminate abnormally. [program(test.cpp)] #include <iostream> #include <random> #include <cassert> double f(double x) { return x*2; } int main() { typedef std::piecewise_constant_distribution<> D; D d({}, f); std::vector<double> iv = d.intervals(); return 0; } [Compile and execute log] $ g++ test.cpp $ LANG=C; ./a.out terminate called after throwing an instance of 'std::length_error' what(): vector::reserve Aborted (core dumped) The {} specified in the first argument of variable d in the std:: piecewise_constant_distribution<> class reduces the list size to 0. Given the constraints of the constructor of the std:: piecewise_constant_distribution<> class, you should expect a pattern where the list size is zero.
next reply other threads:[~2024-02-05 8:38 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-02-05 8:38 arakawamasahiro at jp dot fujitsu.com [this message] 2024-02-05 8:57 ` [Bug libstdc++/113761] " pinskia at gcc dot gnu.org 2024-02-05 9:00 ` pinskia at gcc dot gnu.org 2024-02-05 9:03 ` [Bug libstdc++/113761] piecewise_constant_distribution's initializer_list constructor is not correct for `size < 2` pinskia at gcc dot gnu.org 2024-02-05 10:55 ` redi at gcc dot gnu.org 2024-02-05 11:32 ` redi at gcc dot gnu.org 2024-02-05 11:51 ` pinskia at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-113761-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).