This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gslavin
Recipients Andre Merzky, eryksun, gslavin
Date 2016-09-06.06:47:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1473144424.13.0.571105092332.issue27889@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks for the reply!  I've managed to reproduce the issue without using ctypes, so we can exclude ctypes as the cause of the problem :)

The bug only occurs for me after hundreds of iterations of the script, so it is very intermittent.

From my results, it appears the signal handler is called, but the exception isn't caught in the try block (this matches your result).

From the call stack it appears the exception handler is called at
"print 'unexcepted'", which is after the try block.

Interestingly, if I place a print after time.sleep, I cannot repro this issue.  Maybe there is a race between the signal handler execution and execution of the try block in the main thread?  Adding the print might slow down the main thread enough that the race disappears.

I don't know the source that well, so I'll need to do some digging to get any more information.

I hope this helps!

-George Slavin
History
Date User Action Args
2016-09-06 06:47:04gslavinsetrecipients: + gslavin, eryksun, Andre Merzky
2016-09-06 06:47:04gslavinsetmessageid: <1473144424.13.0.571105092332.issue27889@psf.upfronthosting.co.za>
2016-09-06 06:47:04gslavinlinkissue27889 messages
2016-09-06 06:47:04gslavincreate