File: | src/imlib2.c |
Function: | init_Imlib2 |
Error: | ob_refcnt of Image_PyObject_Type is 2 too low |
297 void init_Imlib2(void)
298 {
299 PyObject *m, *c_api;
300 static void *api_ptrs[2];
301
302 m = Py_InitModule("_Imlib2", Imlib2_methods);
303 Image_PyObject_Type.tp_new = PyType_GenericNew;
when Py_InitModule4_64() succeeds
304 if (PyType_Ready(&Image_PyObject_Type) < 0)
305 return;
when PyType_Ready() succeeds
taking False path
306 PyModule_AddObject(m, "Image", (PyObject *)&Image_PyObject_Type);
returning
ob_refcnt of Image_PyObject_Type is 2 too low
was expecting final ob_refcnt to be N + 1 (for some unknown N)
due to object being referenced by: api_ptrs[1]
but final ob_refcnt is N + -1
found 3 similar trace(s) to this
307 pthread_mutex_init(&imlib2_mutex, NULL);
when PyModule_AddObject() succeeds
ob_refcnt is now refs: -1 + N where N >= 2
308
309 PyImlib2_BEGIN_CRITICAL_SECTION
310 imlib_set_cache_size(1024*1024*4);
releasing the GIL by calling PyEval_SaveThread()
311 imlib_set_font_cache_size(1024*1024*2);
312 PyImlib2_END_CRITICAL_SECTION
313
reacquiring the GIL by calling PyEval_RestoreThread()
314 // Export a simple API for other extension modules to be able to access
315 // and manipulate Image objects.
316 api_ptrs[0] = (void *)imlib_image_from_pyobject;
317 api_ptrs[1] = (void *)&Image_PyObject_Type;
318 c_api = PyCObject_FromVoidPtr((void *)api_ptrs, NULL);
Image_PyObject_Type is now referenced by 1 non-stack value(s): api_ptrs[1]
319 PyModule_AddObject(m, "_C_API", c_api);
when PyCObject_FromVoidPtr() succeeds
320 PyEval_InitThreads();
when PyModule_AddObject() succeeds
321 }
calling PyEval_InitThreads()
322
File: | src/imlib2.c |
Function: | init_Imlib2 |
Error: | ob_refcnt of '*c_api' is 1 too high |
297 void init_Imlib2(void)
298 {
299 PyObject *m, *c_api;
300 static void *api_ptrs[2];
301
302 m = Py_InitModule("_Imlib2", Imlib2_methods);
303 Image_PyObject_Type.tp_new = PyType_GenericNew;
when Py_InitModule4_64() succeeds
304 if (PyType_Ready(&Image_PyObject_Type) < 0)
305 return;
when PyType_Ready() succeeds
taking False path
306 PyModule_AddObject(m, "Image", (PyObject *)&Image_PyObject_Type);
returning
ob_refcnt of '*c_api' is 1 too high
was expecting final ob_refcnt to be N + 0 (for some unknown N)
but final ob_refcnt is N + 1
found 1 similar trace(s) to this
307 pthread_mutex_init(&imlib2_mutex, NULL);
when PyModule_AddObject() succeeds
308
309 PyImlib2_BEGIN_CRITICAL_SECTION
310 imlib_set_cache_size(1024*1024*4);
releasing the GIL by calling PyEval_SaveThread()
311 imlib_set_font_cache_size(1024*1024*2);
312 PyImlib2_END_CRITICAL_SECTION
313
reacquiring the GIL by calling PyEval_RestoreThread()
314 // Export a simple API for other extension modules to be able to access
315 // and manipulate Image objects.
316 api_ptrs[0] = (void *)imlib_image_from_pyobject;
317 api_ptrs[1] = (void *)&Image_PyObject_Type;
318 c_api = PyCObject_FromVoidPtr((void *)api_ptrs, NULL);
319 PyModule_AddObject(m, "_C_API", c_api);
when PyCObject_FromVoidPtr() succeeds
PyCObject allocated at: c_api = PyCObject_FromVoidPtr((void *)api_ptrs, NULL);
ob_refcnt is now refs: 1 + N where N >= 0
320 PyEval_InitThreads();
when PyModule_AddObject() fails
321 }
calling PyEval_InitThreads()
322
File: | src/imlib2.c |
Function: | init_Imlib2 |
Error: | calling PyModule_AddObject with NULL as argument 1 (m) at src/imlib2.c:307 |
297 void init_Imlib2(void)
298 {
299 PyObject *m, *c_api;
300 static void *api_ptrs[2];
301
302 m = Py_InitModule("_Imlib2", Imlib2_methods);
303 Image_PyObject_Type.tp_new = PyType_GenericNew;
when Py_InitModule4_64() fails
304 if (PyType_Ready(&Image_PyObject_Type) < 0)
305 return;
when PyType_Ready() succeeds
taking False path
306 PyModule_AddObject(m, "Image", (PyObject *)&Image_PyObject_Type);
307 pthread_mutex_init(&imlib2_mutex, NULL);
calling PyModule_AddObject with NULL as argument 1 (m) at src/imlib2.c:307
PyModule_AddObject() invokes Py_TYPE() on the pointer via the PyModule_Check() macro, thus accessing (NULL)->ob_type
308
309 PyImlib2_BEGIN_CRITICAL_SECTION
310 imlib_set_cache_size(1024*1024*4);
311 imlib_set_font_cache_size(1024*1024*2);
312 PyImlib2_END_CRITICAL_SECTION
313
314 // Export a simple API for other extension modules to be able to access
315 // and manipulate Image objects.
316 api_ptrs[0] = (void *)imlib_image_from_pyobject;
317 api_ptrs[1] = (void *)&Image_PyObject_Type;
318 c_api = PyCObject_FromVoidPtr((void *)api_ptrs, NULL);
319 PyModule_AddObject(m, "_C_API", c_api);
320 PyEval_InitThreads();
321 }
322