David Malcolm
David Malcolm
Consider this source: {{{ #include extern PyObject *gdb_module; extern PyTypeObject eventregistry_object_type; void gdbpy_initialize_eventregistry (void) { if (PyType_Ready (&eventregistry_object_type) < 0) return; Py_INCREF (&eventregistry_object_type); PyModule_AddObject (gdb_module, "EventRegistry", (PyObject *) &eventregistry_object_type); }...
Consider this source: {{{ #include PyObject * create_event_object (PyTypeObject *py_type) { PyObject *event_obj; event_obj = PyObject_New (PyObject, py_type); if (!event_obj) goto fail; return event_obj; fail: Py_XDECREF (event_obj); return NULL; }...
Having seen David Malcolm's awesome PyCon talk, I thought I'd give cpychecker a try on my own code. I'm on Fedora 18, and installed all the dependencies from packages. I...
running from git on f17: {{{ $ cat a.c #include static PyObject * f(PyObject *self, PyObject *args) { const char *text; int len; if (!PyArg_ParseTuple(args, "s#", &text, &len)) return NULL;...
I had to apply a patch to get 0.9 to pass the test suite against gcc-4.7.0-4.fc17 Opening this ticket to track things
When building the plugin with "make", it builds fine, but all tests immediately fail: e.g. {{{ --- Expected stderr +++ Actual stderr @@ -1,13 +1,4 @@ -tests/cpychecker/PyArg_Parse/incorrect_codes_S_and_U/input.c: In function 'incorrect_usage_of_S_and_U':...
Lots of false positives due to lack of interprocedual knowledge. See e.g.: http://fedorapeople.org/~dmalcolm/gcc-python-plugin/2012-04-04/rrdtool-1.4.7-5.fc17/rrdtool-1.4.7/bindings/python/build/temp.linux-x86_64-2.7/rrdtoolmodule.c.PyRRD_graph-refcount-errors.html#report-2 where presumably create_args() < 0 implies that an exception has already been set. Similarly: identify functions that...
See e.g.: http://fedorapeople.org/~dmalcolm/gcc-python-plugin/2012-04-03/python-kaa-base-0.6.0-6.fc17/kaa-base-0.6.0/build/temp.linux-x86_64-2.7/src/extensions/shmmodule.c.PyShm_memory-refcount-errors.html#report-1 PyMapping_HasKey should imply that PyDict_GetItem should succeed, but the checker erroneoulsly considers that the latter could.
Checking sanlock-python the following error is raised: {{{ /home/simon/gcc-python-plugin/gcc-with-cpychecker -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions...
currently, when PyErr_Occurred() is called, the transition's description merely says "PyErr_Occurred()" It ought to describe NULL vs non-NULL exceptions, to make it easier to read traces