List Info

Thread: Boundary error in DBD-Pg's pg_getline




Boundary error in DBD-Pg's pg_getline
user name
2006-12-28 07:18:35
# New Ticket Created by  perlbugpkts.ca 
# Please include the string:  [perl #41146]
# in the subject line of all future correspondence about
this issue. 
# <URL: h
ttp://rt.perl.org/rt3/Ticket/Display.html?id=41146 >



This is a bug report for perl from perlbugpkts.ca,
generated with the help of perlbug 1.35 running under perl
v5.8.8.


------------------------------------------------------------
-----
[Please enter your report here]
I don't know if this is the right place to send a bug report
on
DBD::Pg (Postgres database module), but here goes.

I've got Fedora Core 5 and the following rpms:
perl-5.8.8-5.i386.rpm
perl-DBD-Pg-1.49-1.FC5.i386.rpm
perl-DBI-1.52-1.fc5.i386.rpm
postgresql-8.1.4-1.FC5.1.i386.rpm

The following program causes glibc to abort with an invalid
pointer
error:
===
#!/usr/bin/perl -wT
use strict;
use DBI;
use DBD::Pg qw(:pg_types);

my $dbh =
DBI->connect("dbi:Pg:dbname=mydatabase",
"username",
"password",{ShowErrorStatement => 1,PrintError
=> 1});
if (!defined $dbh) {die($DBI::errstr);}

$dbh->do("COPY study TO STDOUT");
my data;
my $x=0;
my $l="";
while($dbh->pg_getline($l,100)){$data[$x++]=$l};
print join("n",data),"n";
===
The table being 'copy'ed is 3 records long and 200
characters wide.
When I change the '100' to '500' in the pg_getline()
function
(second-last line), the program runs successfully.

In addition, the sql statement works fine with psql, the
command-line
query tool.

I'm going to be using this code on a table with
variable-length
text records, so precalculating the width is not really a
good option.

Hope this helps!

The backtrace:
===
*** glibc detected *** /usr/bin/perl: munmap_chunk():
invalid pointer:
0x08fff338 ***
======= Backtrace: =========
/lib/libc.so.6(__libc_free+0x179)[0x48d84070]
/usr/lib/libpq.so.4(PQfreemem+0x1d)[0x4dfd867d]
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/aut
o/DBD/Pg/Pg.so(pg_db_getline+0x13d)[0x803acd]
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/aut
o/DBD/Pg/Pg.so(XS_DBD__Pg__db_pg_getline+0x278)[0x7f7c48]
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/aut
o/DBI/DBI.so(XS_DBI_dispatch+0x22c8)[0xde6128]
/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so
(Perl_pp_entersub+0x40d)[0x4994601d]
/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so
(Perl_runops_standard+0x1f)[0x4993f48f]
/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so
(perl_run+0x2ee)[0x498e4dde]
/usr/bin/perl(main+0x13e)[0x804934e]
/lib/libc.so.6(__libc_start_main+0xdc)[0x48d324e4]
/usr/bin/perl[0x8049181]
===

[Please do not change anything below this line]
------------------------------------------------------------
-----
---
Flags:
    category=core
    severity=medium
---
This perlbug was built using Perl v5.8.8 in the Red Hat
build system.
It is being executed now by Perl v5.8.8 - Sun Jun  4
19:33:43 EDT 2006.

Site configuration information for perl v5.8.8:

Configured by Red Hat, Inc. at Sun Jun  4 19:33:43 EDT 2006.

Summary of my perl5 (revision 5 version 8 subversion 8)
configuration:
  Platform:
    osname=linux, osvers=2.6.9-34.elsmp,
archname=i386-linux-thread-multi
    uname='linux hs20-bc2-4.build.redhat.com 2.6.9-34.elsmp
#1 smp fri feb 24 16:56:28 est 2006 i686 i686 i386 gnulinux
'
    config_args='-des -Doptimize=-O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic
