[Python-Dev] Preventing recursion core dumps

Moshe Zadka Moshe Zadka <moshez@math.huji.ac.il>
Fri, 11 Aug 2000 17:40:10 +0300 (IDT)


On Fri, 11 Aug 2000, Vladimir Marangozov wrote:

> Moshe Zadka wrote:
> > 
> > On Fri, 11 Aug 2000, Guido van Rossum wrote:
> > 
> > > It would be good if there was a way to sense the remaining available
> > > stack, even if it wasn't portable.  Any Linux experts out there?
> > 
> > I'm far from an expert, but I might have an idea. The question is: must
> > this works for embedded version of Python, or can I fool around with
> > main()?
> 
> Probably not main(), but Py_Initialize() for sure.

Py_Initialize() isn't good enough -- I can put an upper bound on the
difference between "min" and the top of the stack: I can't do so
for the call to Py_Initialize(). Well, I probably can in some *really*
ugly way. I'll have to think about it some more.

> Sounds good. If getrlimit is not available, we can always fallback to
> some (yet to be computed) constant, i.e. the current state.

Well, since Guido asked for a non-portable Linuxish way, I think we
can assume getrusage() is there.

[Vladimir]
> Ah, in this case, we'll get a memory error after filling the whole disk
> with frames <wink>

Which is great! Python promises to always throw an exception....

--
Moshe Zadka <moshez@math.huji.ac.il>
There is no IGLU cabal.
http://advogato.org/person/moshez