Skip Menu |
 

This queue is for tickets about the DBD-SQLite CPAN distribution.

Report information
The Basics
Id: 96050
Status: resolved
Priority: 0/
Queue: DBD-SQLite

People
Owner: Nobody in particular
Requestors: alex [...] chmrr.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



MIME-Version: 1.0
X-Spam-Status: No, score=-0.822 tagged_above=-99.9 required=10 tests=[AWL=1.349, BAYES_00=-1.9, RP_MATCHES_RCVD=-0.272, WEIRD_QUOTING=0.001] autolearn=ham
X-Spam-Flag: NO
content-type: text/plain; charset="utf-8"
Message-ID: <5386CA21.3010908 [...] chmrr.net>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Connected-Ip: 207.180.139.43:51092
X-Date: 2014-05-29 01:48:20
X-Spam-Score: -0.822
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id D1913240928 for <cpan-bug+DBD-SQLite [...] hipster.bestpractical.com>; Thu, 29 May 2014 01:48:31 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hGs0553fNvlo for <cpan-bug+DBD-SQLite [...] hipster.bestpractical.com>; Thu, 29 May 2014 01:48:31 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id CF2FE240923 for <bug-DBD-SQLite [...] rt.cpan.org>; Thu, 29 May 2014 01:48:30 -0400 (EDT)
Received: (qmail 19685 invoked by alias); 29 May 2014 05:48:30 -0000
Received: from chmrr.net (HELO utwig.chmrr.net) (209.67.253.66) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Wed, 28 May 2014 22:48:27 -0700
Received: from 207-180-139-43.ma.subnet.cable.rcn.com ([207.180.139.43] helo=[192.168.1.145]) by utwig.chmrr.net with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from <alex [...] chmrr.net>) id 1WptCN-00089A-M5 for bug-DBD-SQLite [...] rt.cpan.org; Thu, 29 May 2014 01:48:20 -0400
Delivered-To: cpan-bug+DBD-SQLite [...] hipster.bestpractical.com
Subject: Segfault in disconnected sqlite_db_filename
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0
Return-Path: <alex [...] chmrr.net>
X-RT-Mail-Extension: dbd-sqlite
X-Original-To: cpan-bug+DBD-SQLite [...] hipster.bestpractical.com
X-Spam-Check-BY: la.mx.develooper.com
Date: Thu, 29 May 2014 01:48:17 -0400
X-Sender-Verify: SUCCEEDED (sender exists & accepts mail)
X-Authenticated-User: chmrr
X-Spam-Level:
To: bug-DBD-SQLite [...] rt.cpan.org
X-Exim-Version: 4.76 (build at 25-May-2011 17:04:25)
X-Authenticator: plain
Content-Transfer-Encoding: 7bit
X-Enigmail-Version: 1.6
From: Alex Vandiver <alex [...] chmrr.net>
X-RT-Original-Encoding: iso-8859-1
X-RT-Interface: Email
Content-Length: 1440
Download (untitled) / with headers
text/plain 1.4k
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
MIME-Version: 1.0
In-Reply-To: <5386CA21.3010908 [...] chmrr.net>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <5386CA21.3010908 [...] chmrr.net>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-28521-1401347471-1390.96050-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 1711
Download (untitled) / with headers
text/plain 1.6k
Thanks for the report. Patched at master: https://github.com/DBD-SQLite/DBD-SQLite/commit/81d4d11fa152eddc847ffa34f5ecb4532147373d On Thu May 29 14:48:33 2014, alex@chmrr.net wrote: Show quoted text
> 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
MIME-Version: 1.0
X-Spam-Status: No, score=-3.199 tagged_above=-99.9 required=10 tests=[AWL=0.973, BAYES_00=-1.9, FROM_OUR_RT=-2, RP_MATCHES_RCVD=-0.272] autolearn=ham
In-Reply-To: <rt-4.0.18-28521-1401347471-1060.96050-6-0 [...] rt.cpan.org>
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-96050 [...] rt.cpan.org> <5386CA21.3010908 [...] chmrr.net> <rt-4.0.18-28521-1401347471-1060.96050-6-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <53875908.9080508 [...] chmrr.net>
content-type: text/plain; charset="utf-8"
X-Connected-Ip: 75.147.59.54:47076
X-Date: 2014-05-29 11:58:03
X-RT-Original-Encoding: utf-8
X-Spam-Score: -3.199
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 7E56F61E00D for <cpan-bug+DBD-SQLite [...] hipster.bestpractical.com>; Thu, 29 May 2014 11:58:14 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F0NDatuCFKb9 for <cpan-bug+DBD-SQLite [...] hipster.bestpractical.com>; Thu, 29 May 2014 11:58:13 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 3AF25240503 for <bug-DBD-SQLite [...] rt.cpan.org>; Thu, 29 May 2014 11:58:13 -0400 (EDT)
Received: (qmail 10591 invoked by alias); 29 May 2014 15:58:13 -0000
Received: from chmrr.net (HELO utwig.chmrr.net) (209.67.253.66) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Thu, 29 May 2014 08:58:11 -0700
Received: from 75-147-59-54-newengland.hfc.comcastbusiness.net ([75.147.59.54] helo=[10.1.10.102]) by utwig.chmrr.net with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from <alex [...] chmrr.net>) id 1Wq2iQ-0000h7-6F for bug-DBD-SQLite [...] rt.cpan.org; Thu, 29 May 2014 11:58:03 -0400
Delivered-To: cpan-bug+DBD-SQLite [...] hipster.bestpractical.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0
Subject: Re: [rt.cpan.org #96050] Segfault in disconnected sqlite_db_filename
Return-Path: <alex [...] chmrr.net>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+DBD-SQLite [...] hipster.bestpractical.com
X-RT-Mail-Extension: dbd-sqlite
Date: Thu, 29 May 2014 11:58:00 -0400
X-Spam-Level:
X-Authenticated-User: chmrr
X-Sender-Verify: SUCCEEDED (sender exists & accepts mail)
To: bug-DBD-SQLite [...] rt.cpan.org
X-Enigmail-Version: 1.6
Content-Transfer-Encoding: 7bit
X-Authenticator: plain
X-Exim-Version: 4.76 (build at 25-May-2011 17:04:25)
From: Alex Vandiver <alex [...] chmrr.net>
RT-Message-ID: <rt-4.0.18-8105-1401379095-1442.96050-0-0 [...] rt.cpan.org>
Content-Length: 553
Download (untitled) / with headers
text/plain 553b
On 05/29/2014 03:11 AM, Kenichi Ishigaki via RT wrote: Show quoted text
Thanks for the quick fix! I'd argue that the warning isn't quite correct, however, as it causes the ->ping method to warn on a disconnected database -- which seems like a legitimate thing to do. Calling ->ping is what was actually triggering the bug for me, but proved not as reliable for triggering segfaults as calling ->sqlite_db_filename directly. - Alex
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-8105-1401379095-1442.96050-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <RT-Ticket-96050 [...] rt.cpan.org> <5386CA21.3010908 [...] chmrr.net> <rt-4.0.18-28521-1401347471-1060.96050-6-0 [...] rt.cpan.org> <53875908.9080508 [...] chmrr.net> <rt-4.0.18-8105-1401379095-1442.96050-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-25143-1401379748-1428.96050-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 730
Download (untitled) / with headers
text/plain 730b
Agreed. https://github.com/DBD-SQLite/DBD-SQLite/commit/0193c3f6ff17e150bdd59de3fa0894b899311847 On Fri May 30 00:58:15 2014, alex@chmrr.net wrote: Show quoted text
> On 05/29/2014 03:11 AM, Kenichi Ishigaki via RT wrote:
> > Thanks for the report. Patched at master: > > https://github.com/DBD-SQLite/DBD- > > SQLite/commit/81d4d11fa152eddc847ffa34f5ecb4532147373d
> > Thanks for the quick fix! I'd argue that the warning isn't quite > correct, however, as it causes the ->ping method to warn on a > disconnected database -- which seems like a legitimate thing to do. > Calling ->ping is what was actually triggering the bug for me, but > proved not as reliable for triggering segfaults as calling > ->sqlite_db_filename directly. > - Alex
MIME-Version: 1.0
In-Reply-To: <5386CA21.3010908 [...] chmrr.net>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <5386CA21.3010908 [...] chmrr.net>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-20279-1413992376-1258.96050-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 36
Closed as 1.44 was released. Thanks.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.