[issue8863] Segfault handler: display Python backtrace on segfault

2010-10-13 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: dmalcolm asked if it would be possible to display the Python backtrace on Py_FatalError() It works :-) I fixed a bug in ceval.c (r85411) which was not directly related. Patch version 5: - Display the Python backtrace on

[issue8863] Segfault handler: display Python backtrace on segfault

2010-10-13 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file19208/segfault_handler-3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8863 ___

[issue8863] Segfault handler: display Python backtrace on segfault

2010-10-13 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file19210/segfault_handler-4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8863 ___

[issue8863] Segfault handler: display Python backtrace on segfault

2010-10-12 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: New version of the patch: - use more standard function names (_Py_initsegfault = _Py_InitSegfault) - use #ifdef HAVE_SIGACTION to support system without sigaction(): fallback to signal() - usage of the alternative stack is now

[issue8863] Segfault handler: display Python backtrace on segfault

2010-10-12 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Updated example: -- $ ./python Lib/test/crashers/recursive_call.py Fatal Python error: segmentation fault Traceback (most recent call first): File Lib/test/crashers/recursive_call.py,

[issue8863] Segfault handler: display Python backtrace on segfault

2010-10-12 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- nosy: +dmalcolm ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8863 ___ ___

[issue8863] Segfault handler: display Python backtrace on segfault

2010-10-12 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file17507/segfault_handler.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8863 ___

[issue8863] Segfault handler: display Python backtrace on segfault

2010-10-12 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file17717/segfault_handler-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8863 ___

[issue8863] Segfault handler: display Python backtrace on segfault

2010-10-12 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: It should be tested at least on a wide build and ... Done: it works correctly for non-BMP characters in narrow and wide builds. Eg. in wide build with U+10 character in the path: - $ ./python bla.py Fatal

[issue8863] Segfault handler: display Python backtrace on segfault

2010-10-12 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Patch version 4: - Add segfault.c to pythoncore.vcproj - Remove #error nope (I used it for debug purpose) - Don't include unistd.h on Windows This version works on Windows. -- Added file:

[issue8863] Segfault handler: display Python backtrace on segfault

2010-08-18 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: dmalcolm asked if it would be possible to display the Python backtrace on Py_FatalError(). I don't know: Py_FatalError() is usually called when Python internals are broken. But well, segfaults do also usually occurs when something

[issue8863] Segfault handler: display Python backtrace on segfault

2010-06-18 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: New version of the patch: - catch also SIGFPE - add segfault.o to Makefile.pre.in - use abort() to quit instead of _exit(1) - call DebugBreak() on Windows before the abort(), as done by Py_FatalError() TODO: Patch configure to

[issue8863] Segfault handler: display Python backtrace on segfault

2010-05-31 Thread STINNER Victor
New submission from STINNER Victor victor.stin...@haypocalc.com: Attached patch implements an handler for the signal SIGSEGV. It uses its own stack to be able to allocate memory on the stack (eg. call a function), even on stack overflow. The patch requires sigaction() and sigaltstack()

[issue8863] Segfault handler: display Python backtrace on segfault

2010-05-31 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: See also issue #3999: a similar patch to raise an exception on segfault. This patch was rejected because Python internal state may be corrupted, and we cannot guarantee that next instructions will be executed correctly. This patch