-fasynchronous-unwind-tables -Dversion=5.8.8
-Dmyhostname=localhost -Dperladmin=rootlocalhost
-Dcc=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr
-Dprefix=/usr -Darchname=i386-linux -Dvendorprefix=/usr
-Dsiteprefix=/usr -Duseshrplib -Dusethreads -Duseithreads
-Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm
-Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio
-Dinstallusrbinperl=n -Ubincompat5005 -Uversiononly
-Dpager=/usr/bin/less -isr -Dd_gethostent_r_proto
-Ud_endhostent_r_proto -Ud_sethostent_r_proto
-Ud_endprotoent_r_proto -Ud_setprotoent_r_proto
-Ud_endservent_r_proto -Ud_setservent_r_proto
-Dinc_version_list=5.8.7 5.8.6 5.8.5 5.8.4 5.8.3
-Dscriptdir=/usr/bin'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef
useithreads=define usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define
usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE
-fno-strict-aliasing -pipe -Wdeclaration-after-statement
-I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
    optimize='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2
-fexceptions -fstack-protector --param=ssp-buffer-size=4
-m32 -march=i386 -mtune=generic
-fasynchronous-unwind-tables',
    cppflags='-D_REENTRANT -D_GNU_SOURCE
-fno-strict-aliasing -pipe -Wdeclaration-after-statement
-I/usr/local/include -I/usr/include/gdbm'
    ccversion='', gccversion='4.1.1 20060525 (Red Hat
4.1.1-1)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8,
byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define,
longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8,
Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lresolv -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil
-lpthread -lc
    perllibs=-lresolv -lnsl -ldl -lm -lcrypt -lutil
-lpthread -lc
    libc=/lib/libc-2.4.so, so=so, useshrplib=true,
libperl=libperl.so
    gnulibc_version='2.4'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef,
ccdlflags='-Wl,-E
-Wl,-rpath,/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE
'
    cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    

---
INC
for perl v5.8.8:
    /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.8
    /usr/lib/perl5/site_perl/5.8.7
    /usr/lib/perl5/site_perl/5.8.6
    /usr/lib/perl5/site_perl/5.8.5
    /usr/lib/perl5/site_perl/5.8.4
    /usr/lib/perl5/site_perl/5.8.3
    /usr/lib/perl5/site_perl
    /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.8.8
    /usr/lib/perl5/vendor_perl/5.8.7
    /usr/lib/perl5/vendor_perl/5.8.6
    /usr/lib/perl5/vendor_perl/5.8.5
    /usr/lib/perl5/vendor_perl/5.8.4
    /usr/lib/perl5/vendor_perl/5.8.3
    /usr/lib/perl5/vendor_perl
    /usr/lib/perl5/5.8.8/i386-linux-thread-multi
    /usr/lib/perl5/5.8.8
    .

---
Environment for perl v5.8.8:
    HOME=/home/croot
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
   
PATH=/home/croot/bin:/home/croot/bin/LINUX:/home/croot/pubbi
n/LINUX:/usr/depot/ccache-2.2/mybin:/usr/depot/distcc/mybin:
/usr/local/bin:/bin:/usr/local/etc:/usr/sbin:/usr/ucb:/sbin:
/usr/5bin:/usr/X11/bin:/usr/bin:/usr/bin/X11:/usr/bsd:/usr/c
cs/bin:/usr/etc:/usr/games:/usr/lib:/usr/libexec:/usr/X11R6/
bin:/usr/local/sbin:.
    PERL_BADLANG (unset)
    SHELL=/bin/csh

Boundary error in DBD-Pg's pg_getline
user name
2006-12-28 12:41:12
Hello,

> I don't know if this is the right place to send a bug
report on
> DBD::Pg (Postgres database module), but here goes.

No, this bug tracking system and mailing list are for the
core of  
Perl, not for the modules like DBD::Pg.
To see the list of currently known bugs and open a new one,
see  
<http://rt.cpan.org/Public/Dist/Display.html?Name=DBD-
Pg>
where it seems that you have already created a new ticket,
so this  
one can be closed.

-- 
Sébastien Aperghis-Tramoni

Close the world, txEn eht nepO.


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )