Message342642
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);
... |
|
Date |
User |
Action |
Args |
2019-05-16 13:20:46 | Khalil | set | recipients:
+ Khalil |
2019-05-16 13:20:46 | Khalil | set | messageid: <1558012846.53.0.774298096399.issue36938@roundup.psfhosted.org> |
2019-05-16 13:20:46 | Khalil | link | issue36938 messages |
2019-05-16 13:20:46 | Khalil | create | |
|