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
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
___
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
___
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
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,
Changes by STINNER Victor victor.stin...@haypocalc.com:
--
nosy: +dmalcolm
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8863
___
___
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
___
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
___
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
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:
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
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
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()
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
14 matches
Mail list logo