Re: libstdc++: Fix deadlock in debug iterator increment [PR108288]

2023-01-15 Thread François Dumont via Gcc-patches
Committed with the idiomatic approach. I'll work on this additional check later. On 12/01/23 22:35, Jonathan Wakely wrote: On Thu, 12 Jan 2023 at 18:25, François Dumont wrote: On 12/01/23 13:00, Jonathan Wakely wrote: On Thu, 12 Jan 2023 at 05:52, François Dumont wrote: Small update for an

Re: libstdc++: Fix deadlock in debug iterator increment [PR108288]

2023-01-12 Thread Jonathan Wakely via Gcc-patches
On Thu, 12 Jan 2023 at 18:25, François Dumont wrote: > > On 12/01/23 13:00, Jonathan Wakely wrote: > > On Thu, 12 Jan 2023 at 05:52, François Dumont wrote: > >> Small update for an obvious compilation issue and to review new test > >> case that could have lead to an infinite loop if the increment

Re: libstdc++: Fix deadlock in debug iterator increment [PR108288]

2023-01-12 Thread François Dumont via Gcc-patches
On 12/01/23 13:00, Jonathan Wakely wrote: On Thu, 12 Jan 2023 at 05:52, François Dumont wrote: Small update for an obvious compilation issue and to review new test case that could have lead to an infinite loop if the increment issue was not detected. I also forgot to ask if there is more chance

Re: libstdc++: Fix deadlock in debug iterator increment [PR108288]

2023-01-12 Thread Jonathan Wakely via Gcc-patches
On Thu, 12 Jan 2023 at 05:52, François Dumont wrote: > > Small update for an obvious compilation issue and to review new test > case that could have lead to an infinite loop if the increment issue was > not detected. > > I also forgot to ask if there is more chance for the instantiation to be > eli

Re: libstdc++: Fix deadlock in debug iterator increment [PR108288]

2023-01-11 Thread François Dumont via Gcc-patches
Small update for an obvious compilation issue and to review new test case that could have lead to an infinite loop if the increment issue was not detected. I also forgot to ask if there is more chance for the instantiation to be elided when it is implemented like in the _Safe_local_iterator:

Re: [committed] libstdc++: Fix deadlock in debug iterator increment [PR108288]

2023-01-10 Thread François Dumont via Gcc-patches
Thanks for fixing this. Here is the extension of the fix to all post-increment/decrement operators we have on _GLIBCXX_DEBUG iterator. I prefer to restore somehow previous implementation to continue to have _GLIBCXX_DEBUG post operators implemented in terms of normal post operators. I also

[committed] libstdc++: Fix deadlock in debug iterator increment [PR108288]

2023-01-06 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. I think we should backport this too, after some soak time on trunk. -- >8 -- With -fno-elide-constructors the debug iterator post-increment and post-decrement operators are susceptible to deadlock. They take a mutex lock and then return a temporary, which al