Apache::Request coredumps on FreeBSD
Hi, I am using FreeBSD 4.4. My newly build httpd coredumps when I load Apache::Request. Any clues would be most appreciated. bt, build parameters for perl, apache and mod_perl and perl -V output below. - ask $ gdb /home/perl/apache/bin/httpd (gdb) run -X [...] 0x282f8f13 in boot_Apache__Request () from /home/perl/lib/site_perl/5.6.1/i386-freebsd/auto/Apache/Request/Request.so (gdb) bt #0 0x282f8f13 in boot_Apache__Request () from /home/perl/lib/site_perl/5.6.1/i386-freebsd/auto/Apache/Request/Request.so #1 0x2826de93 in Perl_pp_entersub () from /home/allbooks/apache/libexec/libperl.so #2 0x282687be in Perl_runops_standard () from /home/allbooks/apache/libexec/libperl.so #3 0x2822ba0a in S_call_body () from /home/allbooks/apache/libexec/libperl.so #4 0x2822bb46 in perl_eval_sv () from /home/allbooks/apache/libexec/libperl.so #5 0x2821337d in perl_require_module () from /home/allbooks/apache/libexec/libperl.so #6 0x2820ecb8 in perl_cmd_module () from /home/allbooks/apache/libexec/libperl.so #7 0x8054433 in invoke_cmd () #8 0x805489d in ap_handle_command () #9 0x805493b in ap_srm_command_loop () #10 0x8054fef in ap_process_resource_config () #11 0x8055930 in ap_read_config () #12 0x805ff29 in main () #13 0x804e251 in _start () I build my perl, apache and mod_perl like the following and then installed libapreq 0.33 with ~perl/bin/perl Makefile.PL make make install. #!/bin/sh cd src PERL_VERSION=5.6.1 curl -z perl-$PERL_VERSION.tar.gz -O ftp://ftp.perl.org/pub/CPAN/src/perl-$PERL_VERSION.tar.gz \ tar xzf perl-$PERL_VERSION.tar.gz cd perl-$PERL_VERSION \ ./Configure -Dprefix=/home/perl -Uuselargefiles -des \ make -j5 \ make test \ make install ... #!/bin/sh APACHE_VERSION=1.3.20 MODPERL_VERSION=1.26 cd src curl -z apache_$APACHE_VERSION.tar.gz -O http://www.apache.org/dist/httpd/apache_$APACHE_VERSION.tar.gz \ curl -z mod_perl-$MODPERL_VERSION.tar.gz -O http://www.apache.org/dist/perl/mod_perl-$MODPERL_VERSION.tar.gz \ tar xzf apache_$APACHE_VERSION.tar.gz \ tar xzf mod_perl-$MODPERL_VERSION.tar.gz \ \ cd ~/src/apache_$APACHE_VERSION \ \ ./configure --prefix=/home/perl/apache --enable-shared=max \ --enable-module=all --disable-rule=EXPAT \ --with-perl=/home/perl/bin/perl \ \ make -j4 make install \ \ cd ~/src/mod_perl-$MODPERL_VERSION \ ~/bin/perl Makefile.PL \ APACHE_SRC=/home/perl/src/apache_$APACHE_VERSION/src/ \ USE_APXS=1 \ WITH_APXS=/home/perl/apache/bin/apxs \ EVERYTHING=1 \ make make test make install \ cd ~/src \ curl -O http://develooper.com/code/mpaf/mod_proxy_add_forward.c \ ../apache/bin/apxs -i -c mod_proxy_add_forward.c $ /home/perl/bin/perl -V Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration: Platform: osname=freebsd, osvers=4.4-rc, archname=i386-freebsd uname='freebsd miette.develooper.com 4.4-rc freebsd 4.4-rc #5: wed sep 12 03:15:29 pdt 2001 [EMAIL PROTECTED]:homeusrobjusrsrcsysmiette i386 ' config_args='-Dprefix=/home/perl -Uuselargefiles -des' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=undef usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include', optimize='-O', cppflags='-fno-strict-aliasing -I/usr/local/include' ccversion='', gccversion='2.95.3 20010315 (release) [FreeBSD]', 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, usemymalloc=n, prototype=define Linker and Libraries: ld='cc', ldflags ='-Wl,-E -L/usr/local/lib' libpth=/usr/lib /usr/local/lib libs=-lgdbm -ldb -lm -lc -lcrypt -liconv -lutil perllibs=-lm -lc -lcrypt -liconv -lutil libc=, so=so, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' ' cccdlflags='-DPIC -fpic', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: Built under freebsd Compiled at Oct 6 2001 03:42:33 @INC: /home/perl/lib/5.6.1/i386-freebsd /home/perl/lib/5.6.1 /home/perl/lib/site_perl/5.6.1/i386-freebsd /home/perl/lib/site_perl/5.6.1 /home/perl/lib/site_perl . -- ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
how to catch a killed task?
hi... i use BSD::Resource to limit the ressources of the apache tasks. this works fine but now i want to clean up afterwards but i don't know how to catch a killed task... here is what i tried with signals: my entries in httpd.conf: PerlModule Apache::Resource PerlSetEnv PERL_RLIMIT_CPU 120:150 PerlSetEnv PERL_RLIMIT_AS 3000:3500 PerlChildInitHandler Apache::Resource and this is how i tried to catch the signals: sub cleanup { die cleanup called...; } $SIG{XFSZ} = \cleanup; i use linux, thus i have to use RLIMIT_AS and so maybe XFSZ is the wrong signal for the RAM limit. which do i have to use then? but i tried $SIG{XCPU} but it doesnt work as well. it just killed the task at soft limit without calling cleanup. what is wrong? or is there another possibility for cleaning up? probably there is a handler i can use which will be called when a program is finished, if so, how can i check if the program has ended as it shoulds or if it was killed by BSD::resource ? thanx in advance! best regards, christoph bergmann
piece of code in mod_perl guide
hello, I am reading mod_perl guide and i had a problem with a piece of code in chapter 9.7.4.2 about reloading configuration files. this is version jan 2001 but i have checked in the last one the piece of code is the same. when running the code exactly, things don't work, even outside mod_perl environnment. the sub below print file is different even though I don't change the file. I have located that if i change$MODIFIED{$file} = -M _; to an explicit$MODIFIED{$file} = -M $file; in the last line, everything works fine. since i do no test on any other file and I have understood that _ account s for the last file tested, I don't understand why it does work. I am on NT4 perl 5.6.1 try it yourself ! so strange ! thanks for any explanation * for (1..10){ reread_conf("l:/asperl/site/lib/afpa/evolif/config.pm"); sleep 2; } our %MODIFIED; sub reread_conf{ my $file=shift; return unless $file; return unless -e $file and -r _; if ($MODIFIED{$file} and $MODIFIED{$file}== -M _){ print "same" ; }else {print "different";} print "\n"; unless ($MODIFIED{$file} and $MODIFIED{$file}== -M _){ unless (my $result = do $file) { warn ... } print "\nmod:",$MODIFIED{$file},' :', -M _,"\n"; $MODIFIED{$file} = -M _; } }
cvs commit: modperl-2.0/src/modules/perl mod_perl.c modperl_cmd.c modperl_cmd.h
dougm 01/10/06 12:43:40 Modified:src/modules/perl mod_perl.c modperl_cmd.c modperl_cmd.h Log: implement PerlInitHandler Revision ChangesPath 1.86 +1 -0 modperl-2.0/src/modules/perl/mod_perl.c Index: mod_perl.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v retrieving revision 1.85 retrieving revision 1.86 diff -u -r1.85 -r1.86 --- mod_perl.c2001/09/28 19:51:40 1.85 +++ mod_perl.c2001/10/06 19:43:40 1.86 @@ -415,6 +415,7 @@ MP_CMD_SRV_ITERATE(PerlModule, modules, PerlModule), MP_CMD_SRV_ITERATE(PerlRequire, requires, PerlRequire), MP_CMD_DIR_ITERATE(PerlOptions, options, Perl Options), +MP_CMD_DIR_ITERATE(PerlInitHandler, init_handlers, Subroutine name), MP_CMD_DIR_TAKE2(PerlSetVar, set_var, PerlSetVar), MP_CMD_DIR_ITERATE2(PerlAddVar, add_var, PerlAddVar), #ifdef MP_TRACE 1.13 +8 -0 modperl-2.0/src/modules/perl/modperl_cmd.c Index: modperl_cmd.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cmd.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- modperl_cmd.c 2001/09/28 19:51:40 1.12 +++ modperl_cmd.c 2001/10/06 19:43:40 1.13 @@ -116,6 +116,14 @@ return NULL; } +MP_CMD_SRV_DECLARE(init_handlers) +{ +if (parms-path) { +return modperl_cmd_header_parser_handlers(parms, mconfig, arg); +} + +return modperl_cmd_post_read_request_handlers(parms, mconfig, arg); +} #ifdef MP_COMPAT_1X 1.15 +1 -0 modperl-2.0/src/modules/perl/modperl_cmd.h Index: modperl_cmd.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cmd.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- modperl_cmd.h 2001/09/28 19:51:40 1.14 +++ modperl_cmd.h 2001/10/06 19:43:40 1.15 @@ -23,6 +23,7 @@ MP_CMD_SRV_DECLARE2(set_var); MP_CMD_SRV_DECLARE2(add_var); MP_CMD_SRV_DECLARE(options); +MP_CMD_SRV_DECLARE(init_handlers); #ifdef MP_COMPAT_1X
cvs commit: modperl-2.0/t/hooks/TestHooks init.pm
dougm 01/10/06 12:44:30 Modified:t/hooks .cvsignore Added: t/hooks/TestHooks init.pm Log: add PerlInitHandler test Revision ChangesPath 1.3 +1 -0 modperl-2.0/t/hooks/.cvsignore Index: .cvsignore === RCS file: /home/cvs/modperl-2.0/t/hooks/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- .cvsignore2001/09/28 15:21:15 1.2 +++ .cvsignore2001/10/06 19:44:30 1.3 @@ -4,3 +4,4 @@ authz.t fixup.t trans.t +init.t 1.1 modperl-2.0/t/hooks/TestHooks/init.pm Index: init.pm === package TestHooks::init; use strict; use warnings FATAL = 'all'; use Apache::Test; sub first { my $r = shift; $r-notes-set(ok1 = 1); Apache::OK; } sub second { my $r = shift; my $ok = $r-notes-get('ok1') || 0; $r-notes-set(ok2 = $ok + 1); Apache::OK; } sub handler { my $r = shift; my $ok = $r-notes-get('ok2') || 0; $r-notes-set(ok3 = $ok + 1); Apache::OK; } sub response { my $r = shift; my $tests = 3; plan $r, tests = $tests; for my $x (1..$tests) { my $val = $r-notes-get(ok$x) || 0; ok $val == $x; } Apache::OK; } 1; __DATA__ PerlInitHandler TestHooks::init::second Base PerlInitHandler TestHooks::init::first /Base PerlResponseHandler TestHooks::init::response SetHandler modperl
cvs commit: modperl-2.0/src/modules/perl modperl_util.c modperl_util.h
dougm 01/10/06 16:27:35 Modified:src/modules/perl modperl_util.c modperl_util.h Log: add modperl_perl_av_push_elts_ref() function Revision ChangesPath 1.21 +12 -0 modperl-2.0/src/modules/perl/modperl_util.c Index: modperl_util.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- modperl_util.c2001/10/06 01:03:27 1.20 +++ modperl_util.c2001/10/06 23:27:35 1.21 @@ -387,6 +387,18 @@ return NULL; } +MP_INLINE void modperl_perl_av_push_elts_ref(pTHX_ AV *dst, AV *src) +{ +I32 i, j, src_fill = AvFILLp(src), dst_fill = AvFILLp(dst); + +av_extend(dst, src_fill); +AvFILLp(dst) += src_fill+1; + +for (i=dst_fill+1, j=0; j=AvFILLp(src); i++, j++) { +AvARRAY(dst)[i] = SvREFCNT_inc(AvARRAY(src)[j]); +} +} + MP_INLINE SV *modperl_dir_config(pTHX_ request_rec *r, server_rec *s, char *key, SV *sv_val) 1.21 +2 -0 modperl-2.0/src/modules/perl/modperl_util.h Index: modperl_util.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- modperl_util.h2001/10/06 01:03:27 1.20 +++ modperl_util.h2001/10/06 23:27:35 1.21 @@ -66,6 +66,8 @@ MP_INLINE void *modperl_hash_tied_object(pTHX_ const char *classname, SV *tsv); +MP_INLINE void modperl_perl_av_push_elts_ref(pTHX_ AV *dst, AV *src); + MP_INLINE SV *modperl_dir_config(pTHX_ request_rec *r, server_rec *s, char *key, SV *sv_val);
Re: perl.apache.org / apache.perl.org
brian moseley wrote: On Sun, 7 Oct 2001, Stas Bekman wrote: We have had two new designs worked out long time ago, but one has been picked by take23.org and the other wasn't applied. (hi brian) :( sorry! i have this tendency to bite off more than i can chew. i have 10 projects and none of them will ever be finished. that's ok... we are all in the same boat :) What I want to say, is that it's not a point of where to host the site. The point is that we need someone to do the job of re-doing and making it easy to maintain the site, to keep it nice. jim's design is still available if somebody wants to use it. can you please post the URL again? thanks! _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://ticketmaster.com http://apacheweek.com http://singlesheaven.com http://perl.apache.org http://perlmonth.com/