redirectring webDAV requests

2004-05-05 Thread Info




Hi All,

I have some Apache(2.0)/ mod_perl(2.0)/ perl(5.8)/ webDAV queries

My mod_perl handler redirects DAV requests.
Each user logs on then points their DAV client to /dav/home
>From the login info, the handler translates this to /home/www/userXYZ
and does an internal redirect to it.

1. First step partially works, I can redirect to /testuser/,
which is an Alias defined in httpd.conf as pointing to
/home/www/userXYZ.
Problem: Dav client only sees folders, not files, and the
folders recurse.

2. Second step is more tricky, I cant seem to redirect to a sub-path of
an alias.
I need to do this, cant have one alias per user as there would be
40,000 Aliases!
I have an alias /dav/ which points to /home/www.
But when I try to redirect to /dav/userXYZ the DAV client complains
that 
"Server doesnt support WebDAV at resource /dav/home

Same thing happens when I point DavCli directly at /dav/userXYZ, 
the DAV client complains that "Server doesnt support WebDAV at resource
/dav/userXYZ.
It seems to like Alias's but not their sub-paths.

3. Eventually I want to redirect into another path that the handler
handles,
so that I can reject invalid requests.
This means 2 handlers for the same URI: my .pm and mod_dav. 
How can I "handle" a request then (optionally) pass it on to mod_dav?

Thanks in advance, I'd much appreciate any comments.

Mike Burton






Re: SOAP::Lite dispatching problems

2004-05-05 Thread Issac Goldstand
[snip]

> I believe that
> some patches to SOAP::Lite (specifically, in
> SOAP::Transport::HTTP) are needed to work with mod_perl 2.

[snip]

Has someone prepared patches for mp2 already?  Or are you just saying "it is
something which needs to be done"?


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



PerlTransHandler and 302 'Object Moved' response from web server

2004-05-05 Thread mathieu . millet
Hi everyone,

I have searched through the archive but I haven't a solution to my problem.

I'm using a PerlTransHandler module to reverse proxy a website.

The website itself sets a cookie for tracking its 'own' session and my
module handles it without trouble (well, I think).

On some pages, the website sends a 302 'Object Moved' response and instead
of returning the 302 response to the web browser, Apache/my handler tries to
GET the new Location by itself, without setting the website's cookie. So,
the website losts its session and the user is sent back to the homepage.

My perlTransHandler uses a derivative work from the following code on the
mod_perl tricks page : 
http://perl.apache.org/docs/tutorials/tips/mod_perl_tricks/mod_perl_tricks.h
tml#A_Banner_Ad_Blocker
to handle the request generates by my reverse proxy and the response from
the Web site.

Thanks in advance for any help.

Sincerely yours, Mathieu MILLET.
PS : I have no control over the (reverse)proxied website.

--
Mathieu MILLET
mailto:[EMAIL PROTECTED]
 

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: make test hangs

2004-05-05 Thread William Fulmer


-8<-- Start Bug Report 8<--1. Problem Description:
 
  Following your suggestion I added the signal handler for USR2 and found that any test containing the following line hangs:
 
my $mtime = (stat __FILE__)[9];
 
This same snippet of code works fine in regular perl programs.  I put in a print statement to verify that __FILE__ has the value you would expect (which is does namely the pm for the currently running test).  Any more thoughts?
 
2. Used Components and their Configuration:
 
*** mod_perl version 1.9913
 
*** using lib/Apache/BuildConfig.pm*** Makefile.PL options:  MP_APXS    => /usr/opt/httpd-2.0.49/bin/apxs  MP_COMPAT_1X   => 1  MP_DEBUG   => 1  MP_GENERATE_XS => 1  MP_LIBNAME => mod_perl  MP_TRACE   => 1  MP_USE_DSO => 1  MP_USE_STATIC  => 1
 
*** /usr/opt/httpd-2.0.49/bin/httpd -VServer version: Apache/2.0.49Server built:   Mar 21 2004 11:04:25Server's Module Magic Number: 20020903:7Architecture:   32-bitServer compiled with -D APACHE_MPM_DIR="server/mpm/prefork" -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_USE_SYSVSEM_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D HTTPD_ROOT="/usr/opt/httpd-2.0.49" -D SUEXEC_BIN="/usr/opt/httpd-2.0.49/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/opt/perl-5.6.2/bin/perl -VSummary of my perl5 (revision 5.0 version 6 subversion 2) configuration:  Platform:    osname=hpux, osvers=11.00, archname=PA-RISC2.0    uname='hp-ux cars-l b.11.00 u 9000800 134921527 unlimited-user license '    config_args='-Accflags=+Z -Accflags=-DPERL_POLLUTE -Dprefix=/usr/opt/perl-5.6.2 -Doptimize=-g -Dloclibpth=/usr/opt/perl-5.6.2/lib /lib /usr/lib /usr/ccs/lib /usr/opt/libiconv-1.9.1/lib /usr/opt/readline-4.3/lib /usr/opt/openssl-0.9.7d/lib /usr/opt/ncurses-5.3/lib /usr/opt/gettext-0.12.1/lib /usr/opt/jpeg.v6b/lib /opt/informix/lib /usr/opt/zlib-1.1.4/lib /usr/opt/db-4.1.25/lib /usr/opt/expat-1.95.6/lib /usr/opt/gzip-1.2.4/lib /usr/opt/freetds-0.61/lib /usr/opt/libpng-1.2.5/lib /usr/opt/bzip2-1.0.2/lib /usr/opt/gdbm-1.8.3/lib /usr/opt/freetype-2.1.5/lib /usr/opt/gd-2.0.15/lib /usr/opt/tiff-v3.5.7/lib /opt/default/lib -Dlocincpth=/usr/opt/perl-5.6.2/include /include /usr/include /usr/ccs/include /usr/opt/libiconv-1.9.1/include /usr/opt/readline-4.3/include /usr/opt/openssl-0.9.7d/include /usr/opt/ncurses-5.3/include /usr/opt/gettext-0.12.1/include /usr/opt/jpeg.v6b/include /opt/informix/incl /usr/opt/zlib-1.1.4/include /usr/opt/db-4.1.25/include /usr/opt/expat-1.95.6/include /usr/opt/gzip-1.2.4/include /usr/opt/freetds-0.61/include /usr/opt/libpng-1.2.5/include /usr/opt/bzip2-1.0.2/include /usr/opt/gdbm-1.8.3/include /usr/opt/freetype-2.1.5/include /usr/opt/gd-2.0.15/include /usr/opt/tiff-v3.5.7/include /opt/default/include -Dcc=/opt/ansic/bin/cc -Dlibs=-lnsl -lnm -lndbm -lgdbm -ldb -lmalloc -ldld -lm -lcrypt -lsec -lpthread -lc -lcl -Ubincompat5005 -d -e'    hint=recommended, useposix=true, d_sigaction=define    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef    useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef    use64bitint=undef use64bitall=undef uselongdouble=undef  Compiler:    cc='/opt/ansic/bin/cc', ccflags =' -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings +Z -DPERL_POLLUTE -DDEBUGGING -I/usr/opt/perl-5.6.2/include -I/usr/opt/libiconv-1.9.1/include -I/usr/opt/readline-4.3/include -I/usr/opt/openssl-0.9.7d/include -I/usr/opt/ncurses-5.3/include -I/usr/opt/gettext-0.12.1/include -I/usr/opt/jpeg.v6b/include -I/opt/informix/incl -I/usr/opt/zlib-1.1.4/include -I/usr/opt/db-4.1.25/include -I/usr/opt/expat-1.95.6/include -I/usr/opt/freetds-0.61/include -I/usr/opt/libpng-1.2.5/include -I/usr/opt/bzip2-1.0.2/include -I/usr/opt/gdbm-1.8.3/include -I/usr/opt/freetype-2.1.5/include -I/usr/opt/gd-2.0.15/include -I/usr/opt/tiff-v3.5.7/include -I/opt/default/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 ',    optimize='-g',    cppflags='-Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings +Z -DPERL_POLLUTE -DDEBUGGING -I/usr/opt/perl-5.6.2/include -I/usr/opt/libiconv-1.9.1/include -I/usr/opt/readline-4.3/include -I/usr/opt/openssl-0.9.7d/include -I/usr/opt/ncurses-5.3/include -I/usr/opt/gettext-0.12.1/include -I/usr/opt/jpeg.v6b/include -I/opt/informix/incl -I/usr/opt/zlib-1.1.4/include -I/usr/opt/db-4.1.25/include -I/usr/opt/expat-1.95.6/include -I/usr/opt/freetds-0.61/include -I/usr/opt/libpng-1.2.5/include -I/usr/opt/bzip2-1.0.2/include -I/usr/opt/gdbm-1.8.3/include -I/usr/opt/freetype-2.1.5/include -I/usr/opt/gd-2.0.15/include -I/usr/opt/tiff-v3.5.7/include -I/opt/default/include'    ccversion='A.11.01.25171.GP', gccversion='', gccosandvers=''    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321    d_longlong=defin

Re: SOAP::Lite dispatching problems

2004-05-05 Thread Randy Kobes
On Wed, 5 May 2004, Issac Goldstand wrote:

> [snip]
>
> > I believe that
> > some patches to SOAP::Lite (specifically, in
> > SOAP::Transport::HTTP) are needed to work with mod_perl 2.
>
> [snip]
>
> Has someone prepared patches for mp2 already?  Or are you
> just saying "it is something which needs to be done"?

Patches were supplied for mp2 in a couple of messages in the
soap-lite mailing list archives.

-- 
best regards,
randy


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: mp2 Apache2.0.49 on HPUX11i : mod_perl does not load in Apache

2004-05-05 Thread olivier . blanc







Stas Bekman <[EMAIL PROTECTED]>
04/05/2004 19:25

        
        Pour :        [EMAIL PROTECTED], mod_perl Mailing List <[EMAIL PROTECTED]>
        cc :        
        Objet :        Re: mp2 Apache2.0.49 on HPUX11i : mod_perl does not load in Apache


>>>So you have a bunch of these errors:
>>>/usr/lib/pa20_64/dld.sl: Unsatisfied code symbol 
>> 
>> 'modperl_bucket_sv_create' in
>> 
>>>Is nm(1) working on your platform? If so, please try:
>>>nm /path/to/your/httpd | grep modperl_bucket_sv_create
>> 
>> 
>> It does not find modperl_bucket_sv_create in httpd file.

>Show us the linking output when it creates mod_perl.a. After the build is 
>complete on my machine I'd do:

>% rm src/modules/perl/mod_perl.a

