public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/56109] New: Add light-weight ABI-compatible debug checks to standard containers
@ 2013-01-25 14:48 ppluzhnikov at google dot com
  2014-10-13 14:22 ` [Bug libstdc++/56109] " redi at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: ppluzhnikov at google dot com @ 2013-01-25 14:48 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56109

             Bug #: 56109
           Summary: Add light-weight ABI-compatible debug checks to
                    standard containers
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ppluzhnikov@google.com


Google has implemented a series of patches which allows us to catch many STL
mis-use bugs cheaply and in ABI-compatible way:

http://gcc.gnu.org/ml/gcc-patches/2013-01/msg01186.html
http://gcc.gnu.org/ml/gcc-patches/2013-01/msg01074.html and more ...
(just look for __google_stl in google/integration branch).

Some of the bugs we catch this way are not visible to "standard" tools like
Valgrind and AddressSanitizer.

These bugs (and more) *are* visible to _GLIBCXX_DEBUG mode, but we've not been
able to use that mode due to source incompatibilities, and it has ABI
implications as well.

Please consider adding a light-weight ABI-compatible debug mode to trunk, once
it re-opens for stage 1.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/56109] Add light-weight ABI-compatible debug checks to standard containers
  2013-01-25 14:48 [Bug libstdc++/56109] New: Add light-weight ABI-compatible debug checks to standard containers ppluzhnikov at google dot com
@ 2014-10-13 14:22 ` redi at gcc dot gnu.org
  2015-09-07 14:02 ` redi at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2014-10-13 14:22 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-10-13
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Confirmed.

c.f. https://gcc.gnu.org/ml/libstdc++/2014-06/msg00105.html


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/56109] Add light-weight ABI-compatible debug checks to standard containers
  2013-01-25 14:48 [Bug libstdc++/56109] New: Add light-weight ABI-compatible debug checks to standard containers ppluzhnikov at google dot com
  2014-10-13 14:22 ` [Bug libstdc++/56109] " redi at gcc dot gnu.org
@ 2015-09-07 14:02 ` redi at gcc dot gnu.org
  2015-09-09 17:15 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2015-09-07 14:02 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/56109] Add light-weight ABI-compatible debug checks to standard containers
  2013-01-25 14:48 [Bug libstdc++/56109] New: Add light-weight ABI-compatible debug checks to standard containers ppluzhnikov at google dot com
  2014-10-13 14:22 ` [Bug libstdc++/56109] " redi at gcc dot gnu.org
  2015-09-07 14:02 ` redi at gcc dot gnu.org
@ 2015-09-09 17:15 ` redi at gcc dot gnu.org
  2020-09-02 16:57 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2015-09-09 17:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
As of r227595 trunk now supports a _GLIBCXX_ASSERTIONS macro that enables
lightweight checks. We will start merging some of the __google_stl checks to
trunk and enabling them with that macro (which might give you a number of merge
conflicts on your branch, sorry!)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/56109] Add light-weight ABI-compatible debug checks to standard containers
  2013-01-25 14:48 [Bug libstdc++/56109] New: Add light-weight ABI-compatible debug checks to standard containers ppluzhnikov at google dot com
                   ` (2 preceding siblings ...)
  2015-09-09 17:15 ` redi at gcc dot gnu.org
