perl调用mysql时出现的错误——*** glibc detected *** perl: double free or corruption (!prev):

最近更新了一次perl,覆盖了原来系统自带的perl(从10.1到14.4).更新后重新安装了所需的模块DBI和DBD::msyql,但现在每次用perl调用mysql的时候,SQL语句可以执行成功,但就是会报错。脚本如下:
注:系统为CentOS6.4,尝试了很多方法和各个perl版本都不行,这个脚本在windows下运行正常。
###################
#执行的脚本
#!/usr/bin/perl
use5.10.1;
useDBI;
my$user='root';
my$password='root';
my$dsn='DBI:mysql:database=user;host=192.168.1.93;port=3306';
my$dbh=DBI->connect($dsn,$user,$password,{RaiseError=>1,AutoCommit=>0});#
$dbh->do("DROPTABLEIFEXISTStest");
$dbh->disconnect();
#####################
具体报错如下:
***glibcdetected***perl:doublefreeorcorruption(!prev):0x00000000020a4750***
=======Backtrace:=========
/lib64/libc.so.6[0x323fc760e6]
/lib64/libc.so.6[0x323fc78c13]
/usr/lib/perl5/site_perl/5.14.4/x86_64-linux/auto/DBD/mysql/mysql.so(mysql_db_destroy+0x3c)[0x7f303421c80c]
/usr/lib/perl5/site_perl/5.14.4/x86_64-linux/auto/DBD/mysql/mysql.so(XS_DBD__mysql__db_DESTROY+0x1e4)[0x7f3034225144]
/usr/lib/perl5/site_perl/5.14.4/x86_64-linux/auto/DBI/DBI.so(XS_DBI_dispatch+0x16d4)[0x7f303464bb54]
perl(Perl_pp_entersub+0x6a1)[0x48d6a1]
perl(Perl_call_sv+0x60b)[0x4300cb]
perl(Perl_sv_clear+0x53b)[0x496edb]
perl(Perl_sv_free2+0x36)[0x4975a6]
perl[0x479615]
perl(Perl_mg_free+0x23)[0x4796e3]
perl(Perl_sv_clear+0x171)[0x496b11]
perl(Perl_sv_free2+0x36)[0x4975a6]
perl(Perl_leave_scope+0x11c4)[0x4b9f04]
perl(Perl_pp_leave+0xf9)[0x48db79]
perl(Perl_runops_standard+0x13)[0x48bc63]
perl(perl_run+0x288)[0x430828]
perl(main+0x10c)[0x41c15c]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x323fc1ecdd]
perl[0x41bf89]
=======Memorymap:========
00400000-0054b000r-xp0000000008:0242753216/usr/bin/perl
0074a000-0074e000rw-p0014a00008:0242753216/usr/bin/perl
0074e000-0074f000rw-p0000000000:000
01e15000-020e2000rw-p0000000000:000[heap]
323f400000-323f420000r-xp0000000008:022097598/lib64/ld-2.12.so
323f61f000-323f620000r--p0001f00008:022097598/lib64/ld-2.12.so
323f620000-323f621000rw-p0002000008:022097598/lib64/ld-2.12.so
323f621000-323f622000rw-p0000000000:000
323f800000-323f883000r-xp0000000008:022097612/lib64/libm-2.12.so
323f883000-323fa82000---p0008300008:022097612/lib64/libm-2.12.so
323fa82000-323fa83000r--p0008200008:022097612/lib64/libm-2.12.so
323fa83000-323fa84000rw-p0008300008:022097612/lib64/libm-2.12.so
323fc00000-323fd8a000r-xp0000000008:022097599/lib64/libc-2.12.so
323fd8a000-323ff89000---p0018a00008:022097599/lib64/libc-2.12.so
323ff89000-323ff8d000r--p0018900008:022097599/lib64/libc-2.12.so
323ff8d000-323ff8e000rw-p0018d00008:022097599/lib64/libc-2.12.so
323ff8e000-323ff93000rw-p0000000000:000
3240000000-3240002000r-xp0000000008:022097605/lib64/libdl-2.12.so
3240002000-3240202000---p0000200008:022097605/lib64/libdl-2.12.so
3240202000-3240203000r--p0000200008:022097605/lib64/libdl-2.12.so
3240203000-3240204000rw-p0000300008:022097605/lib64/libdl-2.12.so
3240400000-3240417000r-xp0000000008:022097600/lib64/libpthread-2.12.so
3240417000-3240617000---p0001700008:022097600/lib64/libpthread-2.12.so
3240617000-3240618000r--p0001700008:022097600/lib64/libpthread-2.12.so
3240618000-3240619000rw-p0001800008:022097600/lib64/libpthread-2.12.so
3240619000-324061d000rw-p0000000000:000
3240c00000-3240c07000r-xp0000000008:022097601/lib64/librt-2.12.so
3240c07000-3240e06000---p0000700008:022097601/lib64/librt-2.12.so
3240e06000-3240e07000r--p0000600008:022097601/lib64/librt-2.12.so
3240e07000-3240e08000rw-p0000700008:022097601/lib64/librt-2.12.so
324ac00000-324ac07000r-xp0000000008:022097616/lib64/libcrypt-2.12.so
324ac07000-324ae07000---p0000700008:022097616/lib64/libcrypt-2.12.so
324ae07000-324ae08000r--p0000700008:022097616/lib64/libcrypt-2.12.so
324ae08000-324ae09000rw-p0000800008:022097616/lib64/libcrypt-2.12.so
324ae09000-324ae37000rw-p0000000000:000
324b000000-324b05d000r-xp0000000008:022097615/lib64/libfreebl3.so
324b05d000-324b25c000---p0005d00008:022097615/lib64/libfreebl3.so
324b25c000-324b25d000r--p0005c00008:022097615/lib64/libfreebl3.so
324b25d000-324b25e000rw-p0005d00008:022097615/lib64/libfreebl3.so
324b25e000-324b262000rw-p0000000000:000
324b800000-324b816000r-xp0000000008:022097620/lib64/libgcc_s-4.4.7-20120601.so.1
324b816000-324ba15000---p0001600008:022097620/lib64/libgcc_s-4.4.7-20120601.so.1
324ba15000-324ba16000rw-p0001500008:022097620/lib64/libgcc_s-4.4.7-20120601.so.1
324c800000-324c8e8000r-xp0000000008:0242743290/usr/lib64/libstdc++.so.6.0.13
324c8e8000-324cae8000---p000e800008:0242743290/usr/lib64/libstdc++.so.6.0.13
324cae8000-324caef000r--p000e800008:0242743290/usr/lib64/libstdc++.so.6.0.13
324caef000-324caf1000rw-p000ef00008:0242743290/usr/lib64/libstdc++.so.6.0.13
324caf1000-324cb06000rw-p0000000000:000
3250400000-3250402000r-xp0000000008:022097610/lib64/libutil-2.12.so
3250402000-3250601000---p0000200008:022097610/lib64/libutil-2.12.so
3250601000-3250602000r--p0000100008:022097610/lib64/libutil-2.12.so
3250602000-3250603000rw-p0000200008:022097610/lib64/libutil-2.12.so
3250800000-3250816000r-xp0000000008:022097204/lib64/libnsl-2.12.so
3250816000-3250a15000---p0001600008:022097204/lib64/libnsl-2.12.so
3250a15000-3250a16000r--p0001500008:022097204/lib64/libnsl-2.12.so
3250a16000-3250a17000rw-p0001600008:022097204/lib64/libnsl-2.12.so
3250a17000-3250a19000rw-p0000000000:000
7f3033a3b000-7f3033a47000r-xp0000000008:022097182/lib64/libnss_files-2.12.so
7f3033a47000-7f3033c47000---p0000c00008:022097182/lib64/libnss_files-2.12.so
7f3033c47000-7f3033c48000r--p0000c00008:022097182/lib64/libnss_files-2.12.so
7f3033c48000-7f3033c49000rw-p0000d00008:022097182/lib64/libnss_files-2.12.so
7f3033c49000-7f3033f94000r-xp0000000008:0242752391/usr/lib64/libmysqlclient.so.18.1.0
7f3033f94000-7f3034194000---p0034b00008:0242752391/usr/lib64/libmysqlclient.so.18.1.0
7f3034194000-7f303420c000rw-p0034b00008:0242752391/usr/lib64/libmysqlclient.so.18.1.0
7f303420c000-7f3034211000rw-p0000000000:000
7f3034211000-7f303422b000r-xp0000000008:0248234759/usr/lib/perl5/site_perl/5.14.4/x86_64-linux/auto/DBD/mysql/mysql.so
7f303422b000-7f303442a000---p0001a00008:0248234759/usr/lib/perl5/site_perl/5.14.4/x86_64-linux/auto/DBD/mysql/mysql.so
7f303442a000-7f303442d000rw-p0001900008:0248234759/usr/lib/perl5/site_perl/5.14.4/x86_64-linux/auto/DBD/mysql/mysql.so
7f303442d000-7f3034437000r-xp0000000008:0248105104/usr/lib/perl5/site_perl/5.14.4/x86_64-linux/auto/List/Util/Util.so
7f3034437000-7f3034636000---p0000a00008:0248105104/usr/lib/perl5/site_perl/5.14.4/x86_64-linux/auto/List/Util/Util.so
7f3034636000-7f3034637000rw-p0000900008:0248105104/usr/lib/perl5/site_perl/5.14.4/x86_64-linux/auto/List/Util/Util.so
7f3034637000-7f3034655000r-xp0000000008:0247975908/usr/lib/perl5/site_perl/5.14.4/x86_64-linux/auto/DBI/DBI.so
7f3034655000-7f3034854000---p0001e00008:0247975908/usr/lib/perl5/site_perl/5.14.4/x86_64-linux/auto/DBI/DBI.so
7f3034854000-7f3034855000rw-p0001d00008:0247975908/usr/lib/perl5/site_perl/5.14.4/x86_64-linux/auto/DBI/DBI.so
7f3034855000-7f303a6e6000r--p0000000008:0242733014/usr/lib/locale/locale-archive
7f303a6e6000-7f303a6eb000rw-p0000000000:000
7f303a701000-7f303a703000rw-p0000000000:000
7fff22e8a000-7fff22e9f000rw-p0000000000:000[stack]
7fff22fff000-7fff23000000r-xp0000000000:000[vdso]
ffffffffff600000-ffffffffff601000r-xp0000000000:000[vsyscall]
^CAborted(coredumped)#最后这句是按ctrl+C终止了程序
这个问题已经困扰我三天了,求大神帮忙!
慕码人8056858
浏览 318回答 2
2回答

牧羊人nacy

最终我又装回了系统之前自带的perl-5.10.1rpm-i--replacepkgsperl-5.10.1-129.el6.x86_64.rpm#(强制重新安装)现在运行时不再报错了。究其原因,应该还是因为更新perl后glibc的版本不兼容的问题。为了安装其他模块,只能再装一个版本的perl了,让两个perl并存,新的perl命名为perl-版本号。小结:1.不要随便升级系统自带的软件;2.由于CentOS是企业级的系统,为了确保系统的稳定性,很少对系统里面的软件进行升级;3.安装软件尽量使用系统自带的工具进行安装,如rpm、yum。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript