Adam Prime | 1 Jun 01:59 2008
Picon
Picon

mod_perl BOF at YAPC::NA

YAPC::NA is only a few weeks away, and I stumbled upon the beginning of 
plans for a BOF there.  There's not a whole lot on the signup page yet, 
but if you're interested (and going), you should signup.

The wiki page for the BOF is here:

http://conferences.mongueurs.net/yn2008/wiki?node=mod_perl%20BOF

Adam

william | 1 Jun 19:30 2008
Picon

Fwd: mod_perl interactive debugging

---------- Forwarded message ----------
From: william <yingun <at> gmail.com>
Date: Jun 1, 2008 6:11 PM
Subject: Re: mod_perl interactive debugging
To: Fred Moyer <fred <at> redhotpenguin.com>

On 6/1/08, william <yingun <at> gmail.com> wrote:
 > On 6/1/08, william <yingun <at> gmail.com> wrote:
 >  > On 6/1/08, Fred Moyer <fred <at> redhotpenguin.com> wrote:
 >  >  > william wrote:
 >  >  >
 >  >  > > On 5/29/08, william <yingun <at> gmail.com> wrote:
 >  >  > >
 >  >  > > > On 5/29/08, Fred Moyer <fred <at> redhotpenguin.com> wrote:
 >  >  > > >  > william wrote:
 >  >  > > >  >
 >  >  > > >  > > On 5/29/08, Perrin Harkins <perrin <at> elem.com> wrote:
 >  >  > > >  > >
 >  >  > > >  > > > On Wed, May 28, 2008 at 3:33 AM, william <yingun <at> gmail.com>
 >  >  > wrote:
 >  >  > > >  > > >
 >  >  > > >  > > I put the following lines at the top of my startup.pl script
 >  >  > > >  > > use APR::Pool (); #specific for mod_perl 2
 >  >  > > >  > > use Apache::DB ();
 >  >  > > >  > > Apache::DB->init();
 >  >  > > >  > >
 >  >  > > >  >
 >  >  > > >  >  Can you show us the part of httpd.conf where you call
startup.pl?
 >  >  > > >  >
(Continue reading)

amiribarksdale | 2 Jun 14:05 2008
Picon

Segfault Help!?!?


I am running Apache 1.3, mod_perl 1.30, perl 5.8.8, with gzip and ssl. I keep
getting segfaults. Sometimes they seem harmless, like the server keeps
running and honoring requests. Other times, they bring everything to a
screeching halt.

This started when I moved my server from a RAM-starved server to a beefier
one. I have had to recompile and reinstall my own perl from source,
reinstall my module environment, re*compile* my module environment, and
reconfigure DBI and DBD::mysql to work with the latest version of the
rpm-installed mysql 5 on my new server.

Just last night, I got a series of segfaults (of the sort that stops
everything) from a "DBD::mysql::st execute failed: Lost connection to MySQL
server".

Here are two short snippets of gdb output from the other evening. Can
someone lead me in the right direction? One interesting problem is the call
in the traces for index.mhtml. That file doesn't exist and isn't called for
anywhere in my codebase--at least not intentionally. And obviously, shortly
thereafter, the apache child dies. 

...
rt_sigaction(SIGUSR1, {0x4b7a35, [], SA_RESTORER|SA_INTERRUPT,
0x337000c5b0}, {SIG_IGN}, 8) = 0
rt_sigaction(SIGALRM, {0x4b6407, [], SA_RESTORER, 0x337000c5b0}, {0x4b6407,
[], SA_RESTORER, 0x337000c5b0}, 8) = 0
semop(5865472, 0x726a60, 1)             = 0
select(19, [17 18], NULL, NULL, NULL)   = 1 (in [18])
accept(18, {sa_family=AF_INET, sin_port=htons(42746),
(Continue reading)

amiribarksdale | 2 Jun 21:18 2008
Picon

Re: Segfault Help!?!?


Here are some better and further details. I turned on DBI debugging, so I can
see that before a segfault, I get the error

Apache::DBI          disconnect (overloaded)

I have also done some gdb backtraces--I put strace output before. Here is
one gdb full bt:

(gdb) bt full
#0  0x0000002a994e37be in mysql_send_query ()
   from /usr/lib64/mysql/libmysqlclient.so.15
No symbol table info available.
#1  0x0000002a994e3819 in mysql_real_query ()
   from /usr/lib64/mysql/libmysqlclient.so.15
No symbol table info available.
#2  0x0000002a99388f59 in mysql_st_internal_execute (h=0x978260,
statement=Variable "statement" is not available.
)
    at dbdimp.c:2903
	bind_type_guessing = 0 '\0'
	slen = 456
	sbuf = 0x30fc0d0 "select
id,date,firstname,lastname,nickname,gender,dob,signatory,bandname,genre_id,city,state,email,externalurl,password,inbox,address1,address2,zip,im,imtype,blurb,country,language,timezone,openid,pic"...
	table = Variable "table" is not available.

Now, the MySQL table being referenced there is my "user" table. I don't know
why dbdimp thinks the table should be called table. Is that a correct
reading?

(Continue reading)

amiribarksdale | 3 Jun 02:38 2008
Picon

Re: Segfault Help!?!?


I realized after I posted the last bit that perhaps I should post the full
lib-loading output from gdb as well as the bt full. Here goes:

This GDB was configured as "x86_64-redhat-linux-gnu"...(no debugging symbols
found)
Using host libthread_db library "/lib64/tls/libthread_db.so.1".

Core was generated by `/usr/local/apache/bin/httpd'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib64/tls/libm.so.6...(no debugging symbols
found)...done.
Loaded symbols for /lib64/tls/libm.so.6
Reading symbols from /lib64/libcrypt.so.1...(no debugging symbols
found)...done.
Loaded symbols for /lib64/libcrypt.so.1
Reading symbols from /lib64/libssl.so.4...
(no debugging symbols found)...done.
Loaded symbols for /lib64/libssl.so.4
Reading symbols from /lib64/libcrypto.so.4...(no debugging symbols
found)...done.
Loaded symbols for /lib64/libcrypto.so.4
Reading symbols from /lib64/libnsl.so.1...
(no debugging symbols found)...done.
Loaded symbols for /lib64/libnsl.so.1
Reading symbols from /lib64/libdl.so.2...(no debugging symbols
found)...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /lib64/libutil.so.1...
(no debugging symbols found)...done.
(Continue reading)

titetluc titetluc | 3 Jun 10:51 2008
Picon

[MP2]: no access to the perl source when using the perl debugger

Hello all,

I am trying to use the perl debugger (using Apache mod_perl-2.0.2-6.3.el5 and httpd httpd-2.2.3-11.el).
I followed the instructions in http://www.perl.com/pub/a/2006/02/09/debug_mod_perl.html and http://perl.apache.org/docs/1.0/guide/debug.html but the debugger does not run correctly.

The symptoms: the debugger is correcly called but does not dipslay the source script. For example, when I access to the Apache2::AuthSSO::Angie::authenticate_form method (declared in a PerlAuthentHandler), the debugger displays

Apache2::AuthSSO::Angie::authenticate_form((eval 150)[/mnt/go/public/perl/Apache2-AuthSSO/lib/Apache2/AuthSSO/Sessions.pm:42]:1):
1:      (caller(0))[0]

instead of

Apache2::AuthSSO::Angie::authenticate_form(/mnt/go/public/perl/Apache2-AuthSSO-Angie/lib//Apache2/AuthSSO/Angie.pm:55):
55:         my ($self, $r) = <at> _;

On the contrary, I can access the souce code for a method declared in the PerlResponseHandler (see trace below)

What is wrong in my configuration ?
Could you please give me some hints ?


Below the debugger output :


[root <at> one Apache-DB-0.13]# /usr/sbin/httpd -X -DPERLDB
[notice] Apache::DB initialized in child 26694

Loading DB routines from perl5db.pl version 1.28
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

Apache2::Status::handler(/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Apache2/Status.pm:110):
110:        my ($r) = <at> _;
  DB<1> c
Apache2::AuthSSO::Angie::authenticate_form((eval 150)[/mnt/go/public/perl/Apache2-AuthSSO/lib/Apache2/AuthSSO/Sessions.pm:42]:1):
1:      (caller(0))[0]
  DB<1> n
Apache2::AuthSSO::Angie::authenticate_form((eval 151)[/mnt/go/public/perl/Apache2-AuthSSO/lib/Apache2/AuthSSO/Sessions/Cache/FastMmap.pm:44]:1):
1:      (caller(0))[0]
  DB<1>
 
<snip>

  DB<1> r
scalar context return from Apache2::AuthSSO::Angie::authenticate_form: 0
Apache2::AuthSSO::session_refresh((eval 161)[/mnt/go/public/perl/Apache2-AuthSSO/lib/Apache2/AuthSSO/Session.pm:64]:1):
1:      (caller(0))[0]
  DB<1> n
Apache2::AuthSSO::session_refresh((eval 162)[/mnt/go/public/perl/Apache2-AuthSSO/lib/Apache2/AuthSSO/Session.pm:83]:1):
1:      (caller(0))[0]
  DB<1>
Apache2::AuthSSO::session_refresh((eval 163)[/mnt/go/public/perl/Apache2-AuthSSO/lib/Apache2/AuthSSO/Session.pm:174]:1):
1:      (caller(0))[0]
  DB<1>
Apache2::AuthSSO::session_refresh((eval 164)[/mnt/go/public/perl/Apache2-AuthSSO/lib/Apache2/AuthSSO/Session.pm:90]:1):
1:      (caller(0))[0]
  DB<1> r
scalar context return from Apache2::AuthSSO::session_refresh: 0
Apache2::AuthSSO::BackEndFactory::send_to((eval 175)[/mnt/go/public/perl/Apache2-AuthSSO/lib/Apache2/AuthSSO/BackEndFactory.pm:179]:1):
1:      (caller(0))[0]
  DB<1> r
scalar context return from Apache2::AuthSSO::BackEndFactory::send_to: 0
Apache2::AuthSSO::Angie::authenticate_form((eval 185)[/mnt/go/public/perl/Apache2-AuthSSO/lib/Apache2/AuthSSO/Sessions.pm:42]:1):
1:      (caller(0))[0]
  DB<1> r
scalar context return from Apache2::AuthSSO::Angie::authenticate_form: 0
Apache2::AuthSSO::session_refresh((eval 196)[/mnt/go/public/perl/Apache2-AuthSSO/lib/Apache2/AuthSSO/Session.pm:64]:1):
1:      (caller(0))[0]
  DB<1> r
scalar context return from Apache2::AuthSSO::session_refresh: 0
Apache2::AuthSSO::BackEndFactory::send_to((eval 210)[/mnt/go/public/perl/Apache2-AuthSSO/lib/Apache2/AuthSSO/BackEndFactory.pm:179]:1):
1:      (caller(0))[0]
  DB<1> r
scalar context return from Apache2::AuthSSO::BackEndFactory::send_to: 0
Apache2::AuthSSO::Test::response(/usr/lib/perl5/site_perl/5.8.5/Apache2/AuthSSO/Test.pm:16):
16:         my ($self,$r) = <at> _;
  DB<1> n
Apache2::AuthSSO::Test::response(/usr/lib/perl5/site_perl/5.8.5/Apache2/AuthSSO/Test.pm:18):
18:         my $cookie = 1;
  DB<1>
Apache2::AuthSSO::Test::response(/usr/lib/perl5/site_perl/5.8.5/Apache2/AuthSSO/Test.pm:19):
19:         $r->content_type('text/plain');
  DB<1>

Torsten Foertsch | 3 Jun 11:04 2008
Picon
Picon

Linux::Smaps kernel/perlio dependencies

Hi,

I have recently got a bug report about Linux::Smaps. The poster said it'd
report 2 [vdso] areas and that it can be cured if /proc/self/smaps is opened
with '<:stdio'. Later on he also found the behavior depends on the kernel
version, 2.6.25.3 shows 2 vdsos 2.6.23.1-21 only one.

Since I don't have any of these kernels I am asking for help. To all of my
knowledge multiple vdsos is nonsense. But is it a kernel bug or a bug in the
perlio layer?

Could you please run the following command on various combinations of linux
kernel and perlio?

PERLIO="stdio" perl -pe 'BEGIN {my $smaps="/proc/$$/smaps";
  open STDIN, "<", $smaps or die "$!\n"; system "cat -n $smaps"}
  $_="$.\t$_"' | grep vdso

It should print 2 almost identical lines. If there are more please report.

Here an example:

$ PERLIO="stdio" perl -pe 'BEGIN {my $smaps="/proc/$$/smaps"; open STDIN, "<", $smaps or die "$!\n";
system "cat -n $smaps"} $_="$.\t$_"'|grep vdso
   321  ffffe000-fffff000 r-xp 00000000 00:00 0          [vdso]
321     ffffe000-fffff000 r-xp 00000000 00:00 0          [vdso]

Keep in mind that /proc/$$/smaps exists only for kernels >=2.6.14.

Thanks,
Torsten

André Warnier | 3 Jun 11:52 2008

Re: Linux::Smaps kernel/perlio dependencies

Hi.
I don't have a clue what this relates to, but just in case it helps for 
your sample, here are the outputs for 2 Linux Debian systems (don't know 
how to output the version of perlio though) :

1)
root <at> arthur:~# uname -a
Linux arthur 2.6.18-6-686 #1 SMP Thu May 8 07:34:27 UTC 2008 i686 GNU/Linux
root <at> arthur:~#  PERLIO="stdio" perl -pe 'BEGIN {my 
$smaps="/proc/$$/smaps"; open STDIN, "<", $smaps or die "$!\n"; system 
"cat  -n $smaps"} $_="$.\t$_"'|grep vdso"} $_="$.\t$_"'|grep vd 
                    155  b7f92000-b7f93000 r-xp b7f92000 00:00 0 
   [vdso]
155     b7f92000-b7f93000 r-xp b7f92000 00:00 0          [vdso]
root <at> arthur:~# perl -V
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
   Platform:
     osname=linux, osvers=2.6.24.4, archname=i486-linux-gnu-thread-multi
     uname='linux ninsei 2.6.24.4 #1 smp preempt fri apr 18 15:36:09 pdt 
2008 i686 gnulinux '
     config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN 
-Dcccdlflags=-fPIC -Darchname=i486-linux-gnu -Dprefix=/usr 
-Dprivlib=/usr/share/perl/5.8 -Darchlib=/usr/lib/perl/5.8 
-Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 
-Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local 
-Dsitelib=/usr/local/share/perl/5.8.8 
-Dsitearch=/usr/local/lib/perl/5.8.8 -Dman1dir=/usr/share/man/man1 
-Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 
-Dsiteman3dir=/usr/local/man/man3 -Dman1ext=1 -Dman3ext=3perl 
-Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Uusesfio -Uusenm 
-Duseshrplib -Dlibperl=libperl.so.5.8.8 -Dd_dosuid -des'
     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='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS 
-DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
     optimize='-O2',
     cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN 
-fno-strict-aliasing -pipe -I/usr/local/include'
     ccversion='', gccversion='4.1.2 20061115 (prerelease) (Debian 
4.1.1-21)', 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='cc', ldflags =' -L/usr/local/lib'
     libpth=/usr/local/lib /lib /usr/lib
     libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
     perllibs=-ldl -lm -lpthread -lc -lcrypt
     libc=/lib/libc-2.3.6.so, so=so, useshrplib=true, 
libperl=libperl.so.5.8.8
     gnulibc_version='2.3.6'
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
     cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'

Characteristics of this binary (from libperl):
   Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT
                         PERL_MALLOC_WRAP THREADS_HAVE_PIDS USE_ITHREADS
                         USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API
   Built under linux
   Compiled at Apr 25 2008 20:23:05
    <at> INC:
     /etc/perl
     /usr/local/lib/perl/5.8.8
     /usr/local/share/perl/5.8.8
     /usr/lib/perl5
     /usr/share/perl5
     /usr/lib/perl/5.8
     /usr/share/perl/5.8
     /usr/local/lib/site_perl
     /usr/local/lib/perl/5.8.4
     /usr/local/share/perl/5.8.4
     .
root <at> arthur:~#

2)
dent:~# uname -a
Linux dent 2.6.18-6-xen-amd64 #1 SMP Thu May 8 08:34:37 UTC 2008 x86_64 
GNU/Linux
dent:~# PERLIO="stdio" perl -pe 'BEGIN {my $smaps="/proc/$$/smaps"; open 
STDIN, "<", $smaps or die "$!\n"; system "cat -n $smaps"} 
$_="$.\t$_"'|grep vdso
    232  ffffffffff600000-ffffffffffe00000 ---p 00000000 00:00 0 
           [vdso]
232     ffffffffff600000-ffffffffffe00000 ---p 00000000 00:00 0 
          [vdso]
dent:~# perl -V
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
   Platform:
     osname=linux, osvers=2.6.24-1-amd64, 
archname=x86_64-linux-gnu-thread-multi
     uname='linux deneb 2.6.24-1-amd64 #1 smp thu mar 27 16:52:38 utc 
2008 x86_64 gnulinux '
     config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN 
-Dcccdlflags=-fPIC -Darchname=x86_64-linux-gnu -Dprefix=/usr 
-Dprivlib=/usr/share/perl/5.8 -Darchlib=/usr/lib/perl/5.8 
-Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 
-Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local 
-Dsitelib=/usr/local/share/perl/5.8.8 
-Dsitearch=/usr/local/lib/perl/5.8.8 -Dman1dir=/usr/share/man/man1 
-Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 
-Dsiteman3dir=/usr/local/man/man3 -Dman1ext=1 -Dman3ext=3perl 
-Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Uusesfio -Uusenm 
-Duseshrplib -Dlibperl=libperl.so.5.8.8 -Dd_dosuid -des'
     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=define use64bitall=define uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS 
-DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
     optimize='-O2',
     cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN 
-fno-strict-aliasing -pipe -I/usr/local/include'
     ccversion='', gccversion='4.1.2 20061115 (prerelease) (Debian 
4.1.1-21)', 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='cc', ldflags =' -L/usr/local/lib'
     libpth=/usr/local/lib /lib /usr/lib
     libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
     perllibs=-ldl -lm -lpthread -lc -lcrypt
     libc=/lib/libc-2.3.6.so, so=so, useshrplib=true, 
libperl=libperl.so.5.8.8
     gnulibc_version='2.3.6'
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
     cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'

Characteristics of this binary (from libperl):
   Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT
                         PERL_MALLOC_WRAP THREADS_HAVE_PIDS USE_64_BIT_ALL
                         USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
                         USE_PERLIO USE_REENTRANT_API
   Built under linux
   Compiled at Apr 25 2008 19:26:38
    <at> INC:
     /etc/perl
     /usr/local/lib/perl/5.8.8
     /usr/local/share/perl/5.8.8
     /usr/lib/perl5
     /usr/share/perl5
     /usr/lib/perl/5.8
     /usr/share/perl/5.8
     /usr/local/lib/site_perl
     .
dent:~#

Torsten Foertsch wrote:
> Hi,
> 
> I have recently got a bug report about Linux::Smaps. The poster said it'd
> report 2 [vdso] areas and that it can be cured if /proc/self/smaps is opened
> with '<:stdio'. Later on he also found the behavior depends on the kernel
> version, 2.6.25.3 shows 2 vdsos 2.6.23.1-21 only one.
> 
> Since I don't have any of these kernels I am asking for help. To all of my
> knowledge multiple vdsos is nonsense. But is it a kernel bug or a bug in the
> perlio layer?
> 
> Could you please run the following command on various combinations of linux
> kernel and perlio?
> 
> PERLIO="stdio" perl -pe 'BEGIN {my $smaps="/proc/$$/smaps";
>   open STDIN, "<", $smaps or die "$!\n"; system "cat -n $smaps"}
>   $_="$.\t$_"' | grep vdso
> 
> It should print 2 almost identical lines. If there are more please report.
> 
> Here an example:
> 
> $ PERLIO="stdio" perl -pe 'BEGIN {my $smaps="/proc/$$/smaps"; open STDIN, "<", $smaps or die "$!\n";
system "cat -n $smaps"} $_="$.\t$_"'|grep vdso
>    321  ffffe000-fffff000 r-xp 00000000 00:00 0          [vdso]
> 321     ffffe000-fffff000 r-xp 00000000 00:00 0          [vdso]
> 
> Keep in mind that /proc/$$/smaps exists only for kernels >=2.6.14.
> 
> Thanks,
> Torsten
> 

Mårten Svantesson | 3 Jun 12:17 2008

[mp2] "did not send an HTTP header" due to (involuntary) flush

We are migrating a big site from mod_perl1 to mod_perl2. The site originally was written as CGIs so headers
are mostly set with print statements. The
Content-Type are mostly printed in the end of the script.

The problem is that we occassionally start processes from the scripts and then the output gets flushed and
thus we get Internal Server Error with the
message "did not send an HTTP header" in the error.log.

I tried to write an output filter that merge all buckets until \n\n is encountered, but I don't seem to be able
to insert the filter so that it
executes before the mod_perl header parsing.

Looking in the mailing list archive it seems like this problem was extensively discussed in the thread
"[mp2] CGI redirects incorrectly handled?" back
in March 2003. In the final mail of the thread
<http://article.gmane.org/gmane.comp.apache.mod-perl/4889> Stas mentions possible future
changes to
alleviate the problem. Has anything of this been implemented?

Or does anybody have any other idea how to solve this (without rewriting our scripts, which are *many*)?

We are now running mod_perl 2.0.2 (the version available in RedHat EL) in Apache 2.2.3.

Our configuration:

<FilesMatch "\.(cgi|pl|pl5)$">
     SetHandler perl-script
     PerlFixupHandler Apache2::SizeLimit
     PerlResponseHandler ModPerl::Registry
     PerlOptions +ParseHeaders
</FilesMatch>

--

-- 
  Mårten Svantesson

John Peacock | 3 Jun 13:20 2008

Re: Linux::Smaps kernel/perlio dependencies

Torsten Foertsch wrote:
> PERLIO="stdio" perl -pe 'BEGIN {my $smaps="/proc/$$/smaps";
>   open STDIN, "<", $smaps or die "$!\n"; system "cat -n $smaps"}
>   $_="$.\t$_"' | grep vdso

Since  Merijn already did 2.6.16/18/22, (which I've confirmed on my boxes), 
here's 2.6.25:

Linux localhost.localdomain 2.6.25.3-18.fc9.i686 #1 SMP Tue May 13 05:38:53 EDT 
2008 i686 i686 i386 GNU/Linux

perl, v5.10.0 built for i386-linux-thread-multi

PERLIO="stdio" perl -pe 'BEGIN {my $smaps="/proc/$$/smaps";
 >   open STDIN, "<", $smaps or die "$!\n"; system "cat -n $smaps"}
 >   $_="$.\t$_"' | grep vdso
      1  00110000-00111000 r-xp 00110000 00:00 0          [vdso]
1       00110000-00111000 r-xp 00110000 00:00 0          [vdso]

HTH

John


Gmane