[Issue 15386] std.format.formatValue usage hangs
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sat Nov 28 22:24:17 PST 2015
https://issues.dlang.org/show_bug.cgi?id=15386
--- Comment #1 from Doug Nickerson <Tachyon165 at gmail.com> ---
Actually, letting it run longer reveals that it is not hanging but consuming
over 4Gb of memory as it is generating a string of approx 2^32 '0's. lol.
I think this is using the placeholder value defined in FormatSpec for a
dynamically specified precision (or width) which is near int.max.
Maybe this is the intended behavior in this (probably incorrect) use case, but
it is concerning since format strings are runtime values that can change --
simply putting a '*' in there can allocate 4Gb of memory and/or cause an
OutOfMemory error.
--
More information about the Digitalmars-d-bugs
mailing list