[Bug]: Waiting infinitely with overflow on Console.Error
I've had a problem with a script that seems to run infinitely. After some investigation it appears that an overflow on logging to Console.Error will cause Linqpad to wait forever.
The following script will wait forever:
Console.Error.Write(new string('a', 4097));
What made this even harder to find is the fact that the following script will succeed the first time, but it starts waiting the second time the script is executed:
Console.Error.Write(new string('a', 4096));
I've been able to fix this by redirecting Console.Error. So this will succeed:
Console.SetError(Console.Out);
Console.Error.Write(new string('a', 4097));
The following script will wait forever:
Console.Error.Write(new string('a', 4097));
What made this even harder to find is the fact that the following script will succeed the first time, but it starts waiting the second time the script is executed:
Console.Error.Write(new string('a', 4096));
I've been able to fix this by redirecting Console.Error. So this will succeed:
Console.SetError(Console.Out);
Console.Error.Write(new string('a', 4097));
Comments