Re: [PATCH] libstdc++: retry removal of dir entries if dir removal fails

2022-07-05 Thread Alexandre Oliva via Gcc-patches
On Jun 30, 2022, Sebastian Huber wrote: > From my point of view this is behaviour is an RTEMS bug. Instead of > adding tweaks for RTEMS, it would be better to report the issues and > fix them in RTEMS. It could be also a Newlib issue. Thanks, I've just filed https://devel.rtems.org/ticket/4674

Re: [PATCH] libstdc++: retry removal of dir entries if dir removal fails

2022-06-30 Thread Sebastian Huber
On 30/06/2022 09:52, Alexandre Oliva via Gcc-patches wrote: On Jun 27, 2022, Alexandre Oliva wrote: I see two potential ways to avoid this: Another possibility occurred to me: seeking back to the entry we're about to remove, before removing it. Then, POSIX-compliant implementations will j

Re: [PATCH] libstdc++: retry removal of dir entries if dir removal fails

2022-06-30 Thread Alexandre Oliva via Gcc-patches
On Jun 27, 2022, Alexandre Oliva wrote: > I see two potential ways to avoid this: Another possibility occurred to me: seeking back to the entry we're about to remove, before removing it. Then, POSIX-compliant implementations will just skip the removed entry and find the next one, while RTEMS wi

Re: [PATCH] libstdc++: retry removal of dir entries if dir removal fails

2022-06-28 Thread Alexandre Oliva via Gcc-patches
On Jun 27, 2022, Alexandre Oliva wrote: > (ii) arrange for recursive_directory_iterator to rewind a dir from > which entries have been _erase()d before returning to the parent dir Here's an implementation of the above. I kind of like it; it's far more elegant than the earlier patch, and if it s

Re: [PATCH] libstdc++: retry removal of dir entries if dir removal fails

2022-06-27 Thread Alexandre Oliva via Gcc-patches
On Jun 22, 2022, Jonathan Wakely wrote: > I haven't properly reviewed it yet Nevermind that one, it's broken because I hadn't realized the recursive iteration. It fails and throws/errors out when we attempt to __erase a subdir that wasn't successfully emptied because some of its entries were sk

Re: [PATCH] libstdc++: retry removal of dir entries if dir removal fails

2022-06-22 Thread Alexandre Oliva via Gcc-patches
On Jun 22, 2022, Jonathan Wakely wrote: > It looks like it would be possible for this to livelock. True > The current > implementation will fail with an error in that case, rather than > getting stuck forever in a loop. In the equivalent livelock scenario, newly-added dir entries are added to

Re: [PATCH] libstdc++: retry removal of dir entries if dir removal fails

2022-06-22 Thread Jonathan Wakely via Gcc-patches
On Wed, 22 Jun 2022 at 07:20, Alexandre Oliva via Libstdc++ wrote: > > > On some target systems (e.g. rtems6.0), removing directory components > while iterating over directory entries may cause some of the directory > entries to be skipped, which prevents the removal of the parent > directory from