[Haskell-cafe] Unnecessarily strict implementations

Henning Thielemann schlepptop at henning-thielemann.de
Mon Sep 6 04:47:54 EDT 2010


Daniel Fischer schrieb:
> On Sunday 05 September 2010 21:52:44, Henning Thielemann wrote:
>> Daniel Fischer schrieb:
>>> Yes. Ordinarily, lines in text files aren't longer than a few hundred
>>> characters, leaking those, who cares?
>> I got several space leaks of this kind in the past. They are very
>> annoying. They are especially annoying if input comes from the outside
>> world, where people can attack them to crash your program because of
>> memory exhaustion.
> 
> That would likely be the case of long lines, wouldn't it?
> I have trouble imagining a scenario where `lines' holding on to a few 
> hundred characters which could already be released causes a noticeable 
> space leak, let alone memory exhaustion.

I talked about an _attack_! I provide a program that processes external
data (say a webserver, for instance one for an ICFP contest) and someone
feeds it intentionally with megabytes of text without any line ending.



More information about the Haskell-Cafe mailing list