Subject: | Crashes upon re-executing a statement |
When I build a statement and execute it twice with selectall_arrayref, I get a segfault. I don't get the segfault when I build a fresh statement each time. The statement is just a simple 'select <column> from <table> where <column> = ?', bound to different value each time.
The relevant backtrace is:
#0 0xb71e74ac in vdbeUnbind (p=0x0, i=0) at vdbeapi.c:425
#1 0xb71e755c in bindText (pStmt=0x0, i=1, zData=0x87403b0, nData=0, xDel=0, encoding=1) at vdbeapi.c:455
#2 0xb71e7796 in sqlite3_bind_text (pStmt=0x0, i=0, zData=0x0, nData=0, xDel=0) at vdbeapi.c:514
#3 0xb71be6d1 in sqlite_st_execute (sth=0x870f558, imp_sth=0x873c8f0) at dbdimp.c:355
#4 0xb71aafc7 in XS_DBD__SQLite__db_selectall_arrayref (my_perl=0x814c008, cv=0x871384c) at SQLite.xsi:136
#5 0xb7208b30 in XS_DBI_dispatch () from /usr/lib/perl5/auto/DBI/DBI.so
And the relevant trace obtained by setting $dbh->trace('4|ALL|SQL') is:
-> selectall_arrayref for DBD::SQLite::db (DBI::db=HASH(0x8737ad0)~0x8737db8 DBI::st=HASH(0x87385b8) HASH(0x8765bd4) 'vek') thr#814c008
sqlite trace: bind into 0x8722fe8: 1 => vek (0) pos 0
at dbdimp.c line 434
sqlite trace: re-prepare statement at dbdimp.c line 316
sqlite trace: params left in 0x8722fe8: 0 at dbdimp.c line 330
sqlite trace: bind 0 type 0 as vek at dbdimp.c line 331
zsh: segmentation fault (core dumped) ./xxxv
Note: I first thought that I am passing a wrong reference and so I filed bug #9789. That bug might thus be a false alarm (though it can't hurt to improve sanity-checking).
Note: This bug might be related to bugs #9643 and #9663, though neither of them mentions crashing.
I'll try to get extra information, if you ask me.
My configuration: Debian unstable, perl 5.8.4-5, sqlite3 3.0.8-3, DBI::SQLite 1.07 (installed manualy).