KeyboardInterrupt shows strange behavior
Hi there, I have the following dummy code, doing garbage until I interrupt it: ------------------------------------ from numarray import * A = zeros((100,100)) try: while 1: A = dot(A,A) except KeyboardInterrupt: print "Interrupted" -------------------------------------- Now, if I hit Ctrl-C to interrupt it, it behaves strangely. Most of the time, I see a message: -------------------- Exception exceptions.KeyboardInterrupt in <bound method NumArray.__del__ of array([[0, 0, 0, ..., 0, 0, 0], [0, 0, 0, ..., 0, 0, 0], [0, 0, 0, ..., 0, 0, 0], ..., [0, 0, 0, ..., 0, 0, 0], [0, 0, 0, ..., 0, 0, 0], [0, 0, 0, ..., 0, 0, 0]])> ignored ------------------------- after which the program continues to run, unimpressed by the fact that I would have liked to stop it. Only one out of ten attempts of pressing Ctrl-C is successful (probably depending on the exact position in the code where I hit the keys) - but even then, the program does not quit cleanly with an exception but it crashes hard with a SegFault! I am using a self-compiled glibc including the patch by Andrew Straw (see http://aspn.activestate.com/ASPN/Mail/Message/numpy-discussion/2207861) Might it be that this patch causes the problem? Ciao, Nobbi
Norbert Nemec wrote:
I am using a self-compiled glibc including the patch by Andrew Straw (see http://aspn.activestate.com/ASPN/Mail/Message/numpy-discussion/2207861) Might it be that this patch causes the problem?
I just tried it on a different machine running unpatched libc-2.2.5: same problem. Andrews patch obviously is not the problem.
On Thu, 2004-11-18 at 10:12, Norbert Nemec wrote:
Norbert Nemec wrote:
I am using a self-compiled glibc including the patch by Andrew Straw (see http://aspn.activestate.com/ASPN/Mail/Message/numpy-discussion/2207861) Might it be that this patch causes the problem?
I just tried it on a different machine running unpatched libc-2.2.5: same problem. Andrews patch obviously is not the problem.
I am able to reproduce this also and logged it on Source Forge. I'm not sure what's going on but I'll look into it as time permits. Regards, Todd
Norbert Nemec wrote:
Only one out of ten attempts of pressing Ctrl-C is successful (probably depending on the exact position in the code where I hit the keys) - but even then, the program does not quit cleanly with an exception but it crashes hard with a SegFault!
On a Mac with latest CVS numarray I get the same behaviour except the segault. It stops cleanly for me. -- Robert Kern rkern@ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter
participants (3)
-
Norbert Nemec
-
Robert Kern
-
Todd Miller