public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "avi at scylladb dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/105373] miscompile involving lambda coroutines and an object bitwise copied instead of via the copy constructor
Date: Thu, 28 Apr 2022 14:59:11 +0000	[thread overview]
Message-ID: <bug-105373-4-NSpo2oocAu@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105373-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #10 from Avi Kivity <avi at scylladb dot com> ---
I have something like this:

│     2680  future<> system_keyspace_make(distributed<replica::database>&
dist_db, distributed<service::storage_service>& dist_ss,
sharded<gms::gossiper>& dist_gossiper, db::config& cfg) {               │
...
                                                                               
                                        │
│     2687      for (auto&& table : system_keyspace::all_tables(db_config)) {   

...

│     2695              co_await db.create_keyspace(ksm,
dist_ss.local().get_erm_factory(), true,
replica::database::system_keyspace::yes);   


And I see a crash as if the std::vector returned by all_tables() is not
persisted. This worked in previous gcc versions and works in clang.

I don't now what the standard says, but it really should persist temporaries in
range for that contains a suspension point, or a lot of buggy code will be
written.

  parent reply	other threads:[~2022-04-28 14:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-25  9:31 [Bug c++/105373] New: " avi at scylladb dot com
2022-04-25 11:14 ` [Bug c++/105373] " avi at scylladb dot com
2022-04-25 11:47 ` avi at scylladb dot com
2022-04-25 12:21 ` avi at scylladb dot com
2022-04-25 19:37 ` iains at gcc dot gnu.org
2022-04-26  9:38 ` avi at scylladb dot com
2022-04-26  9:43 ` avi at scylladb dot com
2022-04-26 10:07 ` avi at scylladb dot com
2022-04-28 14:29 ` avi at scylladb dot com
2022-04-28 14:52 ` avi at scylladb dot com
2022-04-28 14:59 ` avi at scylladb dot com [this message]
2022-04-28 17:28 ` avi at scylladb dot com
2022-04-28 18:59 ` iains at gcc dot gnu.org
2022-04-29 19:54 ` iains at gcc dot gnu.org
2022-05-01 14:47 ` avi at scylladb dot com
2022-05-06 11:25 ` avi at scylladb dot com
2022-11-21 13:01 ` avi at scylladb dot com
2022-12-04 14:28 ` avi at scylladb dot com
2022-12-10 12:00 ` iains at gcc dot gnu.org
2022-12-10 12:02 ` iains 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-105373-4-NSpo2oocAu@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: link
Be 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).