Re: modperl 2.0: apache crashes when running modperl script

2003-06-05 Thread arunappa
Stas Bekman <[EMAIL PROTECTED]> wrote:


>'make install' after you have rebuilt mod_perl with MP_DEBUG=1? try to nuke
>/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/Apache
>and 'make install' again.
>
>Actually I know why this happens and why you have the segfault
>
>since you have had:
>
>MP_INST_APACHE2 => 1
>
>it must be installed into 
>i686-linux-thread-multi/Apache2/auto/Apache/RequestIO/RequestIO.so
>
>You probably had an older mod_perl install, and now it loads the wrong 
>library. I see that you didn't load Apache2 and that explains the problem.
>
>Add to your startup 'use Apache2' as explained here:
>http://perl.apache.org/docs/2.0/user/intro/start_fast.html#Configuration
>

I removed RequestIO.so inside 
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/Apache
and did 'make install'. Then added 'use Apache2' in the startup file
and there are no segfaults anymore.

Thanks,

Natarajan Murugaiyan(Ravi)

__
McAfee VirusScan Online from the Netscape Network.
Comprehensive protection for your entire computer. Get your free trial today!
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397

Get AOL Instant Messenger 5.1 free of charge.  Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455


Re: modperl 2.0: apache crashes when running modperl script

2003-06-04 Thread Stas Bekman
[EMAIL PROTECTED] wrote:
[...]
3. This is the core dump trace: (if you get a core dump):

I was able to run 'httpd -X' from inside gbd and got a stack trace
with mod_perl compiled with MP_DEBUG=1:
0x402f458c in modperl_wbucket_write (my_perl=0x81af228, wb=0x81b3900,
buf=0xb438 "4", wlen=0x4063cb8f) at modperl_filter.c:181
181 *wlen = 0;
#0  0x402f458c in modperl_wbucket_write (my_perl=0x81af228, wb=0x81b3900,
buf=0xb438 "4", wlen=0x4063cb8f) at modperl_filter.c:181
#1  0x40640701 in mpxs_Apache__RequestRec_print ()
   from 
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/Apache/RequestIO/RequestIO.so
#2  0x4063e8c6 in XS_Apache__RequestRec_print ()
   from 
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/Apache/RequestIO/RequestIO.so
why RequestIO.so doesn't include the debug info? Are you sure you have run 
'make install' after you have rebuilt mod_perl with MP_DEBUG=1? try to nuke
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/Apache
and 'make install' again.

Actually I know why this happens and why you have the segfault

since you have had:

MP_INST_APACHE2 => 1

it must be installed into 
i686-linux-thread-multi/Apache2/auto/Apache/RequestIO/RequestIO.so

You probably had an older mod_perl install, and now it loads the wrong 
library. I see that you didn't load Apache2 and that explains the problem.

Add to your startup 'use Apache2' as explained here:
http://perl.apache.org/docs/2.0/user/intro/start_fast.html#Configuration


__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: modperl 2.0: apache crashes when running modperl script

2003-06-04 Thread arunappa

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

apache crashes when accessing this modperl script:

package Apache::hello;

use strict;

use Apache::RequestRec ();
use Apache::RequestIO ();
use Apache::Const -compile => 'OK';

