You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Tyler 'Crackerjack' MacDonald <ty...@yi.org> on 2003/11/15 21:21:49 UTC

[mp2] segfaults when using "include" filter w/mod_perl

Hello,

 Thanks for taking the time to look at this:


-------------8<---------- Start Bug Report ------------8<----------
1. Problem Description:

 If anyone knows how to fix this, please CC: your reply directly to me, I'm
not subscribed to the list, thanks :-)

 When using mod_include and mod_perl together with DBI (DBD::mysql),
 strange crashes happen.

 My code works in this setup:

  Apache/2.0.46 mod_perl-1.99_09 Perl/5.8.0

 My code fails with a segmentation fault in this setup:

  Apache/2.0.48 mod_perl-1.99_11 (or CVS) Perl/5.8.2

 My code does this:

 - A ModPerl::Registry script sends a Server-Side-Include for a shtml file
 - That shtml file in turn sends a Server-Side-Include for a ModPerl script
 - Either ModPerl script in question attempts to access DBI

 EG;

 a.pl:

 $r->print("<!--#include virtual=\"b.inc\" -->");

 b.inc:

 <!--#include virtual=\"c.pl\" -->

 c.pl

 ...
 $sth->execute()
 $r->print($sth->fetchrow_array());

 Here is the debugging output I get from gdb:

#0  0x00000050 in ?? ()
#1  0x0808d0fa in core_output_filter (f=0x81d80a0, b=0x81e3c90) at
core.c:3926
#2  0x08084b81 in ap_pass_brigade (next=0xbfffe1e8, bb=0xbfffe1ec)
    at util_filter.c:550
#3  0x4046bddd in logio_out_filter (f=0x81d8060, bb=0x81e86e8)
    at mod_logio.c:179
#4  0x08084b81 in ap_pass_brigade (next=0xbfffe1e8, bb=0xbfffe1ec)
    at util_filter.c:550
#5  0x0808713f in ap_content_length_filter (f=0x81e2a50, b=0x81e86e8)
    at protocol.c:1263
#6  0x08084b81 in ap_pass_brigade (next=0xbfffe1e8, bb=0xbfffe1ec)
    at util_filter.c:550
#7  0x404642ef in handle_include (ctx=0x81d80e0, bb=0xbfffe8b4, r=0x81e1c48, 
    f=0x81e37b0, head_ptr=0x81de120, inserted_head=0xbfffe458)
    at mod_include.c:1268
#8  0x4046728a in send_parsed_content (bb=0xbfffe8b4, r=0x81e1c48,
f=0x81e37b0)
    at mod_include.c:3120
#9  0x40467d6c in includes_filter (f=0x81e37b0, b=0x81e86e8)
    at mod_include.c:3428
#10 0x08084b81 in ap_pass_brigade (next=0xbfffe1e8, bb=0xbfffe1ec)
    at util_filter.c:550
#11 0x404b57ec in modperl_wbucket_pass (wb=0x81e5c20, 
    buf=0x81e5c24 "<HTML><HEAD><TITLE>DBI
TEST</TITLE></HEAD><BODY><!--#include virtual=\"testdbi.inc\"
--></BODY></HTML>\nD><TD>biz</TD><TD>eNom</TD><TD>15.99</TD><TD>2</TD><TD>10</TD></TR>\n
<TR><TD>3</TD><TD>bz</TD><TD>e"..., len=101, 
    add_flush_bucket=0) at modperl_filter.c:164
#12 0x404b5b39 in modperl_wbucket_flush (wb=0x81e5c20, 
    add_flush_bucket=-1073749524) at modperl_filter.c:182
#13 0x404b5511 in PerlIOApache_flush (my_perl=0x817a198, f=0x81ddc00)
    at modperl_io_apache.c:177
#14 0x405c69a6 in Perl_PerlIO_flush () from /usr/lib/libperl.so.5.8
#15 0x405abc1a in Perl_do_openn () from /usr/lib/libperl.so.5.8
#16 0x405aa91c in Perl_do_open () from /usr/lib/libperl.so.5.8
#17 0x404b49ab in modperl_io_perlio_override_stdout (my_perl=0x817a198, 
    r=0x81ddc00) at modperl_io.c:140
#18 0x404aa750 in modperl_response_handler_cgi (r=0x8389f00) at
mod_perl.c:888
#19 0x08077615 in ap_run_handler (r=0x8389f00) at config.c:194
#20 0x08077c20 in ap_invoke_handler (r=0x8389f00) at config.c:401
#21 0x0809104f in ap_run_sub_req (r=0x8389f00) at request.c:1893
#22 0x4046414d in handle_include (ctx=0x81d8180, bb=0xbffff1a4, r=0x82a73e8, 
    f=0x82a8288, head_ptr=0x81ddef0, inserted_head=0xbfffed48)
    at mod_include.c:1349