@ 2020-09-02 16:57 ` redi at gcc dot gnu.org
  2024-01-17 12:08 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2020-09-02 16:57 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|redi at gcc dot gnu.org            |unassigned at gcc dot gnu.org
             Status|ASSIGNED                    |NEW

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The __google_stl_* checks were added by these commits ...

Strict weak ordering checks in algos and RB trees:
8cc511b5e5c0814584644c90cb0d65d27182eddd

Invariant checks and range checks in vector<bool>:
ceeb7c3b17883b21f523ab0bef937f654b12eceb

Range checks in deque: 0681de38f1f402ad5f1fd9cf9959f304c36f7c10

Non-empty checks in vector: 2b4e2a67ff643ebdc4dababd95010699918ad9e0
Dead stores in vector dtor: e1a3b2e088d16544b6b64e483e12ae77a813a274
Invariant checks in vector: 7a058129926f4838bc1344f3674c1a35052a03e4
Range checks in vector and vstring, scribbling in cleared vstring:
13480920300b3cf5f09d408fe249c873fbef1ee0

All the range checks and non-empty checks should be already enabled by
_GLIBCXX_ASSERTIONS.

The invariant checking and strict weak order checks may be too expensive to add
to _GLIBCXX_ASSERTIONS.

We could consider adding the dead stores in the destructors to wipe out the
memory, so that subsequent accesses fail fast. Those stores should be optimised
away so will have no cost in optimised builds, but might help in -O0 builds
when debugging.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/56109] Add light-weight ABI-compatible debug checks to standard containers
  2013-01-25 14:48 [Bug libstdc++/56109] New: Add light-weight ABI-compatible debug checks to standard containers ppluzhnikov at google dot com
                   ` (3 preceding siblings ...)
  2020-09-02 16:57 ` redi at gcc dot gnu.org
@ 2024-01-17 12:08 ` redi at gcc dot gnu.org
  2024-01-17 16:06 ` ppluzhnikov at google dot com
  2024-01-17 16:50 ` redi at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2024-01-17 12:08 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=86843,
                   |                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=56103

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #3)
> The __google_stl_* checks were added by these commits ...
> 
> Strict weak ordering checks in algos and RB trees:
> 8cc511b5e5c0814584644c90cb0d65d27182eddd
> 
> Invariant checks and range checks in vector<bool>:
> ceeb7c3b17883b21f523ab0bef937f654b12eceb
> 
> Range checks in deque: 0681de38f1f402ad5f1fd9cf9959f304c36f7c10
> 
> Non-empty checks in vector: 2b4e2a67ff643ebdc4dababd95010699918ad9e0
> Dead stores in vector dtor: e1a3b2e088d16544b6b64e483e12ae77a813a274
> Invariant checks in vector: 7a058129926f4838bc1344f3674c1a35052a03e4
> Range checks in vector and vstring, scribbling in cleared vstring:
> 13480920300b3cf5f09d408fe249c873fbef1ee0
> 
> All the range checks and non-empty checks should be already enabled by
> _GLIBCXX_ASSERTIONS.
> 
> The invariant checking and strict weak order checks may be too expensive to
> add to _GLIBCXX_ASSERTIONS.

But see PR 86843.

> We could consider adding the dead stores in the destructors to wipe out the
> memory, so that subsequent accesses fail fast. Those stores should be
> optimised away so will have no cost in optimised builds, but might help in
> -O0 builds when debugging.

That's PR 56103.

So is there any reason to keep this PR open? Are there still checks we should
copy from the google branch?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/56109] Add light-weight ABI-compatible debug checks to standard containers
  2013-01-25 14:48 [Bug libstdc++/56109] New: Add light-weight ABI-compatible debug checks to standard containers ppluzhnikov at google dot com
                   ` (4 preceding siblings ...)
  2024-01-17 12:08 ` redi at gcc dot gnu.org
@ 2024-01-17 16:06 ` ppluzhnikov at google dot com
  2024-01-17 16:50 ` redi at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: ppluzhnikov at google dot com @ 2024-01-17 16:06 UTC (permalink / raw)
  To: gcc-bugs

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

Paul Pluzhnikov <ppluzhnikov at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |WONTFIX
             Status|NEW                         |RESOLVED

--- Comment #5 from Paul Pluzhnikov <ppluzhnikov at google dot com> ---
Already covered by PR 86843 and PR 56103.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/56109] Add light-weight ABI-compatible debug checks to standard containers
  2013-01-25 14:48 [Bug libstdc++/56109] New: Add light-weight ABI-compatible debug checks to standard containers ppluzhnikov at google dot com
                   ` (5 preceding siblings ...)
  2024-01-17 16:06 ` ppluzhnikov at google dot com
@ 2024-01-17 16:50 ` redi at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2024-01-17 16:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Thanks, Paul.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-01-17 16:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-25 14:48 [Bug libstdc++/56109] New: Add light-weight ABI-compatible debug checks to standard containers ppluzhnikov at google dot com
2014-10-13 14:22 ` [Bug libstdc++/56109] " redi at gcc dot gnu.org
2015-09-07 14:02 ` redi at gcc dot gnu.org
2015-09-09 17:15 ` redi at gcc dot gnu.org
2020-09-02 16:57 ` redi at gcc dot gnu.org
2024-01-17 12:08 ` redi at gcc dot gnu.org
2024-01-17 16:06 ` ppluzhnikov at google dot com
2024-01-17 16:50 ` redi at gcc dot gnu.org

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).