This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ot
Recipients ot
Date 2008-11-20.17:36:04
SpamBayes Score 1.193813e-05
Marked as misclassified No
Message-id <1227202567.31.0.450419283212.issue4367@psf.upfronthosting.co.za>
In-reply-to
Content
Hi all,
trying to compile Python 2.6 I got a segmentation fault while
byte-compiling the modules. 

The segmentation fault happened in ast_for_atom, parsing an Unicode
entity. I found out that another problem prevented unicodedata to be
imported, so unicode_decode raised an exception. I think the problem is
in the following lines:

            if (PyErr_ExceptionMatches(PyExc_UnicodeError)){
                PyObject *type, *value, *tback, *errstr;
                PyErr_Fetch(&type, &value, &tback);
                errstr = ((PyUnicodeErrorObject *)value)->reason;

I'm not an expert of CPython internals, but the exception is raised with
PyErr_SetString, so value is a PyStringObject, and that cast is invalid.
Changing the last line to 

                errstr = value;

everything works. 

The patch is attached.
History
Date User Action Args
2008-11-20 17:36:07otsetrecipients: + ot
2008-11-20 17:36:07otsetmessageid: <1227202567.31.0.450419283212.issue4367@psf.upfronthosting.co.za>
2008-11-20 17:36:05otlinkissue4367 messages
2008-11-20 17:36:04otcreate