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 Khalil
Recipients Khalil
Date 2019-05-16.13:20:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1558012846.53.0.774298096399.issue36938@roundup.psfhosted.org>
In-reply-to
Content
I Have a set of callbacks from a C extension to a Python code and I noticed that when I report a unicode string to the Python code, and use the Py_XDECREF on it then whole application crashes with the SIGSEGV signal.This is a snippet of the codes:

/***************************/
....
PyObject *MyString = PyUnicode_FromString("BlaBla");
PyTuple_SetItem(MyTuple, 0, MyString);
PyObject_CallObject(callback, PyTuple);

Py_XDECREF(MyString);
Py_XDECREF(MyTuple);
...
/***********************************/

when I create my string within the set item then it works fine, like below:
....
PyTuple_SetItem(MyTuple, 0, PyUnicode_FromString("BlaBla"));
PyObject_CallObject(callback, PyTuple);
Py_XDECREF(MyTuple);
...
History
Date User Action Args
2019-05-16 13:20:46Khalilsetrecipients: + Khalil
2019-05-16 13:20:46Khalilsetmessageid: <1558012846.53.0.774298096399.issue36938@roundup.psfhosted.org>
2019-05-16 13:20:46Khalillinkissue36938 messages
2019-05-16 13:20:46Khalilcreate