Skip Menu |
 

This queue is for tickets about the CGI-Session CPAN distribution.

Report information
The Basics
Id: 46264
Status: resolved
Priority: 0/
Queue: CGI-Session

People
Owner: Nobody in particular
Requestors: eponymousalias [...] yahoo.com
Cc:
AdminCc:

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



MIME-Version: 1.0
X-Ymail-Osg: 5.acoGMVM1nCI6eGevMNsUIP5sKivcHfNf0H0JaGQYJ17MMdLdc34loHw6ExeuEYfuJebpD_E1htRfzLgA0dvoHhv4Rf2.VfpP3zwjh.F4_eZwsPwLgwiZw9_fQBIEZSVYlUy0Huzz7y.v4TjfHQTBrLCOkd5HcJk3amRzcaUxEIcBQxq3h4g_jY1XG8LHapNNd9q5sap0lcfLSRZs0JLkXf7vuyizekr0jdg9RHlI0qGFMG22GNzeI7h6afHsZjmpjBZG1KDJafJtEuRo5jQQXUkb.NR4FTLPi0erYdadU-
X-Spam-Status: No, hits=0.0 required=8.0 tests=DK_POLICY_TESTING,DK_SIGNED,DK_VERIFIED
X-Mailer: YahooMailClassic/5.3.9 YahooMailWebService/0.7.289.10
content-type: text/plain; charset="utf-8"
Message-ID: <981813.65544.qm [...] web36601.mail.mud.yahoo.com>
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id B87504D8113 for <bug-CGI-Session [...] rt.cpan.org>; Thu, 21 May 2009 00:51:00 -0400 (EDT)
Received: (qmail 28927 invoked by uid 103); 21 May 2009 04:51:00 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 21 May 2009 04:51:00 -0000
Received: from web36601.mail.mud.yahoo.com (HELO web36601.mail.mud.yahoo.com) (209.191.85.18) by 16.mx.develooper.com (qpsmtpd/0.80) with SMTP; Wed, 20 May 2009 21:50:53 -0700
Received: (qmail 65560 invoked by uid 60001); 21 May 2009 04:50:50 -0000
Received: from [69.228.204.127] by web36601.mail.mud.yahoo.com via HTTP; Wed, 20 May 2009 21:50:49 PDT
Delivered-To: cpan-bug+CGI-Session [...] diesel.bestpractical.com
Subject: failure to clean up in CGI::Session:Driver::DBI routines
Return-Path: <eponymousalias [...] yahoo.com>
Domainkey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=UgjJDZ2qAK7XSJHeI8rRkwdQfjv6q9Nd53WZxgt6WE72J5Vhkv8bbvEuu6t0QD0l8W1Ff2mgZc5AK9MnEDEt7BDyzzuUp2dXlVGoIGmfUD4msKmx2U94ht4ePMROdlRg0MtJv5s+7VrfoXyrY5JuFZFjBr+evO/+DOpPeWDw07U=;
X-Original-To: bug-CGI-Session [...] rt.cpan.org
X-Spam-Check-BY: 16.mx.develooper.com
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1242881450; bh=/bfQE6X2K3yKhn8OVl7Otbxr+Bfwpe+2KnzSwrlXIkc=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=wbOThrqK3zxpeRYNv03Xn1X5SsCc1YAe9sMeRkhqJQlpPPDtVb/MqBONrfsYIi2zIc5HcfGV++dd1bK8MGpaeuu6TKffeXubPzXBpXd+R61zx4XdVZaq9RDRUAO5KQcRW2L+d93KjENdQbdBAheoP1cfD0WDNqq9AgqWFXHzrJE=
Date: Wed, 20 May 2009 21:50:49 -0700 (PDT)
X-Spam-Level: *
To: bug-CGI-Session [...] rt.cpan.org
From: eponymous alias <eponymousalias [...] yahoo.com>
X-RT-Original-Encoding: us-ascii
Content-Length: 1383
Download (untitled) / with headers
text/plain 1.3k
The CGI-Session-4.00_08/Session/Driver/DBI.pm routines do not properly close out their statement handles before returning. This results in resources needlessly held for the duration of the session, and in error messages when the database handle is ultimately closed. For instance, the code needs the following change: --- DBI.pm.orig Fri Feb 11 00:18:27 2005 +++ DBI.pm Wed May 20 21:35:27 2009 @@ -57,6 +57,7 @@ $sth->execute( $sid ) or return $self->set_error( "retrieve(): \$sth->execute failed with error message " . $dbh->errstr); my ($row) = $sth->fetchrow_array(); + $sth->finish; return 0 unless $row; return $row; } As an example of what the present construction causes, we see the following message continually in the Apache error logs: DBI::db=HASH(0x2439990)->disconnect invalidates 1 active statement handle (either destroy statement handles or call finish on them before disconnecting) due to the particular missing cleanup noted above. That kind of fix (adding $sth->finish; calls) applies not just to the retrieve routine, but also to most other routines in the DBI.pm file. Every time a local statement handle is created in such a routine, it should be destroyed with a $sth->finish; call before the routine is exited, no matter what code path is followed.
X-Ymail-Osg: yHX7hNEVM1kyLu5OtXVlXvnfWC_XBO4BPcmQsh90HJ7ZbXDFnW2UASKTK4nWxSPU39KcXIIG4aYOnBYDdhn1YB3ufJxAJQw70W13LS9PXWz5GUTC0D2tJ8ICUiEtomzLm90hqzUjTKzL3vWVi1PW4agoZpQIOh0zmbjSWCCRPJpW67AGMoitUCAAawqOqJ9j4S.RNsEdxoF57rrRzLPFdcCBQerlvqfm09ptHvkbTeHgXuSmd4QbwypznIltWvbp4ugKfwu0DdleLLi6iD6L1xgJobOe8EL8dF5RIpn4BsALLw.N0ShKJrY3jRbzr4AZ5P6uZo2QyLD.TewGjoDUZg--
MIME-Version: 1.0
X-Spam-Status: No, hits=0.0 required=8.0 tests=DK_POLICY_TESTING,DK_SIGNED,DK_VERIFIED
X-Mailer: YahooMailClassic/5.3.9 YahooMailWebService/0.7.289.10
Message-ID: <609285.34816.qm [...] web36606.mail.mud.yahoo.com>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id A85C94D8113 for <bug-CGI-Session [...] rt.cpan.org>; Thu, 21 May 2009 03:43:09 -0400 (EDT)
Received: (qmail 27262 invoked by uid 103); 21 May 2009 07:43:09 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 21 May 2009 07:43:09 -0000
Received: from web36606.mail.mud.yahoo.com (HELO web36606.mail.mud.yahoo.com) (209.191.85.23) by 16.mx.develooper.com (qpsmtpd/0.80) with SMTP; Thu, 21 May 2009 00:43:03 -0700
Received: (qmail 36036 invoked by uid 60001); 21 May 2009 07:43:00 -0000
Received: from [69.228.204.127] by web36606.mail.mud.yahoo.com via HTTP; Thu, 21 May 2009 00:42:59 PDT
Delivered-To: cpan-bug+CGI-Session [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #46264] AutoReply: failure to clean up in CGI::Session:Driver::DBI routines
Domainkey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=5RkRmS6BO/wNhTdmbIM8Syl35b/3tEpNg0F2POJdMe6zjiVjUkbb0xdC7PnRtf4Q0BhJG7z+frq37hcp2zfGRPRKLtxOcvUwDRE/4RuZuZFFD/JBkKdpuaL1j9fdyAa0iouXvdGj1OH01kD6lHgTVh1OPB6oBP2VptYWg1oCxO4=;
Return-Path: <eponymousalias [...] yahoo.com>
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1242891780; bh=7aXBgGZlb7LAemlxUhR4EwIdw1ZGlWVmsyUsReF/ijs=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=tsNd9uJdLZcrkXGwZOtsv2ub6oqHCruh0UYP5Rvud3Oc6cjqDDct4FTbQjy6EdX4Fsc1sT3dK9A5duULQi5ZPsdokL2OSq+QFMevWMAY+m0+ZreYM3oUn6BjgoNOwO9RdwY32RpuzFlJA9H86hUWpbabxer49Xa5m0x2gm4kbrk=
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-CGI-Session [...] rt.cpan.org
Date: Thu, 21 May 2009 00:42:59 -0700 (PDT)
X-Spam-Level: *
To: bug-CGI-Session [...] rt.cpan.org
From: eponymous alias <eponymousalias [...] yahoo.com>
RT-Message-ID: <rt-3.6.HEAD-19052-1242891799-1633.46264-0-0 [...] rt.cpan.org>
Content-Length: 2807
Download (untitled) / with headers
text/plain 2.7k
Just after I posted this bug report, I found the latest release of CGI::Session, and I see it is fixed in that release. Sorry for the noise. --- On Wed, 5/20/09, Bugs in CGI-Session via RT <bug-CGI-Session@rt.cpan.org> wrote: Show quoted text
> From: Bugs in CGI-Session via RT <bug-CGI-Session@rt.cpan.org> > Subject: [rt.cpan.org #46264] AutoReply: failure to clean up in CGI::Session:Driver::DBI routines > To: eponymousalias@yahoo.com > Date: Wednesday, May 20, 2009, 9:51 PM > > Greetings, > > This message has been automatically generated in response > to the > creation of a trouble ticket regarding: > "failure to clean up in > CGI::Session:Driver::DBI routines", > a summary of which appears below. > > There is no need to reply to this message right now. > Your ticket has been > assigned an ID of [rt.cpan.org #46264]. Your ticket > is accessible > on the web at: > > http://rt.cpan.org/Ticket/Display.html?id=46264 > > Please include the string: > > [rt.cpan.org > #46264] > > in the subject line of all future correspondence about this > issue. To do so, > you may reply to this message. > > > Thank you, > > bug-CGI-Session@rt.cpan.org > > ------------------------------------------------------------------------- > > The CGI-Session-4.00_08/Session/Driver/DBI.pm routines do > not > properly close out their statement handles before > returning. > This results in resources needlessly held for the duration > of > the session, and in error messages when the database > handle > is ultimately closed. For instance, the code needs > the > following change: > > --- DBI.pm.orig Fri Feb 11 00:18:27 2005 > +++ DBI.pm Wed May 20 > 21:35:27 2009 > @@ -57,6 +57,7 @@ > $sth->execute( > $sid ) or return $self->set_error( "retrieve(): > \$sth->execute failed with error message " . > $dbh->errstr); > > my ($row) = > $sth->fetchrow_array(); > + $sth->finish; > return 0 unless > $row; > return $row; > } > > As an example of what the present construction causes, we > see > the following message continually in the Apache error > logs: > > DBI::db=HASH(0x2439990)->disconnect > invalidates 1 active > statement handle (either > destroy statement handles or > call finish on them before > disconnecting) > > due to the particular missing cleanup noted above. > > That kind of fix (adding $sth->finish; calls) applies > not just > to the retrieve routine, but also to most other routines > in > the DBI.pm file. Every time a local statement handle > is > created in such a routine, it should be destroyed with a > $sth->finish; call before the routine is exited, no > matter > what code path is followed. > > > > > >
MIME-Version: 1.0
In-Reply-To: <981813.65544.qm [...] web36601.mail.mud.yahoo.com>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Charset: utf8
References: <981813.65544.qm [...] web36601.mail.mud.yahoo.com>
Content-Type: text/plain
Message-ID: <rt-3.6.HEAD-30017-1251689114-708.46264-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 97
I'm setting this to Resolved because the submitter has noticed that code had been fixed already.


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.