Something, presumably XML::Parser::Expat, is corrupting malloc's and
perl's data structures randomly. Running under MALLOC_CHECK_=2 has a
high probability of showing this. It also occasionally cores in
Perl_sv_upgrade - the SV is hopelessly mangled:
(gdb) p *sv
$17 = {sv_any = 0x83e58955, sv_refcnt = 2203260140, sv_flags = 821518397}
(gdb) where
#0 0x402a5b95 in Perl_sv_upgrade (sv=0x4029d868, mt=136780768) at sv.c:823
#1 0x402a5810 in Perl_sv_upgrade (sv=0x4029d868, mt=136780768) at sv.c:732
#2 0x4029d93d in Perl_pp_or () at pp_hot.c:235
#3 0x4025c266 in Perl_moreswitches (s=0x81a14a4 "PZ\n\b\001") at perl.c:1641
#4 0x4024061e in perl_create_request_config ()
from /usr/lib/apache/1.3/mod_perl.so
#5 0x4023fcf1 in perl_config_getch () from /usr/lib/apache/1.3/mod_perl.so
#6 0x4023de1f in perl_fixup () from /usr/lib/apache/1.3/mod_perl.so
#7 0x8053e64 in ap_invoke_handler (r=0x8289a7c) at http_config.c:508
#8 0x80625ec in process_request_internal (r=0x8289a7c) at http_request.c:1214
#9 0x8062648 in ap_process_request (r=0x8289a7c) at http_request.c:1230
#10 0x805c439 in child_main (child_num_arg=0) at http_main.c:4122
#11 0x805c5cc in make_child (s=0x8099c2c, slot=0, now=954878307)
at http_main.c:4235
#12 0x805c6e9 in startup_children (number_to_start=5) at http_main.c:4317
#13 0x805cb9b in standalone_main (argc=2, argv=0xbffffdb4) at http_main.c:4605
#14 0x805d24d in main (argc=2, argv=0xbffffdb4) at http_main.c:4933
However, I don't think that's a reliable stack trace. The stack seems damaged.
On Tue, Mar 28, 2000 at 12:50:45PM +0200, [EMAIL PROTECTED] wrote:
> Package: libapache-mod-perl
> Version: 1.21.20000309-1
> Severity: Important
>
> When using the XML::Parser::Expat under mod_perl, this causes segmentation
> faults (quite random?) in the child-processes of httpd.
> The error message in the error.log of apache is:
> "[notice] child pid 28177 exit signal Segmentation fault (11)"
>
> This can be repreduced with the following script,
> run under mod_perl, just wait a while, and monitor the error.log (takes a
> while, multiple request will speed up):
>
> ----------------------- cut here -----------------------------
> #!/usr/bin/perl -w
>
> use XML::Parser::Expat;
> use strict;
>
> main();
>
> # bug creater under mod_perl, just results in some simple html
>
> sub main()
> {
> my $problemXP = new XML::Parser::Expat;
> $problemXP->setHandlers(Start => \&Start, End => \&End, Char => \&Text);
> print "Content-type: text/html\n\n";
> $problemXP->parse("<html>\n<meta http-equiv='refresh' content='1'/>\n<body>some
>text</body>\n</html>\n");
> $problemXP->release();
> }
>
> sub Start($$) {
> my $caller = shift;
> my $tag = shift;
> print "<" . $tag;
> print " " . $_[0] . "='" . $_[1] . "'" if $#_ ge 1; # add attributes
> print " " . $_[2] . "='" . $_[3] . "'" if $#_ ge 3; # add attributes
> print ">\n" unless $tag =~ /\s/;
> }
>
> sub End($$) {
> my $caller = shift;
> my $etag = shift;
> print "</" . $etag . ">\n" unless $etag =~ /\s/;
> }
>
> sub Text($$) {
> my $caller = shift;
> my $text = shift;
> print $text . "\n" unless $text =~ /\s/;
> }
> ----------------------- cut here -----------------------------
>
>
> I guess this is caused by a memory-leak or a problem related to loading
> Perl *.so (see bug #48069)
>
> Related packages (frozen/potato, 27 march 2000):
> - libapache-mod-perl 1.21.20000309-1
> - apache-common 1.3.9-12
> - apache-ssl 1.3.9.10 + 1.37-1
> - libxml-parser-perl 2.27-2
> - perl-5.005 5.005.03-6
> - perl-5.005-base 5.005.03-6
> - libmime-base64-perl 2.11-2
> - libdevel-symdump-perl 2.00-4
> - data-dumper 2.09-1
> - liburi-perl 1.04-2
> - libc6 2.1.3-7
> - libdb2 2.4.14-9
> - libgdbmg1 1.7.3-26.2
>
> kernel 2.2.14 (i586 and i686)
> libc-2.1.3.so
>
> * ( didn't encouter with slink, but i am not sure, used CPAN
> instead of libxml-parser-perl.deb...)
>
>
>
> used configuration:
>
> httpd.conf:
> LoadModule config_log_module /usr/lib/apache/1.3/mod_log_config_ssl.so
> LoadModule mime_module /usr/lib/apache/1.3/mod_mime_ssl.so
> LoadModule negotiation_module /usr/lib/apache/1.3/mod_negotiation.so
> LoadModule status_module /usr/lib/apache/1.3/mod_status.so
> LoadModule includes_module /usr/lib/apache/1.3/mod_include.so
> LoadModule autoindex_module /usr/lib/apache/1.3/mod_autoindex.so
> LoadModule dir_module /usr/lib/apache/1.3/mod_dir.so
> LoadModule cgi_module /usr/lib/apache/1.3/mod_cgi.so
> LoadModule userdir_module /usr/lib/apache/1.3/mod_userdir.so
> LoadModule alias_module /usr/lib/apache/1.3/mod_alias.so
> LoadModule rewrite_module /usr/lib/apache/1.3/mod_rewrite.so
> LoadModule access_module /usr/lib/apache/1.3/mod_access.so
> LoadModule auth_module /usr/lib/apache/1.3/mod_auth_ssl.so
> LoadModule expires_module /usr/lib/apache/1.3/mod_expires.so
> LoadModule unique_id_module /usr/lib/apache/1.3/mod_unique_id.so
> LoadModule setenvif_module /usr/lib/apache/1.3/mod_setenvif.so
> LoadModule perl_module /usr/lib/apache/1.3/mod_perl.so
>
> access.conf:
> <Directory /home/justme/public_html>
> AddHandler perl-script .pl
> PerlHandler Apache::Registry
> PerlSendHeader On
> </Directory>
>
>
>
> Notice:
> - preloading perl-scripts or perl-modules doesn't matter.
> - both Apachr::Registry as Apache::PerlRun (without perlsetvar
> perlrunonce!) both cause the problem.
> - both XML::Parser::Expat and XML::Parser::ExpatNB cause the problem.
> - only few httpd-children will cause bug faster
> - maxrequestperchild greather 1
> - when using more (greater/complexer program) xml-parser-expat objects,
> segfaults occur fatser and more often.
> - test-program above runs clean under warnings, strict and taintcheck
>
>
>
Dan
/--------------------------------\ /--------------------------------\
| Daniel Jacobowitz |__| SCS Class of 2002 |
| Debian GNU/Linux Developer __ Carnegie Mellon University |
| [EMAIL PROTECTED] | | [EMAIL PROTECTED] |
\--------------------------------/ \--------------------------------/