#23 0x4046728a in send_parsed_content (bb=0xbffff1a4, r=0x82a73e8,
f=0x82a8288)
    at mod_include.c:3120
#24 0x40467d6c in includes_filter (f=0x82a8288, b=0x82a83c8)
    at mod_include.c:3428
#25 0x08084b81 in ap_pass_brigade (next=0xbfffe1e8, bb=0xbfffe1ec)
    at util_filter.c:550
#26 0x0808c821 in default_handler (r=0x82a73e8) at core.c:3558
#27 0x08077615 in ap_run_handler (r=0x82a73e8) at config.c:194
#28 0x08077c20 in ap_invoke_handler (r=0x82a73e8) at config.c:401
#29 0x0809104f in ap_run_sub_req (r=0x82a73e8) at request.c:1893
#30 0x4046414d in handle_include (ctx=0x81d80e0, bb=0xbffff774, r=0x81e1c48, 
    f=0x81e37b0, head_ptr=0x81ddc20, inserted_head=0xbffff318)
    at mod_include.c:1349
#31 0x4046728a in send_parsed_content (bb=0xbffff774, r=0x81e1c48,
f=0x81e37b0)
    at mod_include.c:3120
#32 0x40467d6c in includes_filter (f=0x81e37b0, b=0x81e85b0)
    at mod_include.c:3428
#33 0x08084b81 in ap_pass_brigade (next=0xbfffe1e8, bb=0xbfffe1ec)
    at util_filter.c:550
#34 0x404b57ec in modperl_wbucket_pass (wb=0x81e5c20, 
    buf=0x81e5c24 "<HTML><HEAD><TITLE>DBI
TEST</TITLE></HEAD><BODY><!--#include virtual=\"testdbi.inc\"
--></BODY></HTML>\nD><TD>biz</TD><TD>eNom</TD><TD>15.99</TD><TD>2</TD><TD>10</TD></TR>\n
<TR><TD>3</TD><TD>bz</TD><TD>e"..., len=101, 
    add_flush_bucket=0) at modperl_filter.c:164
#35 0x404b5b39 in modperl_wbucket_flush (wb=0x81e5c20, 
    add_flush_bucket=-1073749524) at modperl_filter.c:182
#36 0x404b5511 in PerlIOApache_flush (my_perl=0x817a198, f=0x81ddc00)
#33 0x08084b81 in ap_pass_brigade (next=0xbfffe1e8, bb=0xbfffe1ec)
    at util_filter.c:550
#34 0x404b57ec in modperl_wbucket_pass (wb=0x81e5c20, 
    buf=0x81e5c24 "<HTML><HEAD><TITLE>DBI
TEST</TITLE></HEAD><BODY><!--#include virtual=\"testdbi.inc\"
--></BODY></HTML>\nD><TD>biz</TD><TD>eNom</TD><TD>15.99</TD><TD>2</TD><TD>10</TD></TR>\n
<TR><TD>3</TD><TD>bz</TD><TD>e"..., len=101, 
    add_flush_bucket=0) at modperl_filter.c:164
#35 0x404b5b39 in modperl_wbucket_flush (wb=0x81e5c20, 
    add_flush_bucket=-1073749524) at modperl_filter.c:182
#36 0x404b5511 in PerlIOApache_flush (my_perl=0x817a198, f=0x81ddc00)
---Type <return> to continue, or q <return> to quit---
    at modperl_io_apache.c:177
#37 0x405c69a6 in Perl_PerlIO_flush () from /usr/lib/libperl.so.5.8
#38 0x405c7681 in PerlIOBase_close () from /usr/lib/libperl.so.5.8
#39 0x404b561c in PerlIOApache_close (my_perl=0x81ddc00, f=0x8172c58)
    at modperl_io_apache.c:191
#40 0x405c5f5e in PerlIO__close () from /usr/lib/libperl.so.5.8
#41 0x405c5fac in Perl_PerlIO_close () from /usr/lib/libperl.so.5.8
#42 0x405ac5cf in Perl_do_openn () from /usr/lib/libperl.so.5.8
#43 0x405aa990 in Perl_do_open9 () from /usr/lib/libperl.so.5.8
#44 0x080f7c7c in ?? ()
#45 0x404c988e in __func__.6 () from /opt/apache2/modules/mod_perl.so
#46 0x00000002 in ?? ()


2. Used Components and their Configuration:

*** mod_perl version 1.9912

*** using /opt/apache2/perl5lib/i386-linux-thread-multi/Apache2/Apache/BuildConfig.pm
*** Makefile.PL options:
  MP_AP_PREFIX    => /opt/apache2
  MP_COMPAT_1X    => 
  MP_DEBUG        => 1
  MP_GENERATE_XS  => 1
  MP_INST_APACHE2 => 1
  MP_LIBNAME      => mod_perl
  MP_MAINTAINER   => 1
  MP_TRACE        => 1
  MP_USE_DSO      => 1
  MP_USE_STATIC   => 


