New submission from Miki Tebeka: The following code hangs Python: #!/usr/bin/env python
import segfault import signal from os import _exit from sys import stdout def handler(signal, stackframe): print "OUCH" stdout.flush() _exit(1) if __name__ == "__main__": from sys import argv signal.signal(signal.SIGSEGV, handler) segfault.segfault() segfault is the following C module: #include <Python.h> static PyObject * segfault(PyObject *self, PyObject *args) { char *c; c = 0; *c = 'a'; return Py_BuildValue(""); } static PyMethodDef Methods[] = { { "segfault", segfault, METH_VARARGS, "will segfault"}, {NULL, NULL, 0, NULL} /* Sentinel */ }; PyMODINIT_FUNC initsegfault(void) { Py_InitModule("segfault", Methods); } ---------- components: Interpreter Core messages: 56169 nosy: tebeka severity: normal status: open title: Python hang when catching a segfault type: crash versions: Python 2.5 __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1215> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com