Skip Menu |

This queue is for tickets about the DBI CPAN distribution.

Report information
The Basics
Id: 18117
Status: resolved
Priority: 0/
Queue: DBI

People
Owner: Nobody in particular
Requestors: dbi+cpan [...] johnbokma.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 1.49
  • 1.50
Fixed in: (no value)



Subject: Attempt to free unreferenced scalar
get method in LWP::UserAgent dies with "Attempt to free unreferenced scalar: SV 0x1cda4e8, Perl interpreter: 0x22432c at C:/Perl/lib/Errno.pm line 15." after either selectall_hashref or fetchall_hashref has been called. See http://johnbokma.com/mexit/2006/03/10/unreferenced-scalar-dbi-lwp.html for a sample program that shows this issue.
From: Chris Snell
I'm seeing a slightly different version of the same error, in a DBI-only test program: Attempt to free unreferenced scalar: SV 0x189d0c8, Perl interpreter: 0x21426c at c:/Perl/site/lib/DBI.pm line 1994. The very simple program opens database connection (using the DBD::ADO driver), does a SELECT and then spits out some output and exits.
A small self-contained test case would be a big help. (Ideally using a DBI-supplied driver like DBD::Sponge. Even better would be to modify one of the test script in t/*.t to trigger the warning)
Subject: Re: [rt.cpan.org #18117] Attempt to free unreferenced scalar
Date: Tue, 25 Apr 2006 18:23:31 -0500
To: bug-DBI [...] rt.cpan.org
From: John Bokma <mail [...] johnbokma.com>
Tim_Bunce via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=18117 > > > A small self-contained test case would be a big help. (Ideally using a DBI-supplied driver like > DBD::Sponge. Even better would be to modify one of the test script in t/*.t to trigger the > warning)
Hi Tim, http://johnbokma.com/mexit/2006/03/10/unreferenced-scalar-dbi-lwp.html has a small test script. I'll check later if I can reproduce it with DBD::Sponge. It fails with the MySQL driver as well. Regards, John
Subject: Re: [rt.cpan.org #18117] Attempt to free unreferenced scalar
Date: Tue, 25 Apr 2006 21:01:25 -0500
To: bug-DBI [...] rt.cpan.org
From: John Bokma <mail [...] johnbokma.com>
Hi Tim, Test script that shows the problem using DBM: http://johnbokma.com/mexit/2006/04/25/free-unreferenced-scalar-dbi-lwp.html As far as I could tell Sponge can't do selectall_hashref, etc. (at least the documentation was way too brief for me to make anything useful out of it). I will add more info to the blog entry, but I think the script is clear enough and the issue can be reproduced with it. Regards, John
CC: dbi+cpan [...] johnbokma.com, TIMB [...] cpan.org
Subject: Re: [rt.cpan.org #18117] Attempt to free unreferenced scalar
Date: Tue, 25 Apr 2006 20:23:14 -0700
To: John Bokma via RT <bug-DBI [...] rt.cpan.org>
From: Tim Bunce <Tim.Bunce [...] pobox.com>
On Tue, Apr 25, 2006 at 10:02:28PM -0400, John Bokma via RT wrote: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=18117 > > > Hi Tim, > > Test script that shows the problem using DBM: > http://johnbokma.com/mexit/2006/04/25/free-unreferenced-scalar-dbi-lwp.html > > As far as I could tell Sponge can't do selectall_hashref, etc. (at least > the documentation was way too brief for me to make anything useful out of it).
Sponge is just a way to pre-load a bunch of rows which can then be fetched. See http://search.cpan.org/src/TIMB/DBI-1.50/t/11fetch.t Show quoted text
> I will add more info to the blog entry, but I think the script is clear > enough and the issue can be reproduced with it.
You're right. Sorry - I hadn't looked at it closely enough. It's tried it now but can't reproduce the problem on my (unix) machine using perl 5.8.6. You've not quoted the version of perl you're using. Perhaps you could try ugrading it. Tim.
From: Hai Pham <hpham [...] re-trac.com>
I am able to reproduce the bug with John's test script on ActiveState perl v5.8.8.817 with DBI 1.50 On Tue Apr 25 23:23:43 2006, Tim.Bunce@pobox.com wrote: Show quoted text
> On Tue, Apr 25, 2006 at 10:02:28PM -0400, John Bokma via RT wrote:
> > > > <URL: http://rt.cpan.org/Ticket/Display.html?id=18117 > > > > > Hi Tim, > > > > Test script that shows the problem using DBM: > > http://johnbokma.com/mexit/2006/04/25/free-unreferenced-scalar-dbi-
> lwp.html
> > > > As far as I could tell Sponge can't do selectall_hashref, etc. (at
> least
> > the documentation was way too brief for me to make anything useful
> out of it). > > Sponge is just a way to pre-load a bunch of rows which can then be > fetched. See http://search.cpan.org/src/TIMB/DBI-1.50/t/11fetch.t >
> > I will add more info to the blog entry, but I think the script is
> clear
> > enough and the issue can be reproduced with it.
> > You're right. Sorry - I hadn't looked at it closely enough. > > It's tried it now but can't reproduce the problem on my (unix) machine > using perl 5.8.6. You've not quoted the version of perl you're using. > Perhaps you could try ugrading it. > > Tim.
From: harold.frayman [...] observer.co.uk
On Fri Mar 10 23:49:12 2006, guest wrote: Show quoted text
> get method in LWP::UserAgent dies with "Attempt to free unreferenced > scalar: SV 0x1cda4e8, Perl interpreter: 0x22432c at C:/Perl/lib/Errno.pm > line 15." after either selectall_hashref or fetchall_hashref has been > called. See > http://johnbokma.com/mexit/2006/03/10/unreferenced-scalar-dbi-lwp.html > > for a sample program that shows this issue.
I thought I was getting a similar problem with lwp but in the end it turned out to be my use of Unix::Syslog -- I was opening and closing the log twice and the second attempt to close produced the "Attempt ..." message. Opening/closing the log once sent the message way. That was running under Mac OS X. Identical code ran quite happily under Fedora. Go tell.
I can't make any progress on this unless I can reproduce it. It seems to only happen on Windows systems and I don't use Windows (at all). Perhaps you could find someone with Windows experience to look into it. Ideally by creating a bug report at activestate.com. For now I'm marking this ticket as 'stalled'.
I'm going to close this ticket now as no one has reported it recently.