[PRL] almost tail-calling (was: Re: deeep stack)

Joe Marshall jmarshall at alum.mit.edu
Fri May 23 15:16:29 EDT 2008


I was amused to find out that the `hardened' CLR that Microsoft
embeds in their SQL server has this odd behavior:

On stack overflow, the overflowing thread is simply reaped by
the OS without notice or warning.  Stack unwinding isn't performed,
nothing is signalled, the thread just goes away.

This would be bad enough, but there is also no way to determine
the current stack depth nor how much stack is remaining.  Even
if there were, it wouldn't help because there is no way to predict
the stack usage for *any* CLR instruction (not even a conservative
upper bound!  Any instruction whatsoever could cause re-jitting
and potentially use hundreds of kilobytes.  Or more.)

I guess you could call this non-determinstic programming...

-- 
~jrm



More information about the PRL mailing list