This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Erick.Tryzelaar
Recipients Erick.Tryzelaar
Date 2011-01-03.01:33:44
SpamBayes Score 0.0001045129
Marked as misclassified No
Message-id <1294018427.94.0.141740646278.issue10811@psf.upfronthosting.co.za>
In-reply-to
Content
I found that the sqlite3 function executemany module crashes when passed in a generator that it iself is executing a query. It looks like this confuses the statement cache, and causes it to get cleared inappropriately in this case.

I've attached a file that exhibits the problem, which results in this stack trace:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000028
pysqlite_statement_mark_dirty (self=0x0) at /Users/Shared/erickt/Projects/py3k/Modules/_sqlite/statement.c:367
367	    self->in_use = 1;
(gdb) bt
#0  pysqlite_statement_mark_dirty (self=0x0) at /Users/Shared/erickt/Projects/py3k/Modules/_sqlite/statement.c:367
#1  0x000000010067e125 in _pysqlite_query_execute (self=0x100568880, multiple=1, args=<value temporarily unavailable, due to optimizations>) at /Users/Shared/erickt/Projects/py3k/Modules/_sqlite/cursor.c:625
#2  0x00000001000af6a2 in PyEval_EvalFrameEx (f=0x1003579f0, throwflag=<value temporarily unavailable, due to optimizations>) at Python/ceval.c:3874
#3  0x00000001000b000a in PyEval_EvalCodeEx (_co=0x1004977a0, globals=<value temporarily unavailable, due to optimizations>, locals=<value temporarily unavailable, due to optimizations>, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3310
#4  0x00000001000b031f in PyEval_EvalCode (co=<value temporarily unavailable, due to optimizations>, globals=<value temporarily unavailable, due to optimizations>, locals=<value temporarily unavailable, due to optimizations>) at Python/ceval.c:760
#5  0x00000001000d71eb in run_mod [inlined] () at /Users/Shared/erickt/Projects/py3k/Python/pythonrun.c:1759
#6  0x00000001000d71eb in PyRun_FileExFlags (fp=0x7fff703f6f40, filename=0x1005c9190 "/Users/erickt/sqlite-crash.py", start=<value temporarily unavailable, due to optimizations>, globals=0x100325220, locals=0x100325220, closeit=1, flags=0x7fff5fbfef90) at Python/pythonrun.c:1716
#7  0x00000001000d74b9 in PyRun_SimpleFileExFlags (fp=0x7fff703f6f40, filename=0x1005c9190 "/Users/erickt/sqlite-crash.py", closeit=1, flags=0x7fff5fbfef90) at Python/pythonrun.c:1241
#8  0x00000001000ebe13 in Py_Main (argc=4832928, argv=<value temporarily unavailable, due to optimizations>) at Modules/main.c:297
#9  0x0000000100000abf in main (argc=2, argv=0x7fff5fbff090) at ./Modules/python.c:59
History
Date User Action Args
2011-01-03 01:33:48Erick.Tryzelaarsetrecipients: + Erick.Tryzelaar
2011-01-03 01:33:47Erick.Tryzelaarsetmessageid: <1294018427.94.0.141740646278.issue10811@psf.upfronthosting.co.za>
2011-01-03 01:33:45Erick.Tryzelaarlinkissue10811 messages
2011-01-03 01:33:44Erick.Tryzelaarcreate