Issue 1086555: refcount problem in syslog (original) (raw)
Refcount problem in syslog.openlog, dating back awhile:
Python 2.5a0 (#10, Dec 15 2004, 19:53:33) [GCC 3.3.3 (Debian 20040401)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import syslog [25538 refs] syslog.openlog('a') [25539 refs] syslog.openlog(0) Traceback (most recent call last): File "", line 1, in ? TypeError: ident string [, logoption [, facility]] [25575 refs] syslog.openlog(0) Traceback (most recent call last): File "", line 1, in ? TypeError: ident string [, logoption [, facility]] [25574 refs] syslog.openlog(0) Traceback (most recent call last): File "", line 1, in ? TypeError: ident string [, logoption [, facility]] [25573 refs]
[etc..]
syslog.openlog(0) Fatal Python error: /home/doug/cvsroot/python/dist/src/Modules/syslogmodule.c:62 object at 0x402d75d8 has negative ref count -4 Aborted
ISTM there's a misplaced Py_XDECREF in syslog_openlog. It's fine as long as no log is open, but after that each failed PyArg_ParseTuple costs you a ref.