gcc-python-plugin icon indicating copy to clipboard operation
gcc-python-plugin copied to clipboard

PyErr_NormalizeException or PyErr_Restore mishandled

Open davidmalcolm opened this issue 8 years ago • 1 comments

Analyzing _cbsonmodule.c from this revision:

https://github.com/mongodb/mongo-python-driver/commit/ba66a2dde7b85bf1af5d64c245d5d27102c11f59

I get the attached error report, claiming that "ob_refcnt of '*msg' is 1 too high". But I believe the refcount is correct, especially since adding a DECREF causes intermittent segfaults later in the program's execution (during GC).

I hypothesize CPyChecker misunderstands the ref semantics of either PyErr_NormalizeException or PyErr_Restore.

Fedora 18, GCC 4.7.2, Python 2.7.3, gcc-python-plugin at rev 6d8b81c0.

davidmalcolm avatar Feb 09 '17 20:02 davidmalcolm

Imported from trac issue 53. Created by emptysquare on 2013-08-15T13:28:06, last modified: 2013-08-15T13:28:06

davidmalcolm avatar Feb 09 '17 20:02 davidmalcolm