Re: [Pyobjc-dev] A better way to deal w/sig 10 & 11 exceptions
Brought to you by:
ronaldoussoren
From: <bb...@ma...> - 2003-06-04 11:32:14
|
On Wednesday, Jun 4, 2003, at 04:09 US/Eastern, Just van Rossum wrote: > That would be extremely useful. However, I can't get it to work when > there's a real crash. I don't get a Python stack trace when I patch > your > demo like this: As it turns out, it doesn't trigger nearly as often as one would like. The Python signal handlers are too wrapped up in the interpreter state such that crashes in a lot of places will not trigger the stack trace. Unfortunate, that, but there is an easy-- though ugly-- solution. The entire signal handling mechanism should be moved to C. Once in C, it'll-- at least-- trigger reliably. > Could this ever work to begin with? It seems that upon such a crash the > state of the program is undefined, and executing Python code may no > longer work. In these situations, I always take a "something is better than nothing" approach. If it works once in ten, that is better than what we have now. In general, when a crash occurs it is not because the entire app's memory is trashed but more because there is some local fault. As such, the Python interpreter should still be viable enough to dump a backtrace. If I get a chance, I'll look into adding an ExceptionHandling module that wraps the framework of the same name. b.bum |