Issue 3653: segfault calling sys.excepthook with non-Exception argument (original) (raw)
Calling sys.excepthook(1,'1',1) crashes 3.0:
Python 3.0b3+ (py3k:65987, Aug 23 2008, 10:04:31) [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import sys; sys.excepthook(1,'1',1) Segmentation fault
gdb points at "PyException_GetTraceback at Objects/exceptions.c:265 265 Py_XINCREF(base_self->traceback);"
This was found by Fusil and Victor Stinner (haypo) sent me a patch (see attachment).
Thanks bpeterson for triaging :)
PS: I also think that should be targeted to 3.0, as the underlying issue is the same, it would be an easy way to segfault python3.0 and has a clean patch available.