Author vstinner
Recipients Vladimir.Ushakov, christian.heimes, neologix, vstinner
Date 2012-10-12.21:29:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1350077373.37.0.601049390704.issue16212@psf.upfronthosting.co.za>
In-reply-to
Content
"Well, there are some higly non-portable ways to try to escape this (see
http://stackoverflow.com/questions/2663456/write-a-signal-handler-to-catch-sigsegv), but it won't fly in our case."

There is also the libsigsegv library, but it's hard and unsafe to handle such low level signals in Python.
http://www.gnu.org/software/libsigsegv/

"It has a race condition as another process could truncate the file between the fstat() check and the code lines that access the mmapped file."

You can use file locks to be protected against such race condition. See for example:
http://pypi.python.org/pypi/lockfile
History
Date User Action Args
2012-10-12 21:29:33vstinnersetrecipients: + vstinner, christian.heimes, neologix, Vladimir.Ushakov
2012-10-12 21:29:33vstinnersetmessageid: <1350077373.37.0.601049390704.issue16212@psf.upfronthosting.co.za>
2012-10-12 21:29:33vstinnerlinkissue16212 messages
2012-10-12 21:29:33vstinnercreate