python - PyObject_CallFunction Access violation writing location 0x0000000c -


The following code works for small messages But when the message is larger than 400MB, I get the following error from the PyObject_CallFunction call:

Unconfirmed exception on 0x1e00d65f in python.exe: 0xC0000005: Enter access violation space 0x0000000c.

  int requestbackback (c_request * req, c_msg * msg, void * client) {PyGILState_STATE gstate; PyObject * callback; PyObject * results; Unsigned int request_addr; PyObject * py_request_addr; PyObject * message; Gstate = PyGilState_Ensure (); Request_addr = (unsigned int) req; Py_request_addr = PyInt_FromLong (request_addr); If (PyDict_Contains (request_callback_dict, py_request_addr) == 1) {callback = PyDict_GetItem (request_callback_dict, py_request_addr); Message = PyString_FromStringAndSize (msg-> data, msg- & gt; lane); Results = PyObject_CallFunction (callback, "o", message); } PyGilState_release (gstate); Return 0; }  

There is any idea about this which can be due to it. Thank you.

After debugging the code, it is actually a problem with the Python code which uses the string is . String is a Google protocol buffer, and when the data is written from the file and the bytes are parsed, I can get the script exception by the library.


Comments