Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f2UET4K52108 for ; Fri, 30 Mar 2001 09:29:04 -0500 (EST) (envelope-from pgsql-interfaces-owner@postgresql.org) Received: from shienar.alanne.com (cx253468-a.chspk1.va.home.com [24.4.151.217]) by postgresql.org (8.11.3/8.11.1) with SMTP id f2THFUK56050 for ; Thu, 29 Mar 2001 12:15:41 -0500 (EST) (envelope-from jeff@alanne.com) Message-Id: <200103291715.f2THFUK56050@postgresql.org> Received: (qmail 13937 invoked from network); 29 Mar 2001 21:49:13 -0000 Received: from unknown (HELO cairhien) (10.0.0.3) by 10.0.0.1 with SMTP; 29 Mar 2001 21:49:13 -0000 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "Jeff Duffy" To: "DBI Users" Cc: Postgres Interfaces , "Edmund Mergl" Subject: Possible bug in DBD::Pg 0.95 X-Mailer: Pronto v2.2.3 On linux/Pg Date: 29 Mar 2001 12:14:07 EST Reply-To: "Jeff Duffy" X-Archive-Number: 200103/215 X-Sequence-Number: 1377 While poking about in my favorite MUA (Pronto; http://muhri.net/pronto) I discovered what may be a serious bug in DBD::Pg. While attempting to import some files (email) into the database, the script dumped core. Some experimenting shows that smaller files (>100k or so) insert fine, but larger file inserts into text fields cause the script to segfault and dump core when execute() is called on the statement handle. I have successfully inserted the same text into Postgres using the COPY command, so that should rule out db issues. The offending code: #!/usr/bin/perl use DBI; my $dbh = DBI->connect("dbi:Pg:dbname='jeff'", 'jeff', '', {AutoCommit => 0 }); open(FILE, 'test.msg'); undef $/; my $msg = ; close(FILE); my $sth = $dbh->prepare("INSERT INTO message_sources VALUES(91, ?)"); $sth->bind_param(1, $msg); $sth->execute(); $dbh->commit(); $dbh->disconnect; The file test.msg is ~178k (it's a pgsql-general-digest message). The table: jeff=# \d message_sources Table "message_sources" Attribute | Type | Modifier -----------+---------+---------- id | integer | not null bodytext | text | Index: message_sources_pkey The first few lines of 'strings core' suggests that there might be an issue with DynaLoader: tch %s%s%s%s %_ DynaLoader::dl_load_file DynaLoader::dl_find_symbol DynaLoader::dl_undef_symbols DynaLoader::dl_install_xsub DynaLoader::dl_error "@ t bh->disconnect; $msg); ERT INTO message_sources VALUES(91, ?)"); => 0 }); The environment: Red Hat 7.0 (linux 2.4.2) Perl 5.6.0 (compiled from source, shared libperl.so) PostgreSQL 7.1RC1 (compiled from source) DBD::Pg 0.95 (compiled from source) I recompiled Perl and DBD::Pg using kgcc (egcs-2.91.66) to make sure that the RH gcc 2.96 wasn't at fault, and got the same results. The corefile and test message are available. -- Jeff Duffy Great Bridge, Inc. jduffy@greatbridge.com