Subject: | Segfault in disconnected sqlite_db_filename |
Date: | Thu, 29 May 2014 01:48:17 -0400 |
To: | bug-DBD-SQLite [...] rt.cpan.org |
From: | Alex Vandiver <alex [...] chmrr.net> |
Calling sqlite_db_filename on a disconnected database handle can cause
reliable segmentation faults; replication case and backtrace below.
- Alex
------------------------8<-------------------------
#!/usr/bin/env perl
use strict;
use warnings;
use DBI;
my $dbh = DBI->connect("dbi:SQLite:dbname=tmpfile","","");
$dbh->disconnect;
my $data = [];
for (1..500) {
$data = [$data];
$dbh->sqlite_db_filename;
}
------------------------8<-------------------------
(gdb) bt
#0 0x00007ffff63eb147 in sqlite3_stricmp (zLeft=<optimized out>, zRight=<optimized out>)
at sqlite3.c:21956
#1 0x00007ffff63ef878 in sqlite3DbNameToBtree (db=0xd713b8, zDbName=0x7ffff647350d "main")
at sqlite3.c:123423
#2 0x00007ffff63ef939 in sqlite3_db_filename (db=<optimized out>, zDbName=<optimized out>)
at sqlite3.c:123436
#3 0x00007ffff63e97e1 in sqlite_db_filename (dbh=<optimized out>) at dbdimp.c:1377
#4 0x00007ffff63de32a in XS_DBD__SQLite__db_db_filename (cv=<optimized out>)
at SQLite.xs:260
#5 0x00007ffff68dfcdd in XS_DBI_dispatch (cv=0xd81140) at DBI.xs:3746
#6 0x0000000000597ceb in Perl_pp_entersub () at pp_hot.c:2795
#7 0x0000000000538817 in Perl_runops_debug () at dump.c:2428
#8 0x000000000045898a in S_run_body (oldscope=1) at perl.c:2456
#9 0x000000000045801e in perl_run (my_perl=0xa3a010) at perl.c:2372
#10 0x000000000041d0cc in main (argc=2, argv=0x7fffffffd9d8, env=0x7fffffffd9f0)
at perlmain.c:114