Issue 2515: Segfault while operating on closed sqlite3 cursor. (original) (raw)

Replicated on:

#Ubuntu 7.0 Python 2.5.1 (r251:54863, Mar 7 2008, 03:39:23) [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2

#OS 10.4.11 Python 2.5.1 (r251:54863, Oct 26 2007, 16:52:32) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin

#OS 10.5.2 Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin

this works with python 2.6. for python 2.5.1 I get the following gdb backtrace: (gdb) bt #0 0x00002b0d95118e2d in cursor_iternext (self=0x2b0d93bae870) at /root/src/Python-2.5.1/Modules/_sqlite/cursor.c:854 #1 0x00002b0d93dd1769 in wrap_next (self=0x2b0d94085b50, args=0x2b0d93b5f468, wrapped=0x2b0d95118d90) at Objects/typeobject.c:3897 #2 0x00002b0d93d7e0e3 in PyObject_Call (func=0x2b0d94085b50, arg=0x2b0d93b5f468, kw=0x2b0d95118d90) at Objects/abstract.c:1860 #3 0x00002b0d93df9549 in PyEval_EvalFrameEx (f=0x664430, throwflag=) at Python/ceval.c:3775 #4 0x00002b0d93dfe308 in PyEval_EvalCodeEx (co=0x2b0d93ba8300, globals=, locals=, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2831 #5 0x00002b0d93dfe422 in PyEval_EvalCode (co=0x2b0d94085b50, globals=0x2b0d93b5f468, locals=0x2b0d95118d90) at Python/ceval.c:494 #6 0x00002b0d93e20f01 in PyRun_FileExFlags (fp=0x601010, filename=0x7fff16f87a77 "sqlite_segfault.py", start=, globals=0x6246d0, locals=0x6246d0, closeit=1, flags=0x7fff16f86600) at Python/pythonrun.c:1271 #7 0x00002b0d93e2119b in PyRun_SimpleFileExFlags (fp=0x601010, filename=0x7fff16f87a77 "sqlite_segfault.py", closeit=1, flags=0x7fff16f86600) at Python/pythonrun.c:877 #8 0x00002b0d93e29f2a in Py_Main (argc=, argv=) at Modules/main.c:523