public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/91910] Debug mode: there is a racing condition between destructors of iterator and the associated container.
       [not found] <bug-91910-4@http.gcc.gnu.org/bugzilla/>
@ 2021-06-09  9:48 ` redi at gcc dot gnu.org
  2023-09-11 16:07 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2021-06-09  9:48 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |9.3
         Resolution|---                         |FIXED

--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This is fixed in all active branches.

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

* [Bug libstdc++/91910] Debug mode: there is a racing condition between destructors of iterator and the associated container.
       [not found] <bug-91910-4@http.gcc.gnu.org/bugzilla/>
  2021-06-09  9:48 ` [Bug libstdc++/91910] Debug mode: there is a racing condition between destructors of iterator and the associated container redi at gcc dot gnu.org
@ 2023-09-11 16:07 ` cvs-commit at gcc dot gnu.org
  2023-11-09  8:09 ` cvs-commit at gcc dot gnu.org
  2024-03-18 14:04 ` cvs-commit at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-09-11 16:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:4a2766ed00a47904dc8b85bf0538aa116d8e658b

commit r14-3846-g4a2766ed00a47904dc8b85bf0538aa116d8e658b
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Sep 11 16:42:54 2023 +0100

    libstdc++: Remove unconditional use of atomics in Debug Mode

    The fix for PR 91910 (r10-3426-gf7a3a382279585) introduced unconditional
    uses of atomics into src/c++11/debug.cc, which causes linker errors for
    arm4t where GCC emits an unresolved reference to __sync_synchronize.

    By making the uses of atomics depend on _GLIBCXX_HAS_GTHREADS we can
    avoid those unconditional references to __sync_synchronize for targets
    where the atomics are unnecessary. As a minor performance optimization
    we can also check the __gnu_cxx::__is_single_threaded function to avoid
    atomics for single-threaded programs even where they don't cause linker
    errors.

    libstdc++-v3/ChangeLog:

            * src/c++11/debug.cc (acquire_sequence_ptr_for_lock): New
            function.
            (reset_sequence_ptr): New function.
            (_Safe_iterator_base::_M_detach)
            (_Safe_local_iterator_base::_M_detach): Replace bare atomic_load
            with acquire_sequence_ptr_for_lock.
            (_Safe_iterator_base::_M_reset): Replace bare atomic_store with
            reset_sequence_ptr.

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

* [Bug libstdc++/91910] Debug mode: there is a racing condition between destructors of iterator and the associated container.
       [not found] <bug-91910-4@http.gcc.gnu.org/bugzilla/>
  2021-06-09  9:48 ` [Bug libstdc++/91910] Debug mode: there is a racing condition between destructors of iterator and the associated container redi at gcc dot gnu.org
  2023-09-11 16:07 ` cvs-commit at gcc dot gnu.org
@ 2023-11-09  8:09 ` cvs-commit at gcc dot gnu.org
  2024-03-18 14:04 ` cvs-commit at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-11-09  8:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:

https://gcc.gnu.org/g:0fc5cc6e5a2dfd7dbdd20bc27f975eed155ffb91

commit r13-8020-g0fc5cc6e5a2dfd7dbdd20bc27f975eed155ffb91
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Sep 11 16:42:54 2023 +0100

    libstdc++: Remove unconditional use of atomics in Debug Mode

    The fix for PR 91910 (r10-3426-gf7a3a382279585) introduced unconditional
    uses of atomics into src/c++11/debug.cc, which causes linker errors for
    arm4t where GCC emits an unresolved reference to __sync_synchronize.

    By making the uses of atomics depend on _GLIBCXX_HAS_GTHREADS we can
    avoid those unconditional references to __sync_synchronize for targets
    where the atomics are unnecessary. As a minor performance optimization
    we can also check the __gnu_cxx::__is_single_threaded function to avoid
    atomics for single-threaded programs even where they don't cause linker
    errors.

    libstdc++-v3/ChangeLog:

            * src/c++11/debug.cc (acquire_sequence_ptr_for_lock): New
            function.
            (reset_sequence_ptr): New function.
            (_Safe_iterator_base::_M_detach)
            (_Safe_local_iterator_base::_M_detach): Replace bare atomic_load
            with acquire_sequence_ptr_for_lock.
            (_Safe_iterator_base::_M_reset): Replace bare atomic_store with
            reset_sequence_ptr.

    (cherry picked from commit 4a2766ed00a47904dc8b85bf0538aa116d8e658b)

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

* [Bug libstdc++/91910] Debug mode: there is a racing condition between destructors of iterator and the associated container.
       [not found] <bug-91910-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2023-11-09  8:09 ` cvs-commit at gcc dot gnu.org
@ 2024-03-18 14:04 ` cvs-commit at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-18 14:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:

https://gcc.gnu.org/g:73d0816f570c26e856d94d56491e50332fd8b425

commit r12-10237-g73d0816f570c26e856d94d56491e50332fd8b425
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Sep 11 16:42:54 2023 +0100

    libstdc++: Remove unconditional use of atomics in Debug Mode

    The fix for PR 91910 (r10-3426-gf7a3a382279585) introduced unconditional
    uses of atomics into src/c++11/debug.cc, which causes linker errors for
    arm4t where GCC emits an unresolved reference to __sync_synchronize.

    By making the uses of atomics depend on _GLIBCXX_HAS_GTHREADS we can
    avoid those unconditional references to __sync_synchronize for targets
    where the atomics are unnecessary. As a minor performance optimization
    we can also check the __gnu_cxx::__is_single_threaded function to avoid
    atomics for single-threaded programs even where they don't cause linker
    errors.

    libstdc++-v3/ChangeLog:

            * src/c++11/debug.cc (acquire_sequence_ptr_for_lock): New
            function.
            (reset_sequence_ptr): New function.
            (_Safe_iterator_base::_M_detach)
            (_Safe_local_iterator_base::_M_detach): Replace bare atomic_load
            with acquire_sequence_ptr_for_lock.
            (_Safe_iterator_base::_M_reset): Replace bare atomic_store with
            reset_sequence_ptr.

    (cherry picked from commit 4a2766ed00a47904dc8b85bf0538aa116d8e658b)

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

end of thread, other threads:[~2024-03-18 14:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-91910-4@http.gcc.gnu.org/bugzilla/>
2021-06-09  9:48 ` [Bug libstdc++/91910] Debug mode: there is a racing condition between destructors of iterator and the associated container redi at gcc dot gnu.org
2023-09-11 16:07 ` cvs-commit at gcc dot gnu.org
2023-11-09  8:09 ` cvs-commit at gcc dot gnu.org
2024-03-18 14:04 ` cvs-commit 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).