develooper Front page | perl.perl5.porters | Postings from July 2012

[perl #113644] Panic error ("attempt to copy freed scalar") in perl5db.pl:3733

From:
Father Chrysostomos via RT
Date:
July 13, 2012 20:13
Subject:
[perl #113644] Panic error ("attempt to copy freed scalar") in perl5db.pl:3733
Message ID:
rt-3.6.HEAD-11172-1342235617-224.113644-15-0@perl.org
On Thu Jun 14 12:44:21 2012, ericp wrote:
> Message-Id: <5.10.0_3332_1339702004@edsel.activestate.com>
> 
> This is a bug report for perl from ericp@activestate.com,
> generated with the help of perlbug 1.36 running under perl 5.10.0.
> 
> 
> -----------------------------------------------------------------
> [Please enter your report here]
> 
> Debug this program in the command-line (using 5.10.0)
> 
> ########################################
> use strict;
> use warnings;
> 
> use DBI;
> 
> my $DBUSER = 'root';
> my $DBPASS = 'password';
> my $DBNAME = 'fc02';
> 
> my $dbh = DBI->connect('DBI:mysql:' . $DBNAME, $DBUSER, $DBPASS);
> 
> if($DBI::errstr){
>    print STDERR $DBI::errstr . "\n";
>    exit 1;
> }
> 
> $dbh->do('create table info(id int auto_increment PRIMARY KEY, data
>    varchar(255))');
> 
> $dbh->begin_work();
> 
> $dbh->do('INSERT INTO info(data) VALUES(123)');
> $dbh->do('INSERT INTO info(data) VALUES(456)');
> $dbh->do('INSERT INTO info(data) VALUES(789)');
> 
> my $status = $dbh->commit();
> 
> exit 0;
> ###########################################################
> 
> c:> perl -d bug-mysql-freed-scalar.pl
> 
> Loading DB routines from perl5db.pl version 1.3
> Editor support available.
> 
> Enter h or `h h' for help, or `perldoc perldebug' for more help.
> 
> main::(bug-mysql-freed-scalar.pl:6):
> 6:      my $DBUSER = 'root';
>    DB<1> b 25
> 
>    DB<2> c
> DBD::mysql::db do failed: Table 'info' already exists at bug-mysql-
>    freed-scalar
> pl line 17.
>   at bug-mysql-freed-scalar.pl line 17
> main::(bug-mysql-freed-scalar.pl:25):
> 25:     my $status = $dbh->commit();
> 
>    DB<2> n
> panic: attempt to copy freed scalar 3c8d45c to 2936664 at
>    C:/Perl/lib/perl5db.p
>   line 3733.
>   at C:/Perl/lib/perl5db.pl line 3733
> Debugged program terminated.  Use q to quit or R to restart,
>    use o inhibit_exit to avoid stopping after program termination,
>    h q, h R or h o to get additional info.
> 
> This happens with the call to
> 
> $ret = &$sub;
> 
> in DB::sub

I don’t have mysql installed, so it’s not easy for me to test this.  I
know I fixed some problems with $DB::sub in perl 5.16.  Could you try
that version and see whether the problem persists?

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=113644



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About