From owner-freebsd-perl@FreeBSD.ORG Mon Oct 13 02:57:01 2008 Return-Path: Delivered-To: perl@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0EBC106568A for ; Mon, 13 Oct 2008 02:57:01 +0000 (UTC) (envelope-from jjr@alisa.org) Received: from mail.alisa.org (mail.alisa.org [65.103.114.105]) by mx1.freebsd.org (Postfix) with ESMTP id 4F6D28FC17 for ; Mon, 13 Oct 2008 02:57:01 +0000 (UTC) (envelope-from jjr@alisa.org) Received: from [192.168.1.102] (c-98-245-37-189.hsd1.co.comcast.net [98.245.37.189]) (authenticated bits=0) by mail.alisa.org (8.14.3/8.14.2) with ESMTP id m9D2HaeE015419 for ; Sun, 12 Oct 2008 20:17:37 -0600 (MDT) (envelope-from jjr@alisa.org) User-Agent: Microsoft-Entourage/11.4.0.080122 Date: Sun, 12 Oct 2008 20:17:34 -0600 From: John Rushford To: Message-ID: Thread-Topic: DBD::Pg is broken - coredumps Thread-Index: Acks2dpfGNdxfJjNEd2KmgAX8gEdYA== Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (mail.alisa.org [65.103.114.105]); Sun, 12 Oct 2008 20:17:37 -0600 (MDT) Cc: Subject: DBD::Pg is broken - coredumps X-BeenThere: freebsd-perl@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: maintainer of a number of perl-related ports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2008 02:57:01 -0000 Greetings, I'm having trouble with DBD::Pg on a FreeBSD 7.1-PRERELEASE machine. When connecting to a postgresql database, the perl script coredumps. See attached back trace, version info, and test perl script. Is there some issue with pthreads? Any ideas? John Rushford jjr@alisa.org Details: FreeBSD 7.1-PRERELEASE built after cvsup Sun Oct 12, 2008 kernel GENERIC amd64 p5-DBD-Pg-2.10.7 Provides access to PostgreSQL databases through the DBI p5-DBD-SQLite-1.14 Provides access to SQLite3 databases through the DBI p5-DBD-mysql-4.006 MySQL driver for the Perl5 Database Interface (DBI) p5-DBI-1.60.4 The perl5 Database Interface. Required for DBD::* modules postgresql-client-8.2.9 PostgreSQL database (client) postgresql-server-8.2.9 The most advanced open-source database available anywhere Gdb backtrace: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x523000 (LWP 100225)] 0x0000000801c65afb in pthread_cond_init () from /lib/libthr.so.3 (gdb) bt #0 0x0000000801c65afb in pthread_cond_init () from /lib/libthr.so.3 #1 0x0000000801434aa0 in pq_block_sigpipe () from /usr/local/lib/libpq.so.5 #2 0x0000000801434c28 in pqsecure_write () from /usr/local/lib/libpq.so.5 #3 0x000000080142da5e in pqReadData () from /usr/local/lib/libpq.so.5 #4 0x0000000801427691 in pqPacketSend () from /usr/local/lib/libpq.so.5 #5 0x0000000801428c32 in PQconnectPoll () from /usr/local/lib/libpq.so.5 #6 0x0000000801428dae in PQresetPoll () from /usr/local/lib/libpq.so.5 #7 0x000000080142a3cf in PQconnectdb () from /usr/local/lib/libpq.so.5 #8 0x0000000801311bc6 in pg_db_login () from /usr/local/lib/perl5/site_perl/5.8.8/mach/auto/DBD/Pg/Pg.so #9 0x0000000801302b9a in XS_DBD__Pg__db__login () from /usr/local/lib/perl5/site_perl/5.8.8/mach/auto/DBD/Pg/Pg.so #10 0x00000008006bf17c in Perl_pp_entersub () from /usr/local/lib/perl5/5.8.8/mach/CORE/libperl.so #11 0x00000008006b7e1e in Perl_runops_standard () from /usr/local/lib/perl5/5.8.8/mach/CORE/libperl.so #12 0x0000000800668aa5 in Perl_call_sv () from /usr/local/lib/perl5/5.8.8/mach/CORE/libperl.so #13 0x0000000800db8446 in XS_DBI_dispatch () from /usr/local/lib/perl5/site_perl/5.8.8/mach/auto/DBI/DBI.so #14 0x00000008006bf17c in Perl_pp_entersub () from /usr/local/lib/perl5/5.8.8/mach/CORE/libperl.so #15 0x00000008006b7e1e in Perl_runops_standard () from /usr/local/lib/perl5/5.8.8/mach/CORE/libperl.so #16 0x0000000800669632 in perl_run () from /usr/local/lib/perl5/5.8.8/mach/CORE/libperl.so #17 0x00000000004015cf in main () (gdb) This perl script works fine with mysql but coredumps at DBI->connect with postgresql. #!/usr/bin/perl use strict; use CGI qw(:standard); use DBI; my $seq = 0; my @array; my $dbname = $ENV{'DBNAME'}; my $dbuser = $ENV{'DBUSER'}; my $dbpasswd = $ENV{'DBPASSWD'}; my $dsn = "dbi:Pg:dbname=$dbname;host=127.0.0.1;port=5432"; #my $dsn = "dbi:mysql:database=$dbname;host=127.0.0.1;port=3306"; my $dbh; if (length ($dbname) == 0) { print "DBNAME is not set\n"; exit 0; } if (length ($dbuser) == 0) { print "DBUSER is not set\n"; exit 0; } if (length ($dbpasswd) == 0) { print "DBPASSWD is not set\n"; exit 0; } $dbh = DBI->connect($dsn,"$dbuser","$dbpasswd", {'AutoCommit' => 1,RaiseError => 1, P rintError => 0}) or die ("can't connect to $dbname"); my $sth = $dbh->prepare ("SELECT * from x"); $sth->execute; while ( @array = $sth->fetchrow()) { print "val = $array[0]\n"; } $sth->finish;