[Issue 23654] execv_: toAStringz: memory corruption

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Aug 30 08:51:51 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=23654

--- Comment #9 from Steven Schveighoffer <schveiguy at gmail.com> ---
(In reply to anonymous4 from comment #6)
> Doesn't fork break the GC heap? If you want to allocate from GC after fork,
> it may not work.

fork *can* hang if another thread is holding the GC lock. But we can
potentially work around this if we take the GC lock before calling fork.

But using the GC has always been a part of this, it's not new. The toAStringz
is using the GC. The problem with the original change is it moved the
allocation of the array (which points at GC memory) from a scannable place to a
non-scannable place.

--


More information about the Digitalmars-d-bugs mailing list