we have an issue in D-Scanner / libdparse that with very large files memory corruption occurs. After further investigation it seems that the contents of a string might have been moved as they are being reallocated.
The string is constructed here which calls this function which allocates the string using an appender!string.
When first constructed the string is fine but after lots of further processing of other stuff the data the string points at suddenly is no longer considered allocated by the GC (maybe moved without updating the struct members?) and is reused from other stuff (in my case it was std.regex putting ir code in there, as shown in a GDB data watchpoint that first write to it)
See https://github.com/dlang-community/libdparse/pull/387#issuecomment-863442801
Does this seem like it should be possible if all code was safe? (immutable(char)[]
being moved by GC) or do you see any obvious issues in this construct?