sub handler {
  my $request = shift;  # what does shift operate on @_?
  $request->content_type('text/html');

  $request->print(<

Hello There


END

return Apache::OK;
}





2. Used Components and their Configuration:

*** using /usr/download/modperl/mod_perl-1.99_09/t/../lib/Apache/BuildConfig.pm
*** Makefile.PL options:
  MP_AP_PREFIX=> /usr/httpd20
  MP_COMPAT_1X=> 1
  MP_GENERATE_XS  => 1
  MP_INST_APACHE2 => 1
  MP_LIBNAME  => mod_perl
  MP_USE_DSO  => 1
  MP_USE_STATIC   => 1


*** /usr/httpd20/bin/httpd -V
Server version: Apache/2.0.46
Server built:   Jun  1 2003 19:52:02
Server's Module Magic Number: 20020903:3
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="/usr/httpd20"
 -D SUEXEC_BIN="/usr/httpd20/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 0) configuration:
  Platform:
osname=linux, osvers=2.4.18-11smp, archname=i386-linux-thread-multi
uname='linux daffy.perf.redhat.com 2.4.18-11smp #1 smp thu aug 15 06:41:59 edt 
2002 i686 i686 i386 gnulinux '
config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686 -Dmyhostname=localhost 
[EMAIL PROTECTED] -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr 
-Darchname=i386-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Duseshrplib -Dusethreads 
-Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm 
-Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005 
-Uversiononly -Dpager=/usr/bin/less -isr'
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='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
optimize='-O2 -march=i386 -mcpu=i686',
cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -I/usr/include/gdbm'
ccversion='', gccversion='3.2 20020822 (Red Hat Linux Rawhide 3.2-5)', 
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='gcc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt -lutil
perllibs=-lnsl -ldl -lm -lpthread -lc -lcrypt -lutil
libc=/lib/libc-2.2.92.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.2.92'
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic 
-Wl,-rpath,/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE'
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 Sep  1 2002 23:56:49
  %ENV:
PERL_LWP_USE_HTTP_10="1"
  @INC:
/usr/lib/perl5/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0
/usr/lib/perl5/vendor_perl
.


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

I was able to run 'httpd -X' from inside gbd and got a stack trace
with mod_perl compiled with MP_DEBUG=1:

0x402f458c in modperl_wbucket_write (my_perl=0x81af228, wb=0x81b3900,
buf=0xb438 "4", wlen=0x4063cb8f) at modperl_filter.c:181
181 *wlen = 0;

#0  0x402f458c in modperl_wbucket_write (my_perl=0x81af228, wb=0x81b3900,
buf=0xb438 "4", wlen=0x4063cb8f) at modperl_filter.c:181
#1  0x40640701 in mpxs_Apache__RequestRec_print ()
   from 
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/Apache/RequestIO/Re

Re: modperl 2.0: apache crashes when running modperl script

2003-06-03 Thread Stas Bekman
[EMAIL PROTECTED] wrote:
-8<-- Start Bug Report 8<--
1. Problem Description:
apache crashes when accessing this modperl script:

package Apache::hello;

use strict;

use Apache::RequestRec ();
use Apache::RequestIO ();
use Apache::Const -compile => 'OK';
sub handler {
  my $request = shift;  # what does shift operate on @_?
  $request->content_type('text/html');
  $request->print(<

Hello There


END
return Apache::OK;
}
2. Used Components and their Configuration:

*** using /usr/download/modperl/mod_perl-1.99_09/t/../lib/Apache/BuildConfig.pm
*** Makefile.PL options:
  MP_AP_PREFIX=> /usr/httpd20
  MP_COMPAT_1X=> 1
  MP_GENERATE_XS  => 1
  MP_INST_APACHE2 => 1
  MP_LIBNAME  => mod_perl
  MP_USE_DSO  => 1
  MP_USE_STATIC   => 1
that's only a beginning of the report. Where is the rest? Why is it so hard to 
copy-n-paste the report? OK, I'll do that for you.

> 3. This is the core dump trace: (if you get a core dump):
>
> Apache crashes but does not dump core. I set unlimit to unlimited,
> made sure the filesystem from which 'httpd -X' is run has enough free space.
> Still no core. Could not find Bad::Segv module either in modperl or in
> CPAN and therefore could not try to dump using a script like core_dump.pl
> mentioned in 'Debugging mod_perl C Internals' document.
Yeah, I need to update the Bad::Segv part. It's called Debug::DumpCore.

> I was able to run 'httpd -X' from inside gbd and got a stack trace:
>
> (gdb) bt
> #0  0x402f1f47 in modperl_wbucket_write ()
>from /usr/httpd20/modules/mod_perl.so
> #1  0x40638701 in mpxs_Apache__RequestRec_print ()
>from 
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/Apache/RequestIO/RequestIO.so
> #2  0x406368c6 in XS_Apache__RequestRec_print ()
>from 
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/Apache/RequestIO/RequestIO.so
> #3  0x403868c5 in Perl_pp_entersub ()
>from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
> #4  0x4037f059 in Perl_runops_standard ()
>from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
> #5  0x40327139 in S_call_body ()
>from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
> #6  0x40326eb6 in Perl_call_sv ()
>from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
> #7  0x402ed4e2 in modperl_callback () from /usr/httpd20/modules/mod_perl.so
> #8  0x402ed9e4 in modperl_callback_run_handlers ()
>from /usr/httpd20/modules/mod_perl.so
> #9  0x402edc25 in modperl_callback_per_dir ()
>from /usr/httpd20/modules/mod_perl.so
> #10 0x402e9105 in modperl_response_handler_run ()
>from /usr/httpd20/modules/mod_perl.so
> #11 0x402e9325 in modperl_response_handler_cgi ()
>from /usr/httpd20/modules/mod_perl.so
> #12 0x0807b67e in ap_run_handler (r=0x81a9268) at config.c:195
> #13 0x0807bb96 in ap_invoke_handler (r=0x81a9268) at config.c:401
> #14 0x0806baab in ap_process_request (r=0x81a9268) at http_request.c:288
> #15 0x08067ce9 in ap_process_http_connection (c=0x816d458) at http_core.c:293
> #16 0x08084476 in ap_run_process_connection (c=0x816d458) at connection.c:85
> #17 0x0807a234 in child_main (child_num_arg=1080249231) at prefork.c:696
> #18 0x0807a3de in make_child (s=0x80b6178, slot=0) at prefork.c:736
> #19 0x0807a437 in startup_children (number_to_start=5) at prefork.c:808
> #20 0x0807ab29 in ap_mpm_run (_pconf=0x8079b10, plog=0x80ebb50, s=0x80b6178)
> at prefork.c:1024
> #21 0x0807f842 in main (argc=2, argv=0xba74) at main.c:660
> #22 0x420158d4 in __libc_start_main () from /lib/i686/libc.so.6

The problem with this trace is that it doesn't show the arguments. You need to 
build mod_perl with MP_DEBUG=1 and generate it again.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: modperl 2.0: apache crashes when running modperl script

2003-06-02 Thread arunappa
-8<-- Start Bug Report 8<--
1. Problem Description:

apache crashes when accessing this modperl script:

package Apache::hello;

use strict;

use Apache::RequestRec ();
use Apache::RequestIO ();
use Apache::Const -compile => 'OK';

sub handler {
  my $request = shift;  # what does shift operate on @_?
  $request->content_type('text/html');

  $request->print(<

Hello There


END

return Apache::OK;
}

2. Used Components and their Configuration:

*** using /usr/download/modperl/mod_perl-1.99_09/t/../lib/Apache/BuildConfig.pm
*** Makefile.PL options:
  MP_AP_PREFIX=> /usr/httpd20
  MP_COMPAT_1X=> 1
  MP_GENERATE_XS  => 1
  MP_INST_APACHE2 => 1
  MP_LIBNAME  => mod_perl
  MP_USE_DSO  => 1
  MP_USE_STATIC   => 1


__
McAfee VirusScan Online from the Netscape Network.
Comprehensive protection for your entire computer. Get your free trial today!
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397

Get AOL Instant Messenger 5.1 free of charge.  Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455


Re: modperl 2.0: apache crashes when running modperl script

2003-06-02 Thread arunappa


__
McAfee VirusScan Online from the Netscape Network.
Comprehensive protection for your entire computer. Get your free trial today!
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397

Get AOL Instant Messenger 5.1 free of charge.  Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455


bug.rpt
Description: bug.rpt


Re: modperl 2.0: apache crashes when running modperl script

2003-06-02 Thread Ged Haywood
Hi guys,

On Mon, 2 Jun 2003, Stas Bekman wrote:

> > Sun Jun 01 18:51:42 2003] [notice] Apache/2.0.46 (Unix)
> > mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.46 OpenSSL/0.9.6b

http://www.openssl.org/news/secadv_20030219.txt

73,
Ged.




Re: modperl 2.0: apache crashes when running modperl script

2003-06-02 Thread Stas Bekman
[EMAIL PROTECTED] wrote:
I get an Internal Server Error in the browser when trying
to access the URI /hello. 

Apache and modperl version:
Sun Jun 01 18:51:42 2003] [notice] Apache/2.0.46 (Unix) mod_perl/1.99_09 Perl/v5.8.0 
mod_ssl/2.0.46 OpenSSL/0.9.6b configured -- resuming normal operations
When submitting bug reports, please follow these guidelines:
http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems
[...]

package Apache::hello;

use strict;

use Apache::RequestRec ();
use Apache::RequestIO ();
sub handler {
  my $request = shift;  # what does shift operate on @_?
  $request->content_type('text/html');
  $request->print(<

Hello There


END
return "Apache::OK";
}
Where did you take this example from? you should return a constant Apache::OK, 
not a string "Apache::OK". You need to import this constant before you can use 
it. Here is a skeleton:

use Apache::Const -compile => 'OK';

sub handler {
  ...
  return Apache::OK;
}
1;

Relevant httpd error_log:
[Sun Jun 01 19:04:46 2003] [notice] child pid 2861 exit signal Segmentation fault (11)
Relevant http access_log:
127.0.0.1 - - [01/Jun/2003:19:04:46 -0400] "GET /hello HTTP/1.1" 500 670
I am not sure if the problem is with apache or modperl.
I could not find a core file under httpd ServerRoot.
Take a look at:
http://perl.apache.org/docs/2.0/devel/debug/c.html#Getting_the_core_File_Dumped
__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


modperl 2.0: apache crashes when running modperl script

2003-06-02 Thread arunappa


I get an Internal Server Error in the browser when trying
to access the URI /hello. 

Apache and modperl version:
Sun Jun 01 18:51:42 2003] [notice] Apache/2.0.46 (Unix) mod_perl/1.99_09 Perl/v5.8.0 
mod_ssl/2.0.46 OpenSSL/0.9.6b configured -- resuming normal operations

Relvant contents of perl.conf file:
PerlRequire /home/ravi/www/apache/modperl/startup.pl

SetHandler perl-script
PerlHandler Apache::hello


Contents of /home/ravi/www/apache/modperl/startup.pl:
use lib "/home2/apache/www/html/modperl2/book/lincoln";
1;

Script hello.pm located at /home2/apache/www/html/modperl2/book/lincoln/Apache/hello.pm

Contents of hello.pm:
package Apache::hello;

use strict;

use Apache::RequestRec ();
use Apache::RequestIO ();

sub handler {
  my $request = shift;  # what does shift operate on @_?
  $request->content_type('text/html');

  $request->print(<

Hello There


END

return "Apache::OK";
}

1;

Relevant httpd error_log:
[Sun Jun 01 19:04:46 2003] [notice] child pid 2861 exit signal Segmentation fault (11)

Relevant http access_log:
127.0.0.1 - - [01/Jun/2003:19:04:46 -0400] "GET /hello HTTP/1.1" 500 670


I am not sure if the problem is with apache or modperl.
I could not find a core file under httpd ServerRoot.

Natarajan Murugaiyan(Ravi)



__
McAfee VirusScan Online from the Netscape Network.
Comprehensive protection for your entire computer. Get your free trial today!
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397

Get AOL Instant Messenger 5.1 free of charge.  Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455