*** /opt/apache2/bin/httpd -V
Server version: Apache/2.0.48
Server built:   Nov 14 2003 17:09:09
Server's Module Magic Number: 20020903:4
Architecture:   32-bit
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D HTTPD_ROOT="/opt/apache2"
 -D SUEXEC_BIN="/opt/apache2/bin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"


*** /usr/bin/perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 2) configuration:
  Platform:
    osname=linux, osvers=2.4.22-xfs+ti1211, archname=i386-linux-thread-multi
    uname='linux kosh 2.4.22-xfs+ti1211 #1 sat oct 25 10:11:37 est 2003 i686 gnulinux '
    config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=i386-linux -Dprefix=/usr -Dprivlib=/usr/share/perl/5.8.2 -Darchlib=/usr/lib/perl/5.8.2 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.8.2 -Dsitearch=/usr/local/lib/perl/5.8.2 -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.2 -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 -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O3',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='3.3.2 (Debian)', 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.2.so, so=so, useshrplib=true, libperl=libperl.so.5.8.2
    gnulibc_version='2.3.2'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
  Built under linux
  Compiled at Nov  8 2003 01:41:44
  %ENV:
    PERL_LWP_USE_HTTP_10="1"
  @INC:
    /etc/perl
    /usr/local/lib/perl/5.8.2
    /usr/local/share/perl/5.8.2
    /usr/lib/perl5
    /usr/share/perl5
    /usr/lib/perl/5.8.2
    /usr/share/perl/5.8.2
    /usr/local/lib/site_perl
    .


3. This is the core dump trace: (if you get a core dump):

  [CORE TRACE COMES HERE]

This report was generated by -e on Sat Nov 15 20:15:08 2003 GMT.

-------------8<---------- End Bug Report --------------8<----------

Note: Complete the rest of the details and post this bug report to
dev <at> perl.apache.org. To subscribe to the list send an empty
email to dev-subscribe@perl.apache.org.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] segfaults when using "include" filter w/mod_perl

Posted by Ian Holsman <li...@holsman.net>.
Stas Bekman wrote:
> Stas Bekman wrote:
> 
>> Stas Bekman wrote:
>>
>>> Tyler 'Crackerjack' MacDonald wrote:
>>>
>>>> Hello,
>>>>
>>>>  Thanks for taking the time to look at this:
>>>
>>>
>>>
>>>
>>> Thanks for reporting this Tyler, I'm looking at this issue, though I 
>>> may come back to you only on Thu, once I'm back from ApacheCon.
>>
>>
>>
>> Ian and Tyler, I now have reproduced the segfault. Next going to fix it.
> 
> 
> Folks, please test your code with the current cvs, it should be fixed now.
> http://perl.apache.org/download/source.html#Development_mod_perl_2_0_Source_Distribution 
> 
works nicely for me so far!
thanks Stas.
> 
> 
> __________________________________________________________________
> Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/     mod_perl Guide ---> http://perl.apache.org
> mailto:stas@stason.org http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org   http://ticketmaster.com
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] segfaults when using "include" filter w/mod_perl

Posted by Stas Bekman <st...@stason.org>.
Stas Bekman wrote:
> Stas Bekman wrote:
> 
>> Tyler 'Crackerjack' MacDonald wrote:
>>
>>> Hello,
>>>
>>>  Thanks for taking the time to look at this:
>>
>>
>>
>> Thanks for reporting this Tyler, I'm looking at this issue, though I 
>> may come back to you only on Thu, once I'm back from ApacheCon.
> 
> 
> Ian and Tyler, I now have reproduced the segfault. Next going to fix it.

Folks, please test your code with the current cvs, it should be fixed now.
http://perl.apache.org/download/source.html#Development_mod_perl_2_0_Source_Distribution


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] segfaults when using "include" filter w/mod_perl

Posted by Stas Bekman <st...@stason.org>.
Stas Bekman wrote:
> Tyler 'Crackerjack' MacDonald wrote:
> 
>> Hello,
>>
>>  Thanks for taking the time to look at this:
> 
> 
> Thanks for reporting this Tyler, I'm looking at this issue, though I may 
> come back to you only on Thu, once I'm back from ApacheCon.

Ian and Tyler, I now have reproduced the segfault. Next going to fix it.

(Ian reported a similar problem over irc)

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] segfaults when using "include" filter w/mod_perl

Posted by Stas Bekman <st...@stason.org>.
Tyler 'Crackerjack' MacDonald wrote:
> Hello,
> 
>  Thanks for taking the time to look at this:

Thanks for reporting this Tyler, I'm looking at this issue, though I may come 
back to you only on Thu, once I'm back from ApacheCon.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org