public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/107965] libstdc++ Python Pretty-Printers: Many Exceptions From Uninitialized Structures
Date: Mon, 05 Dec 2022 09:42:33 +0000	[thread overview]
Message-ID: <bug-107965-4-4405u0Sa4H@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107965-4@http.gcc.gnu.org/bugzilla/>

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
          Component|libstdc++                   |debug
   Last reconfirmed|                            |2022-12-05
                 CC|                            |jason at gcc dot gnu.org

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #3)
> so gdb has no idea that x only becomes live after the call to the CTOR
> (or during that).  Instead GCC says it lives throughout the whole
> function on the frame.

That's clearly a GCC bug then, because that is not how C++ works.

> Even the original IL from the frontend has no
> hint that would allow the middle-end to emit different DWARF.

So let's change component to 'debug'. There's definitely nothing the libstdc++
printers can do here.

(In reply to Richard Biener from comment #4)
> I would suggest to make the pretty-printers more robust with respect to
> memory errrors (can those errors be catched and the printing avoided
> somehow?)

There's no single type of error reported in such cases (e.g. the OverflowError
shown above depends on the specific values of the uninitialized bytes, even the
same printer won't fail with the same error every time). The only way to be
more robust is to catch *all* exceptions, and swallow all errors from any point
in the printers. That then hides real errors, and makes them impossible to
develop/debug. It would mean changes in at least 50 places, which would all
have to be individually disabled to allow real errors to propagate when trying
to debug or improve the printers. I don't want to do that.

  parent reply	other threads:[~2022-12-05  9:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-04 19:46 [Bug libstdc++/107965] New: " gustaf.waldemarson at gmail dot com
2022-12-04 20:04 ` [Bug libstdc++/107965] " pinskia at gcc dot gnu.org
2022-12-05  8:24 ` redi at gcc dot gnu.org
2022-12-05  8:45 ` rguenth at gcc dot gnu.org
2022-12-05  8:48 ` rguenth at gcc dot gnu.org
2022-12-05  9:42 ` redi at gcc dot gnu.org [this message]
2022-12-05 10:37 ` [Bug debug/107965] " redi at gcc dot gnu.org
2023-01-17 19:37 ` gustaf.waldemarson at gmail dot com
2023-01-17 20:25 ` jason 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-107965-4-4405u0Sa4H@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).