Parser/intrcheck.c:intcatcher() can do FILE* operations, which can deadlock if the interrupt happens while a FILE* operation on the same FILE holds a mutex for the FILE. I've seen this happen elsewhere. It'd rather be a pity to remove Py_Exit(), so I suggest switch(interrupted++) gets a case 3 or 4: which does _exit(1), and 'interrupted = 0;' is moved there from case 2. Also 'interrupted' should be volatile sig_atomic_t, and the function should save/restore errno as in Issue 10311. BTW, you could use strlen(message) instead of sizeof(message)-1.
Sorry, my patch is useless if the OS calls the handler with the signal blocked. It should also unblock the signal before doing anything which can do FILE* operations. And set the handler again? Or just leave the next signal to abort the process? I dunno... Anyway, if you don't do that, just apply the save/restore of errno. Drop the 'if (errno != save_errno)' before restoring, that bit of paranoia was turned down in Issue10311.
status: closed -> openversions: - Python 3.1, Python 3.2nosy: + Claudiu.Popamessages: + resolution: out of date -> (no value)stage: resolved -> (no value)
2014-06-27 06:13:12
Claudiu.Popa
set
status: open -> closedresolution: out of datestage: resolved