Re: Catching a segfault in a Python library

2007-11-27 Thread Brian Cole
On Nov 25, 1:37 am, Donn Ingle <[EMAIL PROTECTED]> wrote: > MrJean1 wrote: > > Try catching SIGSEGV using the Python signal module > > > > An example (for SIGALRM) is on the next page > > > > However, it may n

Re: Catching a segfault in a Python library

2007-11-24 Thread Donn Ingle
MrJean1 wrote: > Try catching SIGSEGV using the Python signal module > > An example (for SIGALRM) is on the next page > > However, it may not work since a SIGSEGV fault is pretty much the end > of everything T

Re: Catching a segfault in a Python library

2007-11-24 Thread Donn Ingle
Paul Rubin wrote: > then maybe your trap-and-restart approach can keep things usable for a > while. Trap and restart gracefully is the road I want to take. If my app (FP) chokes on a font (it will have made a note before doing what kills it, because I know the 'danger' areas ) and then will die. Th

Re: Catching a segfault in a Python library

2007-11-24 Thread Paul Rubin
Donn Ingle <[EMAIL PROTECTED]> writes: > runapp > result = runActualApp( ) > while True: > if result == allokay: break > else: > > > Unless a segfault goes through that too, like Krypton through Superman. No you can't do it that way, when I say "run it under a debugger", I mean run the

Re: Catching a segfault in a Python library

2007-11-24 Thread MrJean1
Try catching SIGSEGV using the Python signal module An example (for SIGALRM) is on the next page However, it may not work since a SIGSEGV fault is pretty much the end of everything :-( /Jean Brouwers

Re: Catching a segfault in a Python library

2007-11-24 Thread Donn Ingle
> I think the idea is, certain fonts in his collection may be corrupt, > and he wants to just scan through and load them, ignoring the ones > that make the program crash.   Ya got me! Sheesh, I can't hide anywhere :D > The bug in this case lies with a third > party and isn't something he can easi

Re: Catching a segfault in a Python library

2007-11-24 Thread Patrick Mullen
On 24 Nov 2007 08:41:24 GMT, Ayaz Ahmed Khan <[EMAIL PROTECTED]> wrote: > Donn Ingle wrote: > > Already done, the code within PIL is causing the crash. It gets ugly and > > out of my remit. It's a freetype/Pil thing and I simply want to a way to > > catch it when it happens. > > Since a segfault e

Re: Catching a segfault in a Python library

2007-11-24 Thread Ayaz Ahmed Khan
Donn Ingle wrote: > Already done, the code within PIL is causing the crash. It gets ugly and > out of my remit. It's a freetype/Pil thing and I simply want to a way to > catch it when it happens. > Since a segfault ends the process, I am asking about "wrappers" around > code > to catch a segfault

Re: Catching a segfault in a Python library

2007-11-23 Thread Donn Ingle
> You may have to roll your own fork/exec to start the wxpython, instead > of using popen or the subprocess module.  I'm not terribly conversant > in those modules but they may start a shell which would isolate your > program from the wxpython exit code. Hrmm... Neither am I, that's why I asked her

Re: Catching a segfault in a Python library

2007-11-23 Thread Paul Rubin
Donn Ingle <[EMAIL PROTECTED]> writes: > Okay, that's a good start. Thanks, I'll go for a python starts wxpython > thing with os.wait() to sniff the outcome. You may have to roll your own fork/exec to start the wxpython, instead of using popen or the subprocess module. I'm not terribly conversant

Re: Catching a segfault in a Python library

2007-11-23 Thread Donn Ingle
> Well I think you should actually debug it, or at least reproduce it > and send a bug report to the PIL folks, It was a while ago, and if memory serves I did that, but memory fails. > but anyway you can use > os.wait() to get the exit status and recognize the seg fault. Okay, that's a good start

Re: Catching a segfault in a Python library

2007-11-23 Thread Paul Rubin
Donn Ingle <[EMAIL PROTECTED]> writes: > > Run your app under a debugger and figure out what is making it crash. > Already done, the code within PIL is causing the crash. It gets ugly and out > of my remit. It's a freetype/Pil thing and I simply want to a way to catch > it when it happens. > Since

Re: Catching a segfault in a Python library

2007-11-23 Thread Donn Ingle
> Run your app under a debugger and figure out what is making it crash. Already done, the code within PIL is causing the crash. It gets ugly and out of my remit. It's a freetype/Pil thing and I simply want to a way to catch it when it happens. Since a segfault ends the process, I am asking about "

Re: Catching a segfault in a Python library

2007-11-23 Thread Paul Rubin
Donn Ingle <[EMAIL PROTECTED]> writes: > Do you think that's a good idea, or is there another way to handle stuff > like this? (perhaps a Python app launching another Python app?) Run your app under a debugger and figure out what is making it crash. -- http://mail.python.org/mailman/listinfo/pyt

Catching a segfault in a Python library

2007-11-23 Thread Donn Ingle
Yo, An app of mine relies on PIL. When PIL hits a certain problem font (for unknown reasons as of now) it tends to segfault and no amount of try/except will keep my wxPython app alive. My first thought is to start the app from a bash script that will check the return value of my wxPython app and