I get core.exception.InvalidMemoryOperationError@(0) when I run the following program on attached input file (XML). import std.algorithm, std.file, std.stdio, std.string; int main(string[] args) { if (args.length < 2) { return 1; } size_t linect = 0; foreach (line; File(args[1]).byLine()) linect += 1; return 0; } Backtrace: Breakpoint 1, 0x080b07fc in _d_throwc () (gdb) bt #0 0x080b07fc in _d_throwc () #1 0x080b1208 in _d_arrayshrinkfit () #2 0x080ac4d4 in object.assumeSafeAppend!(char).assumeSafeAppend(ref inout(char[])) (arr=0x81210d4) at /home/mk/dmd2.test/src/druntime/import/object.di:662 #3 0x080abbc8 in std.stdio.File.ByLineImpl!(char, char).ByLineImpl.popFront() (this=0x81210c8) at /home/mk/dmd2.test/src/phobos/std/stdio.d:1677 #4 0x080ab9eb in std.stdio.File.ByLine!(char, char).ByLine.popFront() (this=0xffffd914) at /home/mk/dmd2.test/src/phobos/std/stdio.d:1624 #5 0x080ab88b in D main (args=...) at wcbug.d:10 (gdb) c Continuing. core.exception.InvalidMemoryOperationError@(0) This happens with 2.067b and master. 2.066 no error. System linux.
Input file here: http://bid.iline.cz/~mk/tmp/wcbugxml.bz2
I can't reproduce this on Windows. Looks like a duplicate of issue 13856 and particularly issue 14005 except for that this one is a regression?
It depend(In reply to Vladimir Panteleev from comment #2) > I can't reproduce this on Windows. Looks like a duplicate of issue 13856 > and particularly issue 14005 except for that this one is a regression? I have tried several older dmd versions and none crash, but it may be a coincidence. Also depends on input.
*** This issue has been marked as a duplicate of issue 13856 ***