Hi Greg. My code was tickling a segfault in dbd::pg (which caused perl to
segfault, or the other way around, or whichever). This may be Tim's code
originally, so I don't know if it's your "hack," but it seems the hack is
no longer working. Here's a backtrace.

(gdb) bt
#0  0x0000000100677720 in pg_warn (arg=<value temporarily unavailable, due
to optimizations>, message=0x1011e9810 "LOG:  statement: DEALLOCATE
dbdpg_p62640_1\n") at dbdimp.c:319
#1  0x00000001006b4f90 in pqGetErrorNotice3 ()
#2  0x00000001006b65ca in pqParseInput3 ()
#3  0x00000001006ae5a4 in PQgetResult ()
#4  0x00000001006ae7c8 in PQexecFinish ()
#5  0x000000010067f59e in _result (my_perl=0x100800000,
imp_dbh=0x1014929c0, sql=0x1002027f0 "DEALLOCATE dbdpg_p62640_1") at
dbdimp.c:353
#6  0x0000000100682940 in pg_st_deallocate_statement (my_perl=0x100800000,
sth=0x10082fb48, imp_sth=0x101494910) at dbdimp.c:3631
#7  0x0000000100682e74 in pg_st_destroy (sth=0x10082fb48,
imp_sth=0x101494910) at dbdimp.c:3684
#8  0x000000010067041d in XS_DBD__Pg__st_DESTROY (my_perl=0x100800000,
cv=<value temporarily unavailable, due to optimizations>) at Pg.xsi:769
#9  0x00000001001ca61b in XS_DBI_dispatch ()
#10 0x0000000100075708 in Perl_pp_entersub ()
#11 0x0000000100069550 in Perl_call_sv ()
#12 0x000000010007bef1 in Perl_sv_clear ()
#13 0x000000010007c49b in Perl_sv_free2 ()
#14 0x000000010007c389 in Perl_sv_clear ()
#15 0x000000010007c49b in Perl_sv_free2 ()
#16 0x00000001000585c0 in Perl_mg_free ()
#17 0x000000010007c0bf in Perl_sv_clear ()
#18 0x000000010007c49b in Perl_sv_free2 ()
#19 0x0000000100076889 in Perl_sv_add_arena ()
#20 0x00000001000768df in Perl_sv_clean_objs ()
#21 0x0000000100069ec5 in perl_destruct ()
#22 0x0000000100000db0 in ?? ()
#23 0x0000000100000cb8 in ?? ()



The problem is apparently when logging statements is set to 'all' in the
postmaster and when the loglevel is notice or below. The code (starting at
319) says it tries to address it. But it's segfaulting. I'm using 9.0.4 of
the postmaster. Here's my uname -a:

Darwin wing 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT
2011; root:xnu-1504.15.3~1/RELEASE_I386 i386

And my perl -V:


wing:~ alex$ perl -V
Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
  Platform:
    osname=darwin, osvers=10.0, archname=darwin-thread-multi-2level
    uname='darwin scream.apple.com 10.0 darwin kernel version 10.0.0: fri
jul 31 22:46:25 pdt 2009; root:xnu-1456.1.25~1release_x86_64 x86_64 '
    config_args='-ds -e -Dprefix=/usr -Dccflags=-g  -pipe  -Dldflags=
-Dman3ext=3pm -Duseithreads -Duseshrplib -Dinc_version_list=none
-Dcc=gcc-4.2'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc-4.2', ccflags ='-arch x86_64 -arch i386 -arch ppc -g -pipe
-fno-common -DPERL_DARWIN -fno-strict-aliasing -I/usr/local/include',
    optimize='-Os',
    cppflags='-g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing
-I/usr/local/include'
    ccversion='', gccversion='4.2.1 (Apple Inc. build 5646)',
gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='gcc-4.2 -mmacosx-version-min=10.6.4', ldflags ='-arch x86_64 -arch
i386 -arch ppc -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib
    libs=-ldbm -ldl -lm -lutil -lc
    perllibs=-ldl -lm -lutil -lc
    libc=/usr/lib/libc.dylib, so=dylib, useshrplib=true,
libperl=libperl.dylib
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-arch x86_64 -arch i386 -arch ppc -bundle
-undefined dynamic_lookup -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
                        PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
USE_64_BIT_ALL
                        USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
                        USE_PERLIO USE_REENTRANT_API
  Locally applied patches:
        /Library/Perl/Updates/<version> comes before system perl directories
        installprivlib and installarchlib points to the Updates directory
  Built under darwin
  Compiled at Jun 24 2010 17:31:03
  @INC:
    /Library/Perl/Updates/5.10.0/darwin-thread-multi-2level
    /Library/Perl/Updates/5.10.0
    /System/Library/Perl/5.10.0/darwin-thread-multi-2level
    /System/Library/Perl/5.10.0
    /Library/Perl/5.10.0/darwin-thread-multi-2level
    /Library/Perl/5.10.0
    /Network/Library/Perl/5.10.0/darwin-thread-multi-2level
    /Network/Library/Perl/5.10.0
    /Network/Library/Perl
    /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level
    /System/Library/Perl/Extras/5.10.0
    .

And I am using DBD::Pg version


DBD::Pg is up to date (2.18.1).

I turned the logging to "warning" from "notice" and the segfaults stopped.


Thanks for your attention.

Reply via email to