>% make
>cd "src/modules/perl" && make -f Makefile.modperl
>make[1]: Entering directory `/home/stas/apache.org/mp2-xcpt/src/modules/perl'
>rm -f mod_perl.a
>ar crv mod_perl.a mod_perl.o modperl_interp.o modperl_tipool.o modperl_log.o 
>modperl_config.o modperl_cmd.o modperl_options.o modperl_callback.o 
>modperl_handler.o modperl_gtop.o modperl_util.o modperl_io.o 
>modperl_io_apache.o modperl_filter.o modperl_bucket.o modperl_mgv.o 
>modperl_pcw.o modperl_global.o modperl_env.o modperl_cgi.o modperl_perl.o 
>modperl_perl_global.o modperl_perl_pp.o modperl_sys.o modperl_module.o 
>modperl_svptr_table.o modperl_const.o modperl_constants.o 
>modperl_apache_compat.o modperl_error.o modperl_hooks.o modperl_directives.o 
>modperl_flags.o modperl_xsinit.o
...
>So you are after this line:
>a - modperl_bucket.o

Ok it is present

>Checking:

>% nm mod_perl.a | grep modperl_bucket_sv_create
>01e2 T modperl_bucket_sv_create*
Here is the result : 
[37]     |                     0|      92|FUNC |GLOB |0|   .text|modperl_bucket_sv_create

>So as you can see it has this symbol. You can check the original file as well:

>% nm modperl_bucket.o | grep modperl_bucket_sv_create
>01e2 T modperl_bucket_sv_create
Here is the result : 
[37]     |                     0|      92|FUNC |GLOB |0|   .text|modperl_bucket_sv_create

Olivier



Transactions corruption and persistent connections

2004-05-05 Thread Hans Poo R.
Hi all

I'am using mod_perl-1.27, apache 1.3.28, Linux RedHat 9 and postgresql 7.4.2.

I want to know, if it's necessary to rollback database connections on each
request arrive with a PerlInitHandler, when using persistent database connections.

This is the way i'am doing now (rolling back manually) in order to clean the
transaction asociated to the connection, this is for the case where due to an
abnormal situation a transaction get aborted but not rolled back, and some sql
commands get in the middle.

The side effect of this manual rollback is that the error_log get filled with
the message:

Issuing rollback() for database handle being DESTROY'd without explicit
disconnect() 

I think that using this technique i'am losing the gain of persistence, but in
ther other side avoid corruption of transactions.

Finally, i allways use the next settings on DBI: RaiseError = 1 and AutoCommit
= 0. That means i commit manually when transactions are succesfull.


Thanks.
Hans Poo, Chile




-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: mp2 Apache2.0.49 on HPUX11i : mod_perl does not load in Apache

2004-05-05 Thread Stas Bekman
[EMAIL PROTECTED] wrote:
So you are after this line:
a - modperl_bucket.o

Ok it is present

Checking:

% nm mod_perl.a | grep modperl_bucket_sv_create
01e2 T modperl_bucket_sv_create*
Here is the result : 
[37] | 0|  92|FUNC |GLOB |0| 
.text|modperl_bucket_sv_create


So as you can see it has this symbol. You can check the original file as 
well:

% nm modperl_bucket.o | grep modperl_bucket_sv_create
01e2 T modperl_bucket_sv_create
Here is the result : 
[37] | 0|  92|FUNC |GLOB |0| 
.text|modperl_bucket_sv_create
Sorry, I'm not familiar with nm's output on your platform. What does 0 mean? 
That it's unresolved? What do you get for other symbols (just to compare), e.g.

 nm mod_perl.a | grep modperl_callback
__
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
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Transactions corruption and persistent connections

2004-05-05 Thread Perrin Harkins
On Wed, 2004-05-05 at 13:01, Hans Poo R. wrote:
> I want to know, if it's necessary to rollback database connections on each
> request arrive with a PerlInitHandler, when using persistent database connections.

Apache::DBI already does that for you in a cleanup handler.  You are
using Apache::DBI, right?

> The side effect of this manual rollback is that the error_log get filled with
> the message:
> 
> Issuing rollback() for database handle being DESTROY'd without explicit
> disconnect() 

That's not normal.  You shouldn't be getting anything in your error_log
from doing a rollback.  You didn't show your code, so I can't speculate
on what's causing it.

My advice is to remove your code and just let Apache::DBI do it.

- Perrin


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: PerlTransHandler and 302 'Object Moved' response from web server

2004-05-05 Thread Perrin Harkins
On Wed, 2004-05-05 at 06:12, [EMAIL PROTECTED] wrote:
> On some pages, the website sends a 302 'Object Moved' response and instead
> of returning the 302 response to the web browser, Apache/my handler tries to
> GET the new Location by itself, without setting the website's cookie. So,
> the website losts its session and the user is sent back to the homepage.

It sounds like you know what you need to do: send the cookie on to the
other site.  Where are you getting stuck?  Is it just that you don't
know how to stop LWP from handling redirects automatically?  Check the
LWP::UserAgent man page for the simple_request() method.  You can also
give it cookies to send on every request.

- Perrin




-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: make test hangs

2004-05-05 Thread Stas Bekman
William Fulmer wrote:
-8<-- Start Bug Report 8<--
1. Problem Description:
 
  Following your suggestion I added the signal handler for USR2 and
found that any test containing the following line hangs:
 
my $mtime = (stat __FILE__)[9];
 
This same snippet of code works fine in regular perl programs.  I put
in a print statement to verify that __FILE__ has the value you would
expect (which is does namely the pm for the currently running test). 
Any more thoughts?
Excellent. Glad to hear that that technique worked.
That code works fine on linux. So what I'd suggest next is to strace/tusc the 
process, as you did in first place, but this time make sure that you have only 
one process, i.e. start apache with httpd -DONE_PROCESS -DNO_DETATCH.

--
__
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
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: redirectring webDAV requests

2004-05-05 Thread Perrin Harkins
On Wed, 2004-05-05 at 03:35, Info wrote:
> I have an alias /dav/ which points to /home/www.
> But when I try to redirect to /dav/userXYZ the DAV client complains
> that 
> "Server doesnt support WebDAV at resource /dav/home

This doesn't really sound like a mod_perl problem.  Sounds more like a
web dav configuration problem, or a general apache config problem.

> 3. Eventually I want to redirect into another path that the handler
> handles,
> so that I can reject invalid requests.
> This means 2 handlers for the same URI: my .pm and mod_dav. 
> How can I "handle" a request then (optionally) pass it on to mod_dav?

If your handler runs in an earlier phase than mod_dav, it should be no
problem.  Actually, it shouldn't be a problem anyway to have multiple
handlers for the access and auth phases.

- Perrin


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Howto use emacs and perldb to debug mod_perl?

2004-05-05 Thread pdupreez
Hi,

Has anyone succeeded in using the perldb debugger
within emacs in order to debug apps that use
mod_perl?

The following works:
  /usr/sbin/apache-perl -X -D PERLDB
but then I get the command line debugger.

I know that ptkdb and ddd are other (GUI) options,
but I would like to use emacs.

Thanks in advance
--
Pieter

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: Howto use emacs and perldb to debug mod_perl?

2004-05-05 Thread Frank Wiles
On Wed, 5 May 2004 20:40:08 +
[EMAIL PROTECTED] wrote:

> Hi,
> 
> Has anyone succeeded in using the perldb debugger
> within emacs in order to debug apps that use
> mod_perl?
> 
> The following works:
>   /usr/sbin/apache-perl -X -D PERLDB
> but then I get the command line debugger.
> 
> I know that ptkdb and ddd are other (GUI) options,
> but I would like to use emacs.
> 
> Thanks in advance

  Not being an Emacs user, no I haven't tried that.  Doesn't Emacs
  just use the running perl debugger and redisplay it's output? 
  Does it do it by pid?  Do you get some kind of error message from 
  Emacs? 

  I've always just used it in the shell I launched the Apache process
  from. If you get me some more info about the problem you're seeing
  I'll play around with Emacs and see if I can get it to work for you. 

 -
   Frank Wiles <[EMAIL PROTECTED]>
   http://frank.wiles.org
 -


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: make test hangs

2004-05-05 Thread Stas Bekman
William Fulmer wrote:
OK.  I ran "tusc -o strace /usr/opt/httpd-2.0.49/bin/httpd -d t -f
conf/httpd.conf  -DAPACHE2 -DONE_PROCESS -DNO_DETATCH > stdout 2>&1". 
output is attached. 
Ouch, William, are you aware that you've sent a 1MB attachment to a public 
mailing list, potentially causing lots of problems to people with limited 
account sizes and slow dialup access? Please don't that in the future. If you 
want to show some big file, upload it somewhere and post a link to it.

Originally you posted 4 lines where it was hanging, I hoped you will do the 
same this time, but now monitoring the right process. Sorry if I wasn't clear 
and sounded like I want you to send the whole strace.  I hope our subscribers 
will excuse us for this glitch.

> The only thing that stood out for me was mod_perl
> complaining about no -M while running suid and the fact that it couldn't
> find an nls related file "/usr/lib/nls/loc/locales.2/C" which is in fact
> nonexistent.  Could this be an nls related anomaly?  If I remember right
> there are some problems with nls and Solaris 9.
I don't know, I'm not familiar with Solaris. The end of your trace is:
open("/usr/lib/nls/loc/locales.2/C", O_RDONLY, 0) 
.. ERR#2 ENOENT
time(0x7f71cd0c) 
... = 1083792204
sigsetstatemask(0x17, NULL, 2139033120) 
 = 0
write(2, "N o   - M   a l l o w e d   w h ".., 36) 
. = 36
sigsetstatemask(0x17, 0x7f7f0e20, 0) 
... = 0
open("/usr/lib/nls/msg/C/strerror.cat", O_RDONLY, 017) 
. = 22
fstat(22, 0x7f7f2338) 
.. = 0
fcntl(22, F_SETFD, 1) 
.. = 0
lseek(22, 0, SEEK_SET) 
. = 0
read(22, "m s g c a t 0 1 \0\0\0f9\001\001".., 1212) 
... = 1212
lseek(22, 3016, SEEK_SET) 
.. = 3016
read(22, "N o   s u c h   f i l e   o r   ".., 25) 
. = 25
close(22) 
.. = 0
write(2, "p e r l _ p a r s e :   N o   s ".., 38) 
. = 38
getpid() 
... = 
20795 (20794)
unlink("/var/spool/sockets/pwgr/client20795") 
.. = 0
exit(1) 
 
WIFEXITED(1)

but I see that the process is exiting. Is it still hanging? Or is it the 
client process?

I see that you also run with mod_perl tracing enabled, you may want to turn it 
off to make the strace output smaller.

__
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
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Callback called exit.

2004-05-05 Thread Brian Hirt
I've been running across a problem lately where a child process  
terminates because of an out of memory error.   It prints Out of Memory  
once, the the process sucks up all available cpu print "Callback called  
exit." to the log file until it hit's it's 2GB max size.

I have some Apache::Resource limits set, and they probably need to be  
raised, but the way the error is handled is not very graceful.  I'd  
expect the child to just terminate after reporting the first error  
message.   I'm not sure if this is a perl problem or a mod_perl  
problem.   I'd still like to figure out how to prevent the repeating  
message from happening.

Anyway, I've been pulling my hair out trying to prevent this, and I've  
finally figured out how to trap this.   I have some suggestions for the  
documentation, because the following url could use some help:

http://perl.apache.org/docs/1.0/guide/ 
troubleshooting.html#Callback_called_exit

=> "Note that Perl 5.005 and later have PERL_EMERGENCY_SBRK turned on  
by default."

This is only true if perl was built to use it's own malloc.   However,  
"usemymalloc=y" is not the default for many systems because they assume  
the OS version is probably a better implementation (which could be  
true).  However, when perl's internal malloc is used, none of the  
suggestions for solving the out of memory problem or repeated Callback  
called exit messages work.

=> "See Perl's INSTALL document for this item:"
This might have been true at one point.   Newer versions of perl 5.6  
and 5.8 have no reference to this option in the INSTALL document

=>  "=item -DPERL_EMERGENCY_SBRK . "
a better quotation would be from perlvar.pod which states the crux of  
the matter: " . Suppose that your Perl were compiled with  
-DPERL_EMERGENCY_SBRK and used Perl's malloc ..."


--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: make test hangs

2004-05-05 Thread William Fulmer
> Ouch, William, are you aware that you've sent a 1MB attachment to 
> a public mailing list, potentially causing lots of problems to people
> with limited account sizes and slow dialup access? Please don't that 
> in the future. If you want to show some big file, upload it 
> somewhere and post a link to it.

Sorry.  I didn't look at the size before I sent it.  Will be more
carefull in the future.  

> > The only thing that stood out for me was mod_perl
> > complaining about no -M while running suid and the fact that it
couldn't
> > find an nls related file "/usr/lib/nls/loc/locales.2/C" which is in
fact
> > nonexistent.  Could this be an nls related anomaly?  If I remember
right
> > there are some problems with nls and Solaris 9.

> I don't know, I'm not familiar with Solaris. The end of your trace is:

open("/usr/lib/nls/loc/locales.2/C", O_RDONLY, 0) 
.. ERR#2 ENOENT
time(0x7f71cd0c) 
... =
1083792204
sigsetstatemask(0x17, NULL, 2139033120) 
 = 0
write(2, "N o   - M   a l l o w e d   w h ".., 36) 
. = 36
sigsetstatemask(0x17, 0x7f7f0e20, 0) 
... = 0
open("/usr/lib/nls/msg/C/strerror.cat", O_RDONLY, 017) 
. = 22
fstat(22, 0x7f7f2338) 
.. = 0
fcntl(22, F_SETFD, 1) 
.. = 0
lseek(22, 0, SEEK_SET) 
. = 0
read(22, "m s g c a t 0 1 \0\0\0f9\001\001".., 1212) 
... = 1212
lseek(22, 3016, SEEK_SET) 
.. = 3016
read(22, "N o   s u c h   f i l e   o r   ".., 25) 
. = 25
close(22) 
..
= 0
write(2, "p e r l _ p a r s e :   N o   s ".., 38) 
. = 38
getpid() 
...
= 
20795 (20794)
unlink("/var/spool/sockets/pwgr/client20795") 
.. = 0
exit(1) 


WIFEXITED(1)

> but I see that the process is exiting. Is it still hanging? Or is it
the 
> client process?

Yes it did exit when I ran it this way.  May be a fluke with my compile
of tusc however.  When I run it without the tusc comand (ie
"/usr/opt/httpd-2.0.49/bin/httpd -d t -f conf/httpd.conf  -DAPACHE2
-DONE_PROCESS -DNO_DETATCH") it hangs.  Helpful of it, yes?

>I see that you also run with mod_perl tracing enabled, you may want 
> to turn it off to make the strace output smaller.

I'll do that in the morning.  It may help for me to mention that I'm
using HP's ANSI C compiler for the compiles.  The version is quite old
(enough so that I cannot apply the patches listed on the troubleshooting
web page).  May be a useful exercise to update my compiler and try
again.  May take a while as I have to Weedle "CODEWORDS" out of HP
support to accomplish this.  Let me also say that I was able to compile
and run mod_perl-1.99_12 with this same install of apache and an install
of perl 5.8.2 with the same basic config options as my perl 5.6.2.  I
think I'll try compiling this version with the 5.8.2 perl and see if
that works better. 

__
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

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



---
Will Fulmer
Database Administrator
Northampton Community College
Bethlehem, PA

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: make test hangs

2004-05-05 Thread Stas Bekman
William Fulmer wrote:
Ouch, William, are you aware that you've sent a 1MB attachment to 
a public mailing list, potentially causing lots of problems to people
with limited account sizes and slow dialup access? Please don't that 
in the future. If you want to show some big file, upload it 
somewhere and post a link to it.

Sorry.  I didn't look at the size before I sent it.  Will be more
carefull in the future.  
Cool!
The end of your trace is:
open("/usr/lib/nls/loc/locales.2/C", O_RDONLY, 0) 
.. ERR#2 ENOENT
time(0x7f71cd0c) 
... =
1083792204
sigsetstatemask(0x17, NULL, 2139033120) 
 = 0
write(2, "N o   - M   a l l o w e d   w h ".., 36) 
Aha! It says -M is not allowed. (stat __FILE__)[9]; is the same as
  -M __FILE__
write(2, "p e r l _ p a r s e :   N o   s ".., 38) 
this perl_parse() thing is interesting. It writes to STDERR that perl_parse() 
has failed. BTW, any difference if you change your code to be:

my $file = "/tmp";
my $mtime = (stat $file)[9];
and:
my $file = __FILE__;
my $mtime = (stat $file)[9];
and:
-M __FILE__;
and
-M "/tmp";


but I see that the process is exiting. Is it still hanging? Or is it
the 

client process?

Yes it did exit when I ran it this way.  May be a fluke with my compile
of tusc however.  When I run it without the tusc comand (ie
"/usr/opt/httpd-2.0.49/bin/httpd -d t -f conf/httpd.conf  -DAPACHE2
-DONE_PROCESS -DNO_DETATCH") it hangs.  Helpful of it, yes?
It's possible. I've seen processes exiting when attaching to or detaching from 
them with strace. another way to check where the process is hanging is to 
attach to it with gdb (using -p $pid) and then run 'bt'.

I see that you also run with mod_perl tracing enabled, you may want 
to turn it off to make the strace output smaller.

I'll do that in the morning.  It may help for me to mention that I'm
using HP's ANSI C compiler for the compiles.  The version is quite old
(enough so that I cannot apply the patches listed on the troubleshooting
web page).  May be a useful exercise to update my compiler and try
again.  May take a while as I have to Weedle "CODEWORDS" out of HP
support to accomplish this.  Let me also say that I was able to compile
and run mod_perl-1.99_12 with this same install of apache and an install
of perl 5.8.2 with the same basic config options as my perl 5.6.2.  I
think I'll try compiling this version with the 5.8.2 perl and see if
that works better. 
What's important is that you compile perl, apache and mod_perl with the same 
compiler. Though I'm not familiar with HP's ANSI C compiler, so it's possible 
that it's a problem there.

__
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
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html