Re: Strange Segfault with Apache::PerlRun

2000-06-09 Thread Doug MacEachern

On Fri, 9 Jun 2000, Damon Buckwalter wrote:
> I'm sorry, please excuse my previous laziness...  Here's all the info I can
> gather:

if you compile with PERL_DEGUG=1, the stacktrace will give more info.
looks like the call to Apache::warn, the problem probably goes away with
this bandaid.

--- PerlRun.pm  2000/06/01 21:07:56 1.29
+++ PerlRun.pm  2000/06/09 18:38:00
@@ -226,7 +226,7 @@
 #XXX not good enough yet
 my(%switches) = (
'T' => sub {
-   Apache::warn("Apache::PerlRun: T switch ignored, ".
+   warn("Apache::PerlRun: T switch ignored, ".
"enable with 'PerlTaintCheck On'\n")
   unless $Apache::__T; "";
},




Re: Strange Segfault with Apache::PerlRun

2000-06-09 Thread Damon Buckwalter

On Fri, Jun 09, 2000 at 10:49:14AM -0700, Doug MacEachern wrote:
> On Tue, 6 Jun 2000, Damon Buckwalter wrote:
> 
> > When using Apache::PerlRun to try and run some CGI-ish scripts I noticed a
> > strange phenomenon.  If the shebang line in the script contains '-T', that
> > Apache child will segfault on requests to the script.  Combinations of '-w',
> > nothing in the shebang line and no shebang line at all work as expected.
> > 
> 
> i can't reproduce that.  can you post the complete gdb stacktrace?  what
> version of Perl?

I'll also try compiling another Apache/mod_perl againt 5.005_03 to see if
that makes a difference.

I'm sorry, please excuse my previous laziness...  Here's all the info I can
gather:

#0  0x401e359d in fputs () from /lib/libc.so.6
#1  0x807d1de in log_error_core ()
#2  0x807d25e in ap_log_error ()
#3  0x8063841 in XS_Apache_log_error ()
#4  0x400cfb92 in Perl_pp_entersub ()
   from /usr/local/lib/perl5/5.6.0/i686-linux/CORE/libperl.so
#5  0x400c9d04 in Perl_runops_standard ()
   from /usr/local/lib/perl5/5.6.0/i686-linux/CORE/libperl.so
#6  0x4008467c in S_call_body ()
   from /usr/local/lib/perl5/5.6.0/i686-linux/CORE/libperl.so
#7  0x400843de in Perl_call_sv ()
   from /usr/local/lib/perl5/5.6.0/i686-linux/CORE/libperl.so
#8  0x40083fdc in Perl_call_method ()
   from /usr/local/lib/perl5/5.6.0/i686-linux/CORE/libperl.so
#9  0x80596c1 in perl_call_handler ()
#10 0x8058fbc in perl_run_stacked_handlers ()
#11 0x8057a70 in perl_handler ()
#12 0x8075419 in ap_invoke_handler ()
#13 0x8089cdf in process_request_internal ()
#14 0x8089d46 in ap_process_request ()
#15 0x8080e86 in child_main ()
#16 0x8081061 in make_child ()
#17 0x80811dc in startup_children ()
#18 0x808183d in standalone_main ()
#19 0x808208c in main ()
#20 0x401b3a42 in __libc_start_main () from /lib/libc.so.6


Info about my Perl:

hyper:/usr/local/bin# perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
osname=linux, osvers=2.3.99-pre3, archname=i686-linux
uname='linux hyper 2.3.99-pre3 #1 smp mon mar 27 16:29:32 pst 2000 i686 unknown '
config_args=''
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=define 
use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler:
cc='gcc', optimize='-O2 -mcpu=i686', gccversion=2.95.2 2313 (Debian GNU/Linux)
cppflags='-fno-strict-aliasing -I/usr/local/include'
ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64'
stdchar='char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
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, usemymalloc=n, prototype=define
  Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lsfio -lnsl -lndbm -lgdbm -ldbm -ldb -ldl -lm -lc -lposix -lcrypt
libc=/lib/libc-2.1.3.so, so=so, useshrplib=true, libperl=libperl.so
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic 
-Wl,-rpath,/usr/local/lib/perl5/5.6.0/i686-linux/CORE'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Compile-time options: USE_LARGE_FILES
  Built under linux
  Compiled at May 23 2000 14:18:47
  @INC:
/usr/local/lib/perl5/5.6.0/i686-linux
/usr/local/lib/perl5/5.6.0
/usr/local/lib/perl5/site_perl/5.6.0/i686-linux
/usr/local/lib/perl5/site_perl/5.6.0
/usr/local/lib/perl5/site_perl
.


Script that breaks it:

#!/usr/local/bin/perl -w -T

use strict;

print "Content-Type: text/plain\n\n";

print "Foo!\n";


.htaccess in that directory:

Options +ExecCGI
SetHandler perl-script

PerlHandler Apache::PerlRun
PerlSendHeader On



Re: Strange Segfault with Apache::PerlRun

2000-06-09 Thread Doug MacEachern

On Tue, 6 Jun 2000, Damon Buckwalter wrote:

> When using Apache::PerlRun to try and run some CGI-ish scripts I noticed a
> strange phenomenon.  If the shebang line in the script contains '-T', that
> Apache child will segfault on requests to the script.  Combinations of '-w',
> nothing in the shebang line and no shebang line at all work as expected.
> 
> Tracing httpd in gdb, it tells me that the segfault is occuring inside
> fgets() in libc.  Perhaps a simple argument parsing problem?

i can't reproduce that.  can you post the complete gdb stacktrace?  what
version of Perl?




Re: Strange Segfault with Apache::PerlRun

2000-06-06 Thread Damon Buckwalter

I forgot to mention also that mod_perl is statically compiled into Apache,
and using Perl 5.6.0

--
OpenPGP public key:   http://www.meta-x.net/damon/pubkey.asc



Strange Segfault with Apache::PerlRun

2000-06-06 Thread Damon Buckwalter

When using Apache::PerlRun to try and run some CGI-ish scripts I noticed a
strange phenomenon.  If the shebang line in the script contains '-T', that
Apache child will segfault on requests to the script.  Combinations of '-w',
nothing in the shebang line and no shebang line at all work as expected.

Tracing httpd in gdb, it tells me that the segfault is occuring inside
fgets() in libc.  Perhaps a simple argument parsing problem?

This is on Apache 1.3.12 / mod_perl 1.24

--
OpenPGP public key:   http://www.meta-x.net/damon/pubkey.asc