[New-bugs-announce] [issue36938] Py_XDECREF on PyUnicodeobject raises SIGSEGV signal

Khalil report at bugs.python.org
Thu May 16 09:20:46 EDT 2019


New submission from Khalil <KMaatoug at rapiscansystems.com>:

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);
...

----------
components: Extension Modules
messages: 342642
nosy: Khalilmtg
priority: normal
severity: normal
status: open
title: Py_XDECREF on PyUnicodeobject raises SIGSEGV signal
type: crash
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36938>
_______________________________________


More information about the New-bugs-announce mailing list