Closed
Description
I stumbled on this while debugging #66936
I tried calling TypedArena::alloc_from_iter
with an iterator which itself allocates on the arena.
If that iterator has fixed size (known through size_hint
), the allocation goes in the fast path.
In that case, the allocation for the range and the recursive allocations get interlaced.
The returned pointers are wrong, and valid objects get overwritten.
This can lead to undropped objects and infinite loops.
A simple fix has been committed to #66936.
A more intelligent one may be better.