From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5231A3858D28; Tue, 17 Jan 2023 19:37:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5231A3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673984222; bh=oAlZXCpymSCznnD1bviVgt9eZ8N36CcVIyFCGI8GpIE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZHpiugSikh/fd8xC1IcOMi0u2d/0VskGCMI4sZPydL7v0yGFlN1THqxy5heIt2U3g MOrszMmYWhFN2nbmNf1Te7WumQoSuo/HAUMFHxmwIjGJNsgN7xwjpMcm3Gy1mk8ZIA hYR7VOyQRhV59NSK6A9IQW95MgUEffYRK9WF8KSE= From: "gustaf.waldemarson at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/107965] libstdc++ Python Pretty-Printers: Many Exceptions From Uninitialized Structures Date: Tue, 17 Jan 2023 19:37:01 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gustaf.waldemarson at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107965 --- Comment #7 from Gustaf Waldemarson --- Very interesting to see so many people chime in on this. Since I arguably agree that this looks like a GDB bug than an error in the printers. To that end, I went ahead and registered this [ticket](https://sourceware.org/bugzilla/show_bug.cgi?id=3D30018) here. Ple= ase feel free to add some more details if you have time, as some of the details presented here is admittedly a bit beyond my skills. All that said, I still think that the pretty printers should be a bit more defensive to errors and conservative with what it outputs. E.g., presenting= an error message once, due to something like this is fine in my opinion, but displaying hundreds of lines with the same error just because some function uses a hash-map is clearly excessive. To that end, perhaps it would make sense to defend the `to_string`=C2=A0cal= ls (and possibly others) with something like this: seen_errors =3D {} # ... try: to_string(...) except Exception as ex: if ex not in seen_errors: seen_errors.add(ex) raise ex Admittedly, I don't know all the details here, so perhaps this isn't feasib= le?=