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 Trigve.Siver
Recipients Trigve.Siver
Date 2010-09-06.13:25:09
SpamBayes Score 2.8276915e-07
Marked as misclassified No
Message-id <1283779511.86.0.882093197661.issue9785@psf.upfronthosting.co.za>
In-reply-to
Content
I'm using C++ with python embeding.
I'm creating a couple of unicode objects and then some
exception is thrown. While handling exception I create othet unicode objects. Then when creating some unicode object crash occurs. The problem is in _PyUnicode_New():325 on line (1):

if (free_list) {
    unicode = free_list; /*<- (1)*/
    free_list = *(PyUnicodeObject **)unicode;

In statement "unicode = free_list;" "unicode" pointer is bad pointer, in fact it's address is 5 bytes "lower" (i.e. should be 0x030bc3ff but is 0x030bc3fa).

It looks like this only happens when exception is thrown.

When python exception is set I throw C++ exception to signal C++ code that py exception was set. Next in C++ exception handler I format the python exception using some python unicode objects and then the problem occurs.
Without the C++ throw (Only python exception formatting) it looks like everything is working OK.

I'm using python 3.1.2 on Vista with MSVS 2010. I've also tried python 3.2a2 but it was the same.

I've tried to isolate the problem in some simple example but haven't been successful yet.
History
Date User Action Args
2010-09-06 13:25:11Trigve.Siversetrecipients: + Trigve.Siver
2010-09-06 13:25:11Trigve.Siversetmessageid: <1283779511.86.0.882093197661.issue9785@psf.upfronthosting.co.za>
2010-09-06 13:25:10Trigve.Siverlinkissue9785 messages
2010-09-06 13:25:09Trigve.Sivercreate