[Mono-dev] StreamReader.ReadToEnd crashes sometimes

Robert Jordan robertj at gmx.net
Fri Feb 4 08:57:39 EST 2011


On 04.02.2011 14:06, cs_eps wrote:
>
> Hallo experts!
>
> Once in a while StreamReader.ReadToEnd() crashes with the following stack
> trace:
>
> Mprotect failed at 0x4621e000 (length 20480) with errno 12
> Stacktrace:
>
>    at (wrapper managed-to-native)
> object.__icall_wrapper_mono_array_new_specific (intptr,int)<0xffffffff>


Errno 12 is ENOMEM, a.k.a. "Out of memory".

>
> Is there a fix for this? or a workaround?

You may want to use ReadLine in a loop instead of slurping
the whole file into memory.

Robert



More information about the Mono-devel-list mailing list