[Python-Dev] Trap SIGSEGV and SIGFPE (original) (raw)

Maciej Fijalkowski fijall at gmail.com
Thu Dec 11 11:10:14 CET 2008


If we could calculate how much stack is left we'd have a much more robust way of doing recursion limits. I suppose this could be done by reading a byte from each page with a temporary SIGSEGV handler installed, but I'm not convinced you can't ask the platform directly somehow. I'd also be considered about thread-safety.

It's something as hard as taking address of local variable at the beginning of the program and at any arbitrary point. Of course 'how much is left' means additional arithmetics.

Cheers, fijal



More information about the Python-Dev mailing list