Re: Apache 1.3.12/mod_perl 1.24/Perl 5.6.0 crash

2000-08-14 Thread George Sanderson

I was able to get the Apache::AutoIndex module to load and run by
statically building mod_perl into Apache.  Thanks.

Somebody should fix the flaky DSO.  I did notice that the problems are
timing related.  I would could get different results when I did a fast
"apachectl stop", "apachectl start" (the RedHat /etc/rc.d/init.d/httpd does
this) as opposed to a slow sequence.

>I have Apache 1.3.12 using mod_perl 1.24 as a DSO, built with Perl 5.6.0
using
>Apache::AutoIndex 0.08 which is running on Linux 2.2.14. 
>Everything works fine, until, I `apachectl stop`, then add the following
to the httpd.conf:
>PerlModule Apache::AutoIndex
>When I do `bin/httpd -X` Linux does a core dump.

In the process, I noticed the awkwardness of the httpd.conf
"LoadModule","AddModule" directive pair.

Apache's httpd knows which modules are statically linked (evidenced by
httpd -l).   Modules should not be loaded ("LoadModule") if they are linked
statically, and conversely, DSO modules can not be added ("AddModule") if
they are not loaded (LoadModule).  

Perhaps a better directive would just be "EnableModule", so that a DSO
module would be both loaded and enabled and a statically linked  module
would not activated unless it was enabled ("EnableModule").  (I know this
sounds simple, and probably why it can't be implemented. :)






Re: Apache 1.3.12/mod_perl 1.24/Perl 5.6.0 crash

2000-08-11 Thread ___cliff rayman___

George Sanderson wrote:

>  Do you know if there is more success one way or
> the other (static vr. DSO)?

i'd say that most of us are building statically.  there have been a lot more
problems with DSO builds than static ones.

>
>
> I've attached the Perl 5.6.0 config.sh file.
>
> For mod_perl I used a makepl_args.mod_perl file in the src root as follows:
> EVERYTHING=1
> #PERL_DEBUG=1
> #PERL_TRACE=1
> USE_APXS=1
> WITH_APXS=/usr/bin/apxs
> #DO_HTTPD=1
> #NO_HTTPD=1
> #PREP_HTTPD=1
> APACHE_PREFIX=/usr/local/apache
> APACHE_SRC=/usr/src/apache_1.3.12/src
>
>   
>
>perl.cfgName: perl.cfg
>Type: Plain Text (text/plain)
>
>   

--
___cliff [EMAIL PROTECTED]http://www.genwax.com/





Re: Apache 1.3.12/mod_perl 1.24/Perl 5.6.0 crash

2000-08-11 Thread George Sanderson

At 03:59 PM 8/11/00 -0700, you wrote:
>Just curious, but how did you build 5.6.0?  Running 5.6.0 and  
>mdo_perl dso,  I got the same thing.  Have you tried compiling it 
>statically?
>
>On 11 Aug 2000, at 16:52, George Sanderson wrote:
>> Let me try this again.
>> Recap:
>> I have Apache 1.3.12 using mod_perl 1.24 as a DSO, built with Perl
>> 5.6.0 using Apache::AutoIndex 0.08 which is running on Linux 2.2.14.
>> Everything works fine, until, I `apachectl stop`, then add the
>> following to the httpd.conf: PerlModule Apache::AutoIndex When I do
>> `bin/httpd -X` Linux does a core dump.
>> 
> 
I really like the modular nature of DSO.  One benifit from the DSO is that,
I can just rebuild mod_perl independently of httpd.  I normally build a
production and a debug version of mod_perl then start up httpd on a
differnt port to toubleshoot problems.  I have tried the static build in
the past but not resently.  Do you know if there is more success one way or
the other (static vr. DSO)?

I've attached the Perl 5.6.0 config.sh file.
 
For mod_perl I used a makepl_args.mod_perl file in the src root as follows:
EVERYTHING=1
#PERL_DEBUG=1
#PERL_TRACE=1
USE_APXS=1
WITH_APXS=/usr/bin/apxs
#DO_HTTPD=1
#NO_HTTPD=1
#PREP_HTTPD=1
APACHE_PREFIX=/usr/local/apache
APACHE_SRC=/usr/src/apache_1.3.12/src


>#!/bin/sh
>>#
>># This file was produced by running the Configure script. It holds all the
>># definitions figured out by Configure. Should you modify one of these values,
>># do not forget to propagate your changes by running "Configure -der". You may
>># instead choose to run each of the .SH files by yourself, or "Configure -S".
>>#
>>
>># Package name  : perl5
>># Source directory  : .
>># Configuration time: Fri Aug 11 12:29:20 CDT 2000
>># Configured by : george
>># Target system : linux estore.xorgate.com 2.2.14 #3 sat jan 15 08:41:41 cst 
>2000 i586 unknown 
>>
>>Author=''
>>Date='$Date'
>>Header=''
>>Id='$Id'
>>Locker=''
>>Log='$Log'
>>Mcc='Mcc'
>>RCSfile='$RCSfile'
>>Revision='$Revision'
>>Source=''
>>State=''
>>_a='.a'
>>_exe=''
>>_o='.o'
>>afs='false'
>>alignbytes='4'
>>ansi2knr=''
>>aphostname='/bin/hostname'
>>api_revision='5'
>>api_subversion='0'
>>api_version='5'
>>api_versionstring='5.005'
>>ar='ar'
>>archlib='/usr/local/lib/perl5/5.6.0/i586-linux'
>>archlibexp='/usr/local/lib/perl5/5.6.0/i586-linux'
>>archname64=''
>>archname='i586-linux'
>>archobjs=''
>>awk='awk'
>>baserev='5.0'
>>bash=''
>>bin='/usr/bin'
>>bincompat5005='undef'
>>binexp='/usr/bin'
>>bison=''
>>byacc='byacc'
>>byteorder='1234'
>>c=''
>>castflags='0'
>>cat='cat'
>>cc='gcc'
>>cccdlflags='-fpic'
>>ccdlflags='-rdynamic -Wl,-rpath,/usr/local/lib/perl5/5.6.0/i586-linux/CORE'
>>ccflags='-fno-strict-aliasing -I/usr/local/include'
>>ccsymbols='__GNUC_MINOR__=91 __i386=1 __i386__=1 __i686=1 __i686__=1 __linux=1 
>__linux__=1 __pentiumpro=1 __pentiumpro__=1 __unix=1 __unix__=1 cpu=i386 machine=i386 
>pentiumpro=1 system=posix system=unix'
>>cf_by='george'
>>cf_email='[EMAIL PROTECTED]'
>>cf_time='Fri Aug 11 12:29:20 CDT 2000'
>>charsize='1'
>>chgrp=''
>>chmod=''
>>chown=''
>>clocktype='clock_t'
>>comm='comm'
>>compress=''
>>contains='grep'
>>cp='cp'
>>cpio=''
>>cpp='cpp'
>>cpp_stuff='42'
>>cppccsymbols='__ELF__=1 __GNUC__=2 i386=1 i686=1 linux=1 unix=1'
>>cppflags='-fno-strict-aliasing -I/usr/local/include'
>>cpplast='-'
>>cppminus='-'
>>cpprun='gcc -E'
>>cppstdin='gcc -E'
>>cppsymbols='__GNUC_MINOR__=91 _POSIX_C_SOURCE=199506 _POSIX_SOURCE=1 __STDC__=1 
>__i386=1 __i386__=1 __i686=1 __i686__=1 __linux=1 __linux__=1 __unix=1 __unix__=1'
>>crosscompile='undef'
>>cryptlib=''
>>csh='csh'
>>d_Gconvert='gcvt((x),(n),(b))'
>>d_PRIEldbl='define'
>>d_PRIFldbl='define'
>>d_PRIGldbl='define'
>>d_PRIX64='define'
>>d_PRId64='define'
>>d_PRIeldbl='define'
>>d_PRIfldbl='define'
>>d_PRIgldbl='define'
>>d_PRIi64='define'
>>d_PRIo64='define'
>>d_PRIu64='define'
>>d_PRIx64='define'
>>d_access='define'
>>d_accessx='undef'
>>d_alarm='define'
>>d_archlib='define'
>>d_atolf='undef'
>>d_atoll='define'
>>d_attribut='define'
>>d_bcmp='define'
>>d_bcopy='define'
>>d_bincompat5005='undef'
>>d_bsd='undef'
>>d_bsdgetpgrp='undef'
>>d_bsdsetpgrp='undef'
>>d_bzero='define'
>>d_casti32='undef'
>>d_castneg='define'
>>d_charvspr='undef'
>>d_chown='define'
>>d_chroot='define'
>>d_chsize='undef'
>>d_closedir='define'
>>d_const='define'
>>d_crypt='define'
>>d_csh='define'
>>d_cuserid='define'
>>d_dbl_dig='define'
>>d_difftime='define'
>>d_dirnamlen='undef'
>>d_dlerror='define'
>>d_dlopen='define'
>>d_dlsymun='undef'
>>d_dosuid='undef'
>>d_drand48proto='define'
>>d_dup2='define'
>>d_eaccess='undef'
>>d_endgrent='define'
>>d_endhent='define'
>>d_endnent='define'
>>d_endpent='define'
>>d_endpwent='define'
>>d_endsent='define'
>>d_endspent='define'
>>d_eofnblk='define'
>>d_eunice='undef'
>>d_fchmod='define'
>>d_fchown='define'
>>d_fcntl='define'
>>d_fd_macros='define'
>>d_fd_set='define'
>>d_fds_bits='undef'
>>d_fgetpos='define'
>>d_flexfnam='define'
>>d_flock='define'
>>d_fork='de

Re: Apache 1.3.12/mod_perl 1.24/Perl 5.6.0 crash

2000-08-11 Thread George Sanderson

Let me try this again.
Recap:
I have Apache 1.3.12 using mod_perl 1.24 as a DSO, built with Perl 5.6.0
using Apache::AutoIndex 0.08 which is running on Linux 2.2.14. 
Everything works fine, until, I `apachectl stop`, then add the following to
the httpd.conf:
PerlModule Apache::AutoIndex
When I do `bin/httpd -X` Linux does a core dump.

Has anyone tried this configuration with AutoIndex.pm with either
successful or with problems?
The following is the gdb bt listing:
=
(gdb) bt 
Program received signal SIGSEGV, Segmentation fault. 
0x8054b09 in ap_remove_module () 
(gdb) bt 
#0 0x8054b09 in ap_remove_module () 
#1 0x8054bdf in ap_remove_loaded_module () 
#2 0x804f2cc in unload_module () 
#3 0x805126e in run_cleanups () 
#4 0x804f910 in ap_clear_pool () 
#5 0x8060683 in standalone_main () 
#6 0x8060f23 in main () 
#7 0x2ab304a5 in __libc_start_main () from /lib/libc.so.6 
#8 0x815b in ?? () 
Cannot access memory at address 0xe853.

The following is tail end of a verbose strace ouput during a core dump. 
=
open("/usr/local/apache/logs/error_log.test", O_WRONLY|O_APPEND|O_CREAT,
0666) = 4
fcntl(4, F_DUPFD, 15)   = 15
close(4)= 0
fcntl(15, F_GETFL)  = 0x401 (flags O_WRONLY|O_APPEND)
fstat(15, {st_mode=S_IFREG|0644, st_size=13212, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,0) =
0x2aac
_llseek(15, 0, [0], SEEK_CUR)   = 0
dup2(15, 2) = 2
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
open("/usr/local/apache/conf/apache-mime.types", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=7374, ...}) = 0
fstat(4, {st_mode=S_IFREG|0644, st_size=7374, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,0) =
0x2aac8000
read(4, "# This is the default mime.types"..., 4096) = 4096
read(4, "m.EXT\napplication/vnd.osa.netdep"..., 4096) = 3278
brk(0x848)  = 0x848
read(4, "", 4096)   = 0
close(4)= 0
munmap(0x2aac8000, 4096)= 0
open("/usr/local/apache/logs/access_log.test", O_WRONLY|O_APPEND|O_CREAT,
0644)= 4
fcntl(4, F_DUPFD, 15)   = 16
close(4)= 0
getpid()= 1404
time(NULL)  = 965956118
close(16)   = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
munmap(0x2ad9d000, 14288)   = 0
munmap(0x2ae0a000, 16308)   = 0
munmap(0x2ae0e000, 13712)   = 0
munmap(0x2ae12000, 22668)   = 0
munmap(0x2ada1000, 9064)= 0
munmap(0x2ae18000, 46408)   = 0
munmap(0x2ae24000, 29000)   = 0
munmap(0x2ae2c000, 9736)= 0

--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++
=
The following is the tail end of a mod_perl PERL_TRACE output:
=
  5:   _compile();
   entering CGI::_compile
665:my($func) = $AUTOLOAD;
666:my($pack,$func_name);
667:{
668:local($1,$2); # this fixes an obscure variable
suicide problem.
668:local($1,$2); # this fixes an obscure variable
suicide problem.
669:$func=~/(.+)::([^:]+)$/;
670:($pack,$func_name) = ($1,$2);
671:$pack=~s/::SUPER$//;# fix another obscure problem
673:unless defined(${"$pack\:\:AUTOLOADED_ROUTINES"});
672:$pack = ${"$pack\:\:AutoloadClass"} ||
$CGI::DefaultClass
675:my($sub) = \%{"$pack\:\:SUBS"};
675:my($sub) = \%{"$pack\:\:SUBS"};
676:unless (%$sub) {
682:   my($code) = $sub->{$func_name};
684:   $code = "sub $AUTOLOAD { }" if (!$code and
$func_name eq 'DESTROY');
685:   if (!$code) {
695:   die "Undefined subroutine $AUTOLOAD\n" unless $code;
696:   eval "package $pack; $code";
697:   if ($@) {
702:CORE::delete($sub->{$func_name});  #free storage
703:return "$pack\:\:$func_name";
   exited CGI::_compile
   2:   foreach (@_) {
  exited CGI::AUTOLOAD for CGI::_compile_all
exited CGI::_setup_symbols
exited CGI::compile
46: 1;
3:
entering Config::DESTROY
exited Config::DESTROY
entering IO::Handle::DESTROY
exited IO::Handle::DESTROY
Carp::(/usr/local/lib/perl5/5.6.0/Carp.pm:97):
97: { local $@; require Carp::Heavy; }  # XXX fix require to not
clear $@?
Carp::(/usr/local/lib/perl5/5.6.0/Carp.pm:97):
97: { local $@; require Carp::Heavy; }  # XXX fix require to not
clear 

Re: Apache 1.3.12/mod_perl 1.24/Perl 5.6.0 crash

2000-08-11 Thread David Mitchell

George Sanderson <[EMAIL PROTECTED]> wrote:

...
> >> Could this be a lack of memory?



> munmap(0x2ae2c000, 9736)= 0
> --- SIGSEGV (Segmentation fault) ---
> +++ killed by SIGSEGV +++



> Carp::longmess_heavy(/usr/local/lib/perl5/5.6.0/Carp/Heavy.pm:127):
> 127:$$msg;


This is nothing to do with lack of memory, and is almost certainly due to
a bug in perl 5.6.0 which the following patch fixes.


* Dave Mitchell, Operations Manager,
* Fretwell-Downing Facilities Ltd, UK.  [EMAIL PROTECTED]
* Tel: +44 114 281 6113.The usual disclaimers
*
* Standards (n). Battle insignia or tribal totems



 //depot/perl/cop.h#49 (text) 
Index: perl/cop.h
--- perl/cop.h.~1~  Thu Jun  8 06:58:03 2000
+++ perl/cop.h  Thu Jun  8 06:58:03 2000
@@ -106,13 +106,9 @@
 } STMT_END
 #endif /* USE_THREADS */
 
-#ifdef USE_ITHREADS
-   /* junk in @_ spells trouble when cloning CVs, so don't leave any */
-#  define CLEAR_ARGARRAY() av_clear(cx->blk_sub.argarray)
-#else
-#  define CLEAR_ARGARRAY() NOOP
-#endif /* USE_ITHREADS */
-
+/* junk in @_ spells trouble when cloning CVs and in pp_caller(), so don't
+ * leave any */
+#define CLEAR_ARGARRAY()   av_clear(cx->blk_sub.argarray)
 
 #define POPSUB(cx,sv)  \
 STMT_START {   \

 //depot/perl/t/op/runlevel.t#16 (xtext) 
Index: perl/t/op/runlevel.t
--- perl/t/op/runlevel.t.~1~Thu Jun  8 06:58:03 2000
+++ perl/t/op/runlevel.tThu Jun  8 06:58:03 2000
@@ -349,3 +349,18 @@
 bar
 B 2
 bar
+
+sub n { 0 }
+sub f { my $x = shift; d(); }
+f(n());
+f();
+
+sub d {
+my $i = 0; my @a;
+while (do { { package DB; @a = caller($i++) } } ) {
+@a = @DB::args;
+for (@a) { print "$_\n"; $_ = '' }
+}
+}
+EXPECT
+0





Re: Apache 1.3.12/mod_perl 1.24/Perl 5.6.0 crash

2000-08-10 Thread George Sanderson

At 10:49 PM 8/10/00 +0200, you wrote:
>On Thu, Aug 10, 2000 at 07:39:24AM -0500, George Sanderson wrote:
>> At 12:22 PM 8/10/00 +0200, you wrote:
>> >
>> >with almost the same conf as your, I had a core dump even with httpd
>> >-t. I did a strace, and I noticed this is due to an inexistant module :
>> >Tie::*hash or something similar. A quick search on CPAN give me the
>> >package to install. After that, no more segfault ...
>> >
>> I did a strace and the last entries were:
>> 
>> munmap(0x2ae2c000, 9736)= 0
>> --- SIGSEGV (Segmentation fault) ---
>> +++ killed by SIGSEGV +++
>> 
>> Could this be a lack of memory?
>
>dunno...
>if you haven't answer on the list, perhaps a more verbose strace trace
>could help...
>
>
>Good luck,

Thanks (I'd rather be lucky than good!-)
Recap:
I have Apache 1.3.12 using mod_perl 1.24 as a DSO, built with Perl 5.6.0
using Apache::AutoIndex 0.08 which is running on Linux 2.2.14. 
Everything works fine, until, I `apachectl stop`, then add the following to
the httpd.conf:
PerlModule Apache::AutoIndex
When I do `bin/httpd -X` Linux does a core dump.

I added more memory the computer but the program still crashes at the same
point.

Here's more of a more verbose strace ouput during the core dump. 
Any clues?

open("/usr/local/apache/logs/error_log.test", O_WRONLY|O_APPEND|O_CREAT,
0666) = 4
fcntl(4, F_DUPFD, 15)   = 15
close(4)= 0
fcntl(15, F_GETFL)  = 0x401 (flags O_WRONLY|O_APPEND)
fstat(15, {st_mode=S_IFREG|0644, st_size=13212, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2aac
_llseek(15, 0, [0], SEEK_CUR)   = 0
dup2(15, 2) = 2
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
open("/usr/local/apache/conf/apache-mime.types", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=7374, ...}) = 0
fstat(4, {st_mode=S_IFREG|0644, st_size=7374, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2aac8000
read(4, "# This is the default mime.types"..., 4096) = 4096
read(4, "m.EXT\napplication/vnd.osa.netdep"..., 4096) = 3278
brk(0x848)  = 0x848
read(4, "", 4096)   = 0
close(4)= 0
munmap(0x2aac8000, 4096)= 0
open("/usr/local/apache/logs/access_log.test", O_WRONLY|O_APPEND|O_CREAT,
0644) = 4
fcntl(4, F_DUPFD, 15)   = 16
close(4)= 0
getpid()= 1404
time(NULL)  = 965956118
close(16)   = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
munmap(0x2ad9d000, 14288)   = 0
munmap(0x2ae0a000, 16308)   = 0
munmap(0x2ae0e000, 13712)   = 0
munmap(0x2ae12000, 22668)   = 0
munmap(0x2ada1000, 9064)= 0
munmap(0x2ae18000, 46408)   = 0
munmap(0x2ae24000, 29000)   = 0
munmap(0x2ae2c000, 9736)= 0
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++
[
I also did a PERL_TRACE of mod_perl.  The end of which was:

  5:   _compile();
   entering CGI::_compile
665:my($func) = $AUTOLOAD;

666:my($pack,$func_name);
667:{
668:local($1,$2); # this fixes an obscure variable
suicide problem.
668:local($1,$2); # this fixes an obscure variable
suicide problem.
669:$func=~/(.+)::([^:]+)$/;
670:($pack,$func_name) = ($1,$2);
671:$pack=~s/::SUPER$//;# fix another obscure problem
673:unless defined(${"$pack\:\:AUTOLOADED_ROUTINES"});
672:$pack = ${"$pack\:\:AutoloadClass"} ||
$CGI::DefaultClass
675:my($sub) = \%{"$pack\:\:SUBS"};
675:my($sub) = \%{"$pack\:\:SUBS"};
676:unless (%$sub) {
682:   my($code) = $sub->{$func_name};
684:   $code = "sub $AUTOLOAD { }" if (!$code and
$func_name eq 'DESTROY');
685:   if (!$code) {
695:   die "Undefined subroutine $AUTOLOAD\n" unless $code;
696:   eval "package $pack; $code";
697:   if ($@) {
702:CORE::delete($sub->{$func_name});  #free storage
703:return "$pack\:\:$func_name";
   exited CGI::_compile
   2:   foreach (@_) {
  exited CGI::AUTOLOAD for CGI::_compile_all
 exited CGI::_setup_symbols
exited CGI::compile
46: 1;
3:
entering Config::DESTROY
exited Config::DESTROY
entering IO::Handle::DESTROY
exited IO::Handle::DESTROY
Carp::(/usr/local/lib/perl5/5.6.0/Carp.pm:97):
97: { local $@; require