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 Vladimir.Ushakov
Recipients Vladimir.Ushakov, christian.heimes, jcea, neologix, pitrou, vstinner
Date 2012-10-14.00:29:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1350174558.04.0.433036834584.issue16212@psf.upfronthosting.co.za>
In-reply-to
Content
> You can't use longjmp from signal handlers. Well, you can, but 99% of the code that does it is broken, because you can only call async-safe functions from within a signal handler, and certainly can't run the intepreter.

I don't see the reason to run the interpreter. But a quick look at the source shows that the current implementation already uses longjmps to handle SIGFPE (see pyfpe.h and fpectlmodule.c). It seems to be in use on many platforms.

The only problem I see so far is the possibility that we have to protect too much. However, as I could guess from quickly browsing through the mmap() implementation, the address of the mmap()ed region never leaves the module, all accesses are done using exported methods. If it is really the case, we can wrap them into something similar to PyFPE_START_PROTECT() and PyFPE_END_PROTECT() (see comments in pyfpe.h).
History
Date User Action Args
2012-10-14 00:29:18Vladimir.Ushakovsetrecipients: + Vladimir.Ushakov, jcea, pitrou, vstinner, christian.heimes, neologix
2012-10-14 00:29:18Vladimir.Ushakovsetmessageid: <1350174558.04.0.433036834584.issue16212@psf.upfronthosting.co.za>
2012-10-14 00:29:18Vladimir.Ushakovlinkissue16212 messages
2012-10-14 00:29:16Vladimir.Ushakovcreate