Return-Path: X-Original-To: apmail-perl-modperl-archive@www.apache.org Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 791C9994F for ; Tue, 6 Dec 2011 17:40:45 +0000 (UTC) Received: (qmail 65061 invoked by uid 500); 6 Dec 2011 17:40:44 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 65020 invoked by uid 500); 6 Dec 2011 17:40:43 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 65013 invoked by uid 99); 6 Dec 2011 17:40:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Dec 2011 17:40:43 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of merlyn.kline@jobsite.co.uk designates 195.171.206.217 as permitted sender) Received: from [195.171.206.217] (HELO ses-acchub-1.gjnet.jobsite.co.uk) (195.171.206.217) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Dec 2011 17:40:36 +0000 Received: from S-ExMail-1.gjnet.jobsite.co.uk ([10.10.10.251]) by ses-acchub-1.gjnet.jobsite.co.uk ([::1]) with mapi; Tue, 6 Dec 2011 17:40:16 +0000 From: Merlyn Kline To: "modperl@perl.apache.org" Date: Tue, 6 Dec 2011 17:40:14 +0000 Subject: [mp2] [BUG] Segfault with Test::More - duping STDOUT? Thread-Topic: [mp2] [BUG] Segfault with Test::More - duping STDOUT? Thread-Index: Acy0Pfn/XoWwUASoSRyaPrpBoYFGKg== Message-ID: Accept-Language: en-US, en-GB Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US, en-GB Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org (I have read the bug reporting guides but unfortunately cannot follow all t= he instructions because I am missing Apache::TestReportPerl and do not have= the necessary permissions to install it, nor to rebuild perl with debuggin= g turned on. Hopefully I have provided enough information.) I have discovered that simply "use"ing Test::More in a mod_perl script caus= es my apache to segfault. I originally reported this to the author of Test:= :More (see https://rt.cpan.org/Public/Bug/Display.html?id=3D69687) but now = believe the problem to have wider scope. By progressively removing code fro= m my original example I have reduced it to the trivial example that follows= . To REPRODUCE the problem, you need a Broken.pm module like this: package Broken; my $Testout; create(); sub create { # Insert "{#" at the start of this line and the = segfault goes away open( $Testout, ">&STDOUT" ) or die "Can't dup STDOUT: $!"; } and a script like this: #!/usr/bin/perl -w use Broken; print "Content-Type: text/html\r\n\r\nhello "; open TEST, "|/bin/cat"; close TEST; print "world\n"; Holding down F5 to generate reloads soon causes a segfault (my server is co= nfigured for five mod_perl processes). Note that if the code to dup STDOUT is not in a sub then the fault seems to= go away. Apache, mod_perl and perl version info appended. I have found a similar(ish) report at http://http://stackoverflow.com/quest= ions/4413411/ but no resolution. Note that removing from my example the cod= e that opens the pipe to cat, solves the problem - this is the similarity h= ere (and I realise that's likely a red herring). Merlyn Kline Apache/2.2.15 (Unix) DAV/2 mod_ssl/2.2.15 OpenSSL/1.0.0-fips mod_perl/2.0.= 4 Perl/v5.10.1 configured -- resuming normal operations =20 =20 =20 Summary of my perl5 (revision 5 version 10 subversion 1) configuration: Platform: osname=3Dlinux, osvers=3D2.6.18-194.26.1.el5, archname=3Dx86_64-linux-t= hread-multi uname=3D'linux x86-003.build.bos.redhat.com 2.6.18-194.26.1.el5 #1 smp = fri oct 29 14:21:16 edt 2010 x86_64 x86_64 x86_64 gnulinux ' config_args=3D'-des -Doptimize=3D-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOUR= CE=3D2 -fexceptions -fstack-protector --param=3Dssp-buffer-size=3D4 -m64 -m= tune=3Dgeneric -DDEBUGGING=3D-g -Dversion=3D5.10.1 -Dmyhostname=3Dlocalhost= -Dperladmin=3Droot@localhost -Dcc=3Dgcc -Dcf_by=3DRed Hat, Inc. -Dprefix= =3D/usr -Dvendorprefix=3D/usr -Dsiteprefix=3D/usr/local -Dsitelib=3D/usr/lo= cal/share/perl5 -Dsitearch=3D/usr/local/lib64/perl5 -Dprivlib=3D/usr/share/= perl5 -Darchlib=3D/usr/lib64/perl5 -Dvendorlib=3D/usr/share/perl5/vendor_pe= rl -Dvendorarch=3D/usr/lib64/perl5/vendor_perl -Dinc_version_list=3D5.10.0 = -Darchname=3Dx86_64-linux-thread-multi -Dlibpth=3D/usr/local/lib64 /lib64 /= usr/lib64 -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Dd_dosui= d -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext= =3D3pm -Duseperlio -Dinstallusrbinperl=3Dn -Ubincompat5005 -Uversiononly -D= pager=3D/usr/bin/less -isr -Dd_gethostent_r_proto -Ud_endhostent_r_proto -U= d_sethostent_r_proto -Ud_endprotoent_r_proto -Ud_setprotoent_r_proto -Ud_en= dservent_r_proto -Ud_setservent_r_proto -Dscriptdir=3D/usr/bin' hint=3Drecommended, useposix=3Dtrue, d_sigaction=3Ddefine useithreads=3Ddefine, usemultiplicity=3Ddefine useperlio=3Ddefine, d_sfio=3Dundef, uselargefiles=3Ddefine, usesocks=3D= undef use64bitint=3Ddefine, use64bitall=3Ddefine, uselongdouble=3Dundef usemymalloc=3Dn, bincompat5005=3Dundef Compiler: cc=3D'gcc', ccflags =3D'-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing= -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_O= FFSET_BITS=3D64', optimize=3D'-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=3D2 -fexceptions -= fstack-protector --param=3Dssp-buffer-size=3D4 -m64 -mtune=3Dgeneric', cppflags=3D'-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fsta= ck-protector -I/usr/local/include' ccversion=3D'', gccversion=3D'4.4.4 20100726 (Red Hat 4.4.4-13)', gccos= andvers=3D'' intsize=3D4, longsize=3D8, ptrsize=3D8, doublesize=3D8, byteorder=3D123= 45678 d_longlong=3Ddefine, longlongsize=3D8, d_longdbl=3Ddefine, longdblsize= =3D16 ivtype=3D'long', ivsize=3D8, nvtype=3D'double', nvsize=3D8, Off_t=3D'of= f_t', lseeksize=3D8 alignbytes=3D8, prototype=3Ddefine Linker and Libraries: ld=3D'gcc', ldflags =3D' -fstack-protector' libpth=3D/usr/local/lib64 /lib64 /usr/lib64 libs=3D-lresolv -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc perllibs=3D-lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc libc=3D, so=3Dso, useshrplib=3Dtrue, libperl=3Dlibperl.so gnulibc_version=3D'2.12' Dynamic Linking: dlsrc=3Ddl_dlopen.xs, dlext=3Dso, d_dlsymun=3Dundef, ccdlflags=3D'-Wl,-= E -Wl,-rpath,/usr/lib64/perl5/CORE' cccdlflags=3D'-fPIC', lddlflags=3D'-shared -O2 -g -pipe -Wall -Wp,-D_FO= RTIFY_SOURCE=3D2 -fexceptions -fstack-protector --param=3Dssp-buffer-size= =3D4 -m64 -mtune=3Dgeneric' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_64_BIT_A= LL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API Built under linux Compiled at Apr 19 2011 15:27:31