public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "ppalka at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/100863] 23_containers/unordered_{map,set}/allocator/default_init.cc still fail at runtime even after r12-1153 Date: Wed, 02 Jun 2021 02:57:31 +0000 [thread overview] Message-ID: <bug-100863-4-AkG1jxeNtt@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-100863-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100863 --- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> --- The problem seems to be that default initialization of an unordered_map/set only default initializes the allocator object rather than value initializing it. This means the allocator's state doesn't get implicitly zeroed out, which causes the assert inside test01() to fail. A potential fix is to make _Hashtable_alloc's default constructor value initialize the allocator object: --- a/libstdc++-v3/include/bits/hashtable_policy.h +++ b/libstdc++-v3/include/bits/hashtable_policy.h @@ -1856,7 +1856,10 @@ namespace __detail using __buckets_alloc_traits = std::allocator_traits<__buckets_alloc_type>; using __buckets_ptr = __node_base_ptr*; - _Hashtable_alloc() = default; + _Hashtable_alloc() noexcept(noexcept(__ebo_node_alloc())) + : __ebo_node_alloc() + { } + _Hashtable_alloc(const _Hashtable_alloc&) = default; _Hashtable_alloc(_Hashtable_alloc&&) = default;
next prev parent reply other threads:[~2021-06-02 2:57 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-06-01 20:30 [Bug libstdc++/100863] New: " ppalka at gcc dot gnu.org 2021-06-02 2:57 ` ppalka at gcc dot gnu.org [this message] 2021-06-02 9:35 ` [Bug libstdc++/100863] " redi at gcc dot gnu.org 2021-06-02 10:50 ` redi at gcc dot gnu.org 2021-06-02 12:33 ` cvs-commit at gcc dot gnu.org 2021-06-02 12:59 ` redi at gcc dot gnu.org 2021-06-02 13:00 ` redi at gcc dot gnu.org 2021-07-19 11:47 ` redi at gcc dot gnu.org 2021-07-20 15:23 ` cvs-commit at gcc dot gnu.org 2021-07-20 15:27 ` redi at gcc dot gnu.org 2021-10-12 19:41 ` cvs-commit at gcc dot gnu.org 2021-10-12 19:41 ` cvs-commit at gcc dot gnu.org 2021-11-26 16:34 ` cvs-commit at gcc dot gnu.org 2021-11-26 16:34 ` cvs-commit 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-100863-4-AkG1jxeNtt@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).