davidmalcolm / gcc-python-plugin

GCC plugin that embeds CPython inside the compiler
GNU General Public License v3.0
199 stars 58 forks source link

PyErr_NormalizeException or PyErr_Restore mishandled #93

Open davidmalcolm opened 7 years ago

davidmalcolm commented 7 years ago

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 commented 7 years ago

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