embperl

2001-09-07 Thread Diego V



Hi there,

Just wanted to ask to any embperl user, is there any real advantage
about using embperl instead of PHP ?


Thank you

Diego Ventrice

_
Descargue GRATUITAMENTE MSN Explorer en http://explorer.msn.es/intl.asp




Re: embperl

2001-09-07 Thread iain truskett

* Diego V ([EMAIL PROTECTED]) [07 Sep 2001 06:59]:

[...]
 Just wanted to ask to any embperl user, is there any real advantage
 about using embperl instead of PHP ?

You get the advantage of using Perl rather than PHP.

This includes the vast resources of CPAN.

Personally, I recommend Mason http://www.masonhq.com/ over Embperl
simply because I prefer the way it integrates into HTML.

Investigate both =)

I've done reasonably sized projects with both and find Mason cleaner
(mostly in its handling of scope and the way it doesn't use all those [-
[+ [# [$ [* etc. tags and instead just has %, %init and other wordy
ones: easier to remember =). )


cheers,
-- 
iain.  http://eh.org/~koschei/
The only disadvantage I see is that it would force everyone to get
 Perl. Horrors. :-) --Larry Wall in [EMAIL PROTECTED]



Re: memory leaking with closures

2001-09-07 Thread Alex Krohn

Hi,

  With this simple test script:
 
  print Content-type: text/html\n\n;
  my $var = 'x' x 50;
 
  our $var = 'x' x 50;
 
 
  my $sub = sub { my $sub2 = sub { $var; }; };
  print Done\n;
 
  $var does not get freed, and the process grows each request. Has anyone
  seen this sort of behavior and have any ideas/workarounds (besides don't
 
  yes.  this is the documented behavior for closures.  the anonymous sub
  must have it's own copy of $var which happens to be 500k plus perl
  overhead on each invocation.
 
 I think the problem is that $var doesn't get freed even when $var and
 $sub and $sub2 have all gone out of scope.  That's a perl bug for which I
 can fathom no workaround.
 
 If any of those variables are still in scope, then of course $var can't
 get freed.

Yes, upon further investigation, this perl script:

while (1) {
{
my $var = 'x' x 50;
my $sub = sub { my $sub2 = sub { $var; } };
}
# $var and $sub should be gone, but memory is never freed
sleep 1; # Don't crash things =)
}

will grow forever as $var never seems to be freed even when everything
should go out of scope, definately a perl bug, not a mod_perl one. =)
Oddly, if you just do 

my $sub = sub { $var; };

it does not grow, definately something strange going on. Happens on
perl 5.004_04, 5.005_03 and 5.6.1. 

Cheers,

Alex



Re: embperl

2001-09-07 Thread Jim Cox



This will sould like sour grapes,. But!

Since PHP module compiles,... and Mod_Perl will not on AIX with 
gcc compiler

I'm thinkin' PHP is getting better and better all the time.

iain truskett wrote:
 
 * Diego V ([EMAIL PROTECTED]) [07 Sep 2001 06:59]:
 
 [...]
  Just wanted to ask to any embperl user, is there any real advantage
  about using embperl instead of PHP ?
 
 You get the advantage of using Perl rather than PHP.
 
 This includes the vast resources of CPAN.
 
 Personally, I recommend Mason http://www.masonhq.com/ over Embperl
 simply because I prefer the way it integrates into HTML.
 
 Investigate both =)
 
 I've done reasonably sized projects with both and find Mason cleaner
 (mostly in its handling of scope and the way it doesn't use all those [-
 [+ [# [$ [* etc. tags and instead just has %, %init and other wordy
 ones: easier to remember =). )
 
 cheers,
 --
 iain.  http://eh.org/~koschei/
 The only disadvantage I see is that it would force everyone to get
  Perl. Horrors. :-) --Larry Wall in [EMAIL PROTECTED]

-- 
Jim Cox (mailto:[EMAIL PROTECTED]) 
(817) 315-8134   (888) 834-7656 Toll Free
(817) 315-8253 FAX
(817) 233-8567 Mobile



Re: embperl

2001-09-07 Thread iain truskett

* Jim Cox ([EMAIL PROTECTED]) [07 Sep 2001 08:03]:

 This will sould like sour grapes,. But!

 Since PHP module compiles,... and Mod_Perl will not on AIX with gcc
 compiler

 I'm thinkin' PHP is getting better and better all the time.

It's all a case of use what works =)

There's something peculiar with one of my Apaches in that it refuses to
use DSOs. And I've got mod_perl happily compiled into it.

On my home site, the admin of the machine has PHP installed but not
mod_perl.

At work, I haven't been able to convince the sysadmin to install either.
And if I do, he's more likely to go for PHP since it's less likely to
require many configuration changes. mod_perl can attach modules to any
part of a request/response phase and thus can be configured somewhat
complexly.

PHP is just a content handler, right?

mod_perl is an everything handler: content, headers, logging, URI
translation, etc. etc. It's more powerful. As far as I know, there's
nothing PHP can do that mod_perl can't.

Well, apart from compile on AIX with gcc =)


cheers,
-- 
iain.  http://eh.org/~koschei/



Re: embperl

2001-09-07 Thread Jens-Uwe Mager

On Mon, May 07, 2001 at 02:44:13AM -0500, Jim Cox wrote:
 
 
 This will sould like sour grapes,. But!
 
 Since PHP module compiles,... and Mod_Perl will not on AIX with 
 gcc compiler

As far as I have heard mod_perl will compile using gcc, only you must
first compile your perl with gcc. As mod_perl picks up the compiler
settings from the perl installation you must first compile perl with the
proper compiler. But IBM does ship perl compiled using their compiler,
so if you are lazy and do not recompile perl you are hosed.

-- 
Jens-Uwe Mager

HELIOS Software GmbH
Steinriede 3
30827 Garbsen
Germany

Phone:  +49 5131 709320
FAX:+49 5131 709325
Internet:   [EMAIL PROTECTED]



Re: embperl

2001-09-07 Thread Jim Cox


Well,... Now that makes some sense. I'll try that.


Thanks.

Jens-Uwe Mager wrote:
 
 On Mon, May 07, 2001 at 02:44:13AM -0500, Jim Cox wrote:
 
 
  This will sould like sour grapes,. But!
 
  Since PHP module compiles,... and Mod_Perl will not on AIX with
  gcc compiler
 
 As far as I have heard mod_perl will compile using gcc, only you must
 first compile your perl with gcc. As mod_perl picks up the compiler
 settings from the perl installation you must first compile perl with the
 proper compiler. But IBM does ship perl compiled using their compiler,
 so if you are lazy and do not recompile perl you are hosed.

I'm not the lazy type, just did not realize that.  I'm not using
the IBM perl distribution and I thought it was compiled with gcc,... but
I will check that.

 
 --
 Jens-Uwe Mager
 
 HELIOS Software GmbH
 Steinriede 3
 30827 Garbsen
 Germany
 
 Phone:  +49 5131 709320
 FAX:+49 5131 709325
 Internet:   [EMAIL PROTECTED]

-- 
Jim Cox (mailto:[EMAIL PROTECTED]) 
(817) 315-8134   (888) 834-7656 Toll Free
(817) 315-8253 FAX
(817) 233-8567 Mobile



Re: memory leaking with closures

2001-09-07 Thread Stas Bekman

On Fri, 7 Sep 2001, Alex Krohn wrote:

 Hi,

   With this simple test script:
  
   print Content-type: text/html\n\n;
   my $var = 'x' x 50;
  
   our $var = 'x' x 50;
  
  
   my $sub = sub { my $sub2 = sub { $var; }; };
   print Done\n;
  
   $var does not get freed, and the process grows each request. Has anyone
   seen this sort of behavior and have any ideas/workarounds (besides don't
  
   yes.  this is the documented behavior for closures.  the anonymous sub
   must have it's own copy of $var which happens to be 500k plus perl
   overhead on each invocation.
 
  I think the problem is that $var doesn't get freed even when $var and
  $sub and $sub2 have all gone out of scope.  That's a perl bug for which I
  can fathom no workaround.
 
  If any of those variables are still in scope, then of course $var can't
  get freed.

 Yes, upon further investigation, this perl script:

 while (1) {
   {
   my $var = 'x' x 50;
   my $sub = sub { my $sub2 = sub { $var; } };
   }
   # $var and $sub should be gone, but memory is never freed
   sleep 1; # Don't crash things =)
 }

 will grow forever as $var never seems to be freed even when everything
 should go out of scope, definately a perl bug, not a mod_perl one. =)

Look like memory leaking to me. The reference count is done incorrectly,
which leads to memory leaking:

use GTop;
use Devel::Peek;
my $gtop = GTop-new;

for (1..3) {
my $a = 'x' x 50;
{
sub { $a; };
}
printf RERCNT %s: \$a=%d\n,
GTop::size_string($gtop-proc_mem($$)-rss),
Devel::Peek::SvREFCNT($a);
}

prints:

RERCNT  3.5M: $a=1
RERCNT  3.5M: $a=1
RERCNT  3.5M: $a=1

all fine!

use GTop;
use Devel::Peek;
my $gtop = GTop-new;

for (1..3) {
my $a = 'x' x 50;
{
sub { my $sub2 = sub { $a; }; };
}
printf RERCNT %s: \$a=%d\n,
GTop::size_string($gtop-proc_mem($$)-rss),
Devel::Peek::SvREFCNT($a);
}

prints:

RERCNT  3.5M: $a=4
RERCNT  4.0M: $a=3
RERCNT  4.5M: $a=3

1. the reference counting is wrong
2. memory leaks (because of 1)

This is a hack to fix the leaking (well, almost):

use GTop;
use Devel::Peek;
my $gtop = GTop-new;

for (1..3) {
my $a = 'x' x 50;
{
sub { my $sub2 = sub { $a; }; };
Devel::Peek::SvREFCNT_dec($a);
Devel::Peek::SvREFCNT_dec($a);
}
printf RERCNT %s: \$a=%d\n,
GTop::size_string($gtop-proc_mem($$)-rss),
Devel::Peek::SvREFCNT($a);
}

prints:

RERCNT  3.5M: $a=2
RERCNT  4.0M: $a=1
RERCNT  4.0M: $a=1


 Oddly, if you just do

   my $sub = sub { $var; };

 it does not grow, definately something strange going on. Happens on
 perl 5.004_04, 5.005_03 and 5.6.1.

You mean this works for you?:

while (1) {
   {
   my $var = 'x' x 50;
   my $sub = sub { $var; };
   }
   # $var and $sub should be gone, but memory is never freed
   sleep 1; # Don't crash things =)
}

that's because your $sub goes out of scope. the other one seems like a
bug.

If I didn't miss something, it seems that we need to run this through p5p.

_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/







tracing memory problem

2001-09-07 Thread Jon Molin

Hi list,

I have a memory leak in a script or module, the problem is that i've
resently added many scripts and modules and can't easily isolate the
problem. Is there a way besides strace to see what the httpd process is
up to?
 9869 httpd  0   0 21188  19M  2424 S   0 12.2  3.8   0:13 httpd
doesn't help me too much...

/Jon



Re: tracing memory problem

2001-09-07 Thread Stas Bekman

On Fri, 7 Sep 2001, Jon Molin wrote:

 Hi list,

 I have a memory leak in a script or module, the problem is that i've
 resently added many scripts and modules and can't easily isolate the
 problem. Is there a way besides strace to see what the httpd process is
 up to?
  9869 httpd  0   0 21188  19M  2424 S   0 12.2  3.8   0:13 httpd
 doesn't help me too much...

Please explain what do you mean by 'what the httpd process is up to'?

It's not an easy task to find the offending code that causes memory leaks.
Using GTop.pm for easier memory debugging printing helps a lot,
Devel::Peek is useful too, try also Devel::Leak and their Apache::
friends: Apache::Peek and Apache::Leak. You can find some notes on using
these in the mod_perl guide. Apache::VMonitor can be very useful too.

Otherwise you will probably have to play the halving game: remove half of
your modules/scripts and test. If nothing comes up return a half  of the
removed half, and so on. It's not always working like that, since some
code may leak when it interacts with some specific code.

In the meantime, use Apache::SizeLimit to prevent the processes from
growing. See the guide or the manpage for the details.

_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/





Re: tracing memory problem

2001-09-07 Thread Jon Molin

Stas Bekman wrote:
 
 On Fri, 7 Sep 2001, Jon Molin wrote:
 
  Hi list,
 
  I have a memory leak in a script or module, the problem is that i've
  resently added many scripts and modules and can't easily isolate the
  problem. Is there a way besides strace to see what the httpd process is
  up to?
   9869 httpd  0   0 21188  19M  2424 S   0 12.2  3.8   0:13 httpd
  doesn't help me too much...
 
 Please explain what do you mean by 'what the httpd process is up to'?
 

sorry, what i meant was what script was accessed by the httpd process.
That's the first problem, locating what set of scripts(modules) it can
be and after that start looking...


 It's not an easy task to find the offending code that causes memory leaks.
 Using GTop.pm for easier memory debugging printing helps a lot,
 Devel::Peek is useful too, try also Devel::Leak and their Apache::
 friends: Apache::Peek and Apache::Leak. You can find some notes on using
 these in the mod_perl guide. Apache::VMonitor can be very useful too.
 
 Otherwise you will probably have to play the halving game: remove half of
 your modules/scripts and test. If nothing comes up return a half  of the
 removed half, and so on. It's not always working like that, since some
 code may leak when it interacts with some specific code.
 
 In the meantime, use Apache::SizeLimit to prevent the processes from
 growing. See the guide or the manpage for the details.

ok, i'll look into that. I've been using RLimitMEM and RLimitCPU in
httpd.conf:
RLimitMEM 15728640  15728640 
RLimitCPU 600   600
and haven't got them to work very good:
10314 httpd 13   0 67824  66M  5572 R   0 17.9 13.1   4:19 httpd
10313 httpd 13   0 69984  68M  5580 R   0 17.7 13.5   4:33 httpd

but i guess that's fairly OT on the mod_perl list. 

Thanks for the quick reply!
/Jon

 _
 Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
 http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
 mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
 http://singlesheaven.com http://perl.apache.org http://perlmonth.com/



Re: tracing memory problem

2001-09-07 Thread Stas Bekman

On Fri, 7 Sep 2001, Jon Molin wrote:

 Stas Bekman wrote:
 
  On Fri, 7 Sep 2001, Jon Molin wrote:
 
   Hi list,
  
   I have a memory leak in a script or module, the problem is that i've
   resently added many scripts and modules and can't easily isolate the
   problem. Is there a way besides strace to see what the httpd process is
   up to?
9869 httpd  0   0 21188  19M  2424 S   0 12.2  3.8   0:13 httpd
   doesn't help me too much...
 
  Please explain what do you mean by 'what the httpd process is up to'?
 

 sorry, what i meant was what script was accessed by the httpd process.
 That's the first problem, locating what set of scripts(modules) it can
 be and after that start looking...

you can use Apache::VMonitor or a trick with SIGUSR2
http://perl.apache.org/guide/debug.html#Using_the_Perl_Trace

  It's not an easy task to find the offending code that causes memory leaks.
  Using GTop.pm for easier memory debugging printing helps a lot,
  Devel::Peek is useful too, try also Devel::Leak and their Apache::
  friends: Apache::Peek and Apache::Leak. You can find some notes on using
  these in the mod_perl guide. Apache::VMonitor can be very useful too.
 
  Otherwise you will probably have to play the halving game: remove half of
  your modules/scripts and test. If nothing comes up return a half  of the
  removed half, and so on. It's not always working like that, since some
  code may leak when it interacts with some specific code.
 
  In the meantime, use Apache::SizeLimit to prevent the processes from
  growing. See the guide or the manpage for the details.

 ok, i'll look into that. I've been using RLimitMEM and RLimitCPU in
 httpd.conf:
 RLimitMEM 15728640  15728640
 RLimitCPU 600   600
 and haven't got them to work very good:
 10314 httpd 13   0 67824  66M  5572 R   0 17.9 13.1   4:19 httpd
 10313 httpd 13   0 69984  68M  5580 R   0 17.7 13.5   4:33 httpd

Hmm, that's from Apache core, have never tried using these. Anybody?

try using BSD::Resource/Apache::Resource and Apache::SizeLimit instead.
These work.

But you have to solve the leaking problem anyhow.

 but i guess that's fairly OT on the mod_perl list.

On the opposite, this is very ontopic, since it's very tricky to find a
problem when you have many modules and scripts running in the same
interpreter. So if during the search you come up with some nice technique
we all be very grateful :)

_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/





Problem on modperl-1.26

2001-09-07 Thread Kevin LEE

Hi list:

I try to staticallly compile modperl-1.26 into apache-1.3.20 but
I get the following compile error when I compile apache-1.3.20:

modules/perl/libperl.a(mod_perl_opmask.o): In function
`mod_perl_set_opmask':
mod_perl_opmask.o(.text+0x1f): undefined reference to `Perl_croak'
*** Error code 1

Stop in /usr/local/apache_1.3.20/src.
*** Error code 1

Stop in /usr/local/apache_1.3.20.
*** Error code 1

Stop in /usr/local/apache_1.3.20.

The script shows how I configure and compile modperl

cd /usr/local/openssl-0.9.5a
./config --prefix=/usr/local/openssl threads -fPIC
make
make test
make install

cd /usr/local/mm-1.1.2
./configure --prefix=/usr/local/mm --disable-shared
make
make test
make install

cd /usr/local/mod_perl-1.26
perl Makefile.PL
make
make install

cd  ../mod_ssl-2.6.x-1.3.4-1.3.12
./configure --with-apache=/usr/local/apache_1.3.20

cd  ../php-4.0.0
bash
CFLAGS='-O2 -I/usr/' \
./configure --with-apache=/usr/local/apache_1.3.20 \
--with-mysql \
--with-pgsql \
--enable-memory-limit=yes \
--enable-debug=no
gmake
gmake install

# SSL_BASE will look for ssl lib under /usr/
# keep the bash
cd /usr/local/apache_1.3.20
SSL_BASE=/usr/ \
EAPI_MM=/usr/local/mm \
./configure  \
--prefix=/usr/local/apache \
--enable-module=ssl \
--activate-module=src/modules/perl/libperl.a \
--enable-module=perl \
--activate-module=src/modules/php4/libphp4.a \
--enable-module=php4
make

Any idea why the error occurrs. I am really stuck 

Cheers,
Kevin














Re: tracing memory problem

2001-09-07 Thread Perrin Harkins

 ok, i'll look into that. I've been using RLimitMEM and RLimitCPU

One thing to be aware of is that using rlimit will kill your process harshly
when it goes over the limit.  It's better to use Apache::SizeLimit for basic
size control, and use rlimit as a backup safety measure to catch runaway
processes.  Apache::SizeLimit will detect processes that are getting too big
and make them cleanly exit after they finish the current request.
- Perrin




Re: memory leaking with closures

2001-09-07 Thread Perrin Harkins

  Oddly, if you just do
 
  my $sub = sub { $var; };
 
  it does not grow, definately something strange going on. Happens on
  perl 5.004_04, 5.005_03 and 5.6.1.

 You mean this works for you?:

 while (1) {
{
my $var = 'x' x 50;
my $sub = sub { $var; };
}
# $var and $sub should be gone, but memory is never freed
sleep 1; # Don't crash things =)
 }

 that's because your $sub goes out of scope.

The leaking behavior only happens when you use nested anonymous subs.  It
should always be possible to avoid it, although your code may look uglier.

 the other one seems like a
 bug.

 If I didn't miss something, it seems that we need to run this through p5p.

It's been known about for a while.  I'm not sure what the status of getting
a fix is.  I assume that it must be difficult to fix or it would have been
changed a long time ago.

- Perrin




Re: embperl

2001-09-07 Thread Perrin Harkins

 Just wanted to ask to any embperl user, is there any real advantage
 about using embperl instead of PHP ?

If you want a high-level summary of Embperl features, you could take a look
at my article on perl.com:
http://www.perl.com/pub/a/2001/08/21/templating.html

- Perrin




Apache::ConfigFile just uploaded

2001-09-07 Thread Nathan Wiger

Hey all-

So, about 2 years after I originally discussed it here, I finally put
the finishing touches on Apache::ConfigFile and uploaded it to CPAN. It
is available in my CPAN directory:

   http://www.cpan.org/authors/id/N/NW/NWIGER/

This modules does the following:

   - Gives you offline access to any Apache style config file

   - Provides methods for accessing config commands and sections

   - Provides a dir_config() which gives you access to PerlSetVar
 declarations by name, just like mod_perl

   - Properly expands Include directives and handles paths
 relative to ServerRoot

   - Handles multiple declarations for the same context (for
 example, multiple VirtualHost definitions)

   - Provides autoloaded methods for common core functions, such
 as server_root()

   - Also has several options which can be used to extend the
 Apache/NCSA syntax, so that you can write a custom config
 module for your own applications and use this module to
 parse it.

In any case, the module is stable but I'd be shocked it is bug-free. So
if you have any comments or bugfixes I'd like to know about them. Hope
you find this useful!

-Nate

-- 
Nathan Wiger
Sysadmin and Perl Hacker
Sun Microsystems



Re: Help w/ install [ActivePerl,W2K Server,Apache 1.3.20]

2001-09-07 Thread Issac Goldstand

Possible you need an AddModule mod_perl.c line in there somewhere...  I'm
not such an experienced module-user with Apache for Win32...

  Issac

PGP Key 0xE0FA561B - Fingerprint:
7E18 C018 D623 A57B 7F37 D902 8C84 7675 E0FA 561B
- Original Message -
From: Brice D Ruth [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, September 07, 2001 00:00
Subject: Help w/ install [ActivePerl,W2K Server,Apache 1.3.20]


 I'm trying to simply get Apache/mod_perl working in W2K ... I've been
 trying to follow the steps outlined in messages I've found from
 searching through archives, but it seems I'm a bit stuck.  My experience
 w/ Apache has always been in Linux or *BSD, so I'm somewhat lost when it
 comes to getting this going in W2k.

 I have Apache 1.3.20 installed - the httpd.conf is vanilla - I can
 access my server by going to http://localhost/ - so all is good there.

 I downloaded ActivePerl 629 (?) and it installed fine ... c:\perl\bin is
 in my path and seems to work fine.  I ran PPM and had it install
 mod_perl from theoryx5.uwinnipeg.ca - everything seemed to run fine and
 in the end it asked me where to put mod_perl.so - the path I gave was
 c:/Program Files/Apache Group/Apache/modules - I later looked here and I
 could see mod_perl.

 I then added the following line to my httpd.conf:

 LoadModule perl_module modules/mod_perl.so

 and left everything else as it was.  I now get the following when I try
 to start Apache:

 The Apache service is starting.
 Failed to start the Apache service.
 Note the errors or messages above, and press the ESC key to exit.
 (countdown)...

 I don't see any error messages that do me any good, config test returns
 Syntax OK and the error log shows nothing.

 What do I need to do?

 Any help would be greatly appreciated!

 Brice Ruth





Re: Info required

2001-09-07 Thread Jeremy Howard

Medi Montaseri wrote:
 Having said thatI recommend Writing Apache Modules with Perl and C
 known as the 'eagle book'. See Chapter 3, 'The Apache Module Architecture
 and API' and for  a quick feeling, see Figure 3-3, page 60, The Request
 Loop.

 Of course I'm new to mod_perl, so if Pokymon Masters find me in fault,
 please train me as I want to be the best pokymon trainer...yes I got a
 four-year old...

Well if you're new to mod_perl the Eagle is exactly the book to help you on
your way to becoming a Poki-master. However, other Poki-masters have
distilled their experience into a great tome that they make available to you
as a great gift--the mod_perl Guide:
  http://perl.apache.org/guide

You must read both of these ancient texts to complete your quest.





ANNOUNCE: Apache::OpenIndex

2001-09-07 Thread George Sanderson

Back on 13 Dec 00, I posted the creation of module Apache::FileMan.pm.
Today, I 
ANNOUNCE that Apache::FileMan has been renamed to Apache::OpenIndex.  

The name change was made because, several software applications go by the
same name, 
one of which, provides the same basic functionality.  The name OpenIndex
was selected 
because it clearly follows from the name, Apache::AutoIndex, from which it
was derived.

Apache::AutoIndex was never released to CPAN.
 
I do plan to do a CPAN release Apache::OpenIndex on 14 Sep 01 (next Friday.)

DESCRIPTION:
OpenIndex provides a file manager for web sites through a web browser. It
is a extensive
rewrite of the Apache::AutoIndex.pm module (written by Philippe M.
Chiasson), which in
turn was a remake of the autoindex Apache module. It can provide the same
functionality
as AutoIndex.pm, therefore it can be used to both to navigate and manage
the web site.

The source is available at:

http://www.xorgate.com/Apache/OpenIndex

A full functioning demo is available at:

http://www.xorgate.com/Apache/OpenIndex/demo

Enjoy.

The name change carries with it configuration directive and default value
changes.
I hope the changes do not cause more problems than they solve.

All comments are welcomed.

Thank you all for bearing with me during this long development cycle.


+==+
| George Sanderson [EMAIL PROTECTED]
| http://www.xorgate.com/http://www.xorgate.com/
+==+




segfault

2001-09-07 Thread Bob Mroczka

I just compiled and installed
Apache 1.3.20 with mod_perl 1.26
and mod_ssl-2.8.4.  Apache
segfaults almost immediately on all requests.

For kicks I compiled Apache 
without mod_ssl and the segfaults disappear.
Also interesting is the fact that when
I compile without mod_ssl make test
completes successfully but when I include
mod_ssl the make test fails to start a httpd process
due to a syntax error:
letting apache warm up...\c
Syntax error on line 3 of /usr/src/mod_perl-1.26/t/conf/httpd.conf:
Invalid command '=pod', perhaps mis-spelled or defined by a module not
included in the server configuration
done
/usr/bin/perl t/TEST 0
still waiting for server to warm up...not ok

I could go with two separate web servers
but I would like to know if there is a way
to make one web server with both mod_perl and mod_ssl.

This is the script I used to compile everything:
APACHE_VER=1.3.20
MM_VER=1.1.3
MODSSL_VER=2.8.4
MODPERL_VER=1.26

(cd ../mod_ssl-$MODSSL_VER-$APACHE_VER 
./configure \
  --with-apache=../apache_$APACHE_VER \
  --with-crt=/root/demoCA/newcerts/x.pem \
  --with-key=/root/demoCA/csr/x.csr 
cd ../mod_perl-$MODPERL_VER 
# prep perl side of mod_perl into the perl system
# and prep the apache side of mod_perl
perl Makefile.PL EVERYTHING=1 \
DO_HTTPD=1 \
APACHE_PREFIX=/usr/local/apache \
APACHE_SRC=../apache_$APACHE_VER/src \
USE_APACI=1  \
PREP_HTTPD=1 
make 
make install 
cd ../apache_$APACHE_VER 
SSL_BASE=SYSTEM \
EAPI_MM=SYSTEM \
./configure \
  --with-layout=Slackware \
  --enable-module=ssl \
  --enable-shared=ssl \
  --disable-rule=SSL_COMPAT \
  --enable-module=most \
  --activate-module=src/modules/perl/libperl.a
\
  --enable-shared=max 
make 
make install ) 21 | tee install.log

Here is the message that goes into the error log:
[Fri Sep  7 21:25:56 2001] [notice] Apache/1.3.20 (Unix) mod_perl/1.26
configured -- resuming normal operations
[Fri Sep  7 21:26:09 2001] [notice] child pid 26019 exit signal
Segmentation fault (11)

The output of perl -V is:
Summary of my perl5 (revision 5.0 version 6 subversion 1)
configuration:
  Platform:
osname=linux, osvers=2.4.2, archname=i386-linux
uname='linux grommet 2.4.2 #1 smp sun feb 25 16:33:33 pst 2001
i686 unknown '
config_args='-de -Dprefix=/usr -Darchname=i386-linux
-Dprivlib=/usr/lib/perl5 -Darchlib=/usr/lib/perl5/i386-linux
-Dsitelib=/usr/lib/perl5/site_perl
-Dsitearch=/usr/lib/perl5/site_perl/i386-linux'
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='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2',
cppflags='-fno-strict-aliasing -I/usr/local/include'
ccversion='', gccversion='2.95.3 20010315 (release)',
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 =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lndbm -lgdbm -ldl -lm -lc -lcrypt -lutil
perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil
libc=/lib/libc-2.2.2.so, so=so, useshrplib=false,
libperl=libperl.a
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef,
ccdlflags='-rdynamic'
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 Apr 11 2001 22:57:30
  @INC:
/usr/lib/perl5/i386-linux
/usr/lib/perl5
/usr/lib/perl5/site_perl/i386-linux
/usr/lib/perl5/site_perl
/usr/lib/perl5/site_perl

When I run apache under -X and strace here is what 
happens when the request comes in:
26480 read(5, GET / HTTP/1.0\r\nConnection: Keep..., 4096) = 277
26480 rt_sigaction(SIGUSR1, {SIG_IGN}, {SIG_IGN}, 8) = 0
26480 time(NULL)= 17985
26480 alarm(300)= 300
26480 alarm(0)  = 300
26480 stat64(0x8170710, 0xb17c) = 0
26480 --- SIGSEGV (Segmentation fault) ---
26480 +++ killed by SIGSEGV +++

Does anyone have any suggestions?



Re: segfault

2001-09-07 Thread Stas Bekman

On Fri, 7 Sep 2001, Bob Mroczka wrote:

 I just compiled and installed
 Apache 1.3.20 with mod_perl 1.26
 and mod_ssl-2.8.4.  Apache
 segfaults almost immediately on all requests.

 For kicks I compiled Apache
 without mod_ssl and the segfaults disappear.
 Also interesting is the fact that when
 I compile without mod_ssl make test
 completes successfully but when I include
 mod_ssl the make test fails to start a httpd process
 due to a syntax error:
 letting apache warm up...\c
 Syntax error on line 3 of /usr/src/mod_perl-1.26/t/conf/httpd.conf:
 Invalid command '=pod', perhaps mis-spelled or defined by a module not
 included in the server configuration
 done
 /usr/bin/perl t/TEST 0
 still waiting for server to warm up...not ok

you have used PREP_HTTPD, of course make test won't work.
You want to follow this scenario while installing mod_ssl+mod_perl
http://perl.apache.org/guide/install.html#mod_perl_and_mod_ssl_openssl_
and you will be all set.

 When I run apache under -X and strace here is what
 happens when the request comes in:
 26480 read(5, GET / HTTP/1.0\r\nConnection: Keep..., 4096) = 277
 26480 rt_sigaction(SIGUSR1, {SIG_IGN}, {SIG_IGN}, 8) = 0
 26480 time(NULL)= 17985
 26480 alarm(300)= 300
 26480 alarm(0)  = 300
 26480 stat64(0x8170710, 0xb17c) = 0
 26480 --- SIGSEGV (Segmentation fault) ---
 26480 +++ killed by SIGSEGV +++

 Does anyone have any suggestions?

You have kindly provided everything but the core trace. See the SUPPORT
file to learn how to do that, but first try to build using the details
from above.


_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/





RE: memory leaking with closures

2001-09-07 Thread Arthur Bergman



 On Fri, Sep 07, 2001 at 12:27:58AM -0700, Alex Krohn wrote:
  while (1) {
  {
  my $var = 'x' x 50;
  my $sub = sub { my $sub2 = sub { $var; } };
  }
  # $var and $sub should be gone, but memory is never freed
  sleep 1; # Don't crash things =)
  }
  
  will grow forever
 
  it does not grow, definately something strange going on. Happens on
  perl 5.004_04, 5.005_03 and 5.6.1. 
 
 confirmed in bleadperl (patch 11936).  CCing p5p.
 
 atleast one sub { sub{} } leak was fixed recently, but not this one.
 
 - Barrie

Seems like we are not properly freeing the prototype CV which is cloned.

Arthur




SV: memory leaking with closures

2001-09-07 Thread Arthur Bergman


 On Fri, 07 Sep 2001 18:06:17 +0200, Arthur Bergman wrote:
  On Fri, Sep 07, 2001 at 12:27:58AM -0700, Alex Krohn wrote:
   while (1) {
   {
   my $var = 'x' x 50;
   my $sub = sub { my $sub2 = sub { $var; } };
   }
   # $var and $sub should be gone, but memory is never freed
   sleep 1; # Don't crash things =)
   }
   
   will grow forever
  
   it does not grow, definately something strange going on. Happens on
   perl 5.004_04, 5.005_03 and 5.6.1. 
  
  confirmed in bleadperl (patch 11936).  CCing p5p.
  
  atleast one sub { sub{} } leak was fixed recently, but not this one.
  
  - Barrie
 
 Seems like we are not properly freeing the prototype CV which is cloned.
 
 Not likely, since there are always a fixed number of closure prototypes
 when there is no eval to create new ones.

Silly me.

 It is more likely that the reference loop between the inner and outer
 CVs is preventing the freeing of either of them.  I'm not in fact sure
 that the reference loop *can* be eliminated trivially, given these two
 CVs can have different lifetimes.  Perhaps the right solution is to
 move to using weakrefs for CvOUTSIDE(), I dunno.
 

Sounds like an idea anyway. I will give it a try. Only problem I see it will be messed 
up after perl_clone.


Arthur




Re: memory leaking with closures

2001-09-07 Thread Barrie Slaymaker

On Fri, Sep 07, 2001 at 12:27:58AM -0700, Alex Krohn wrote:
 while (1) {
   {
   my $var = 'x' x 50;
   my $sub = sub { my $sub2 = sub { $var; } };
   }
   # $var and $sub should be gone, but memory is never freed
   sleep 1; # Don't crash things =)
 }
 
 will grow forever

 it does not grow, definately something strange going on. Happens on
 perl 5.004_04, 5.005_03 and 5.6.1. 

confirmed in bleadperl (patch 11936).  CCing p5p.

atleast one sub { sub{} } leak was fixed recently, but not this one.

- Barrie



Re: memory leaking with closures

2001-09-07 Thread Gurusamy Sarathy

On Fri, 07 Sep 2001 18:06:17 +0200, Arthur Bergman wrote:
 On Fri, Sep 07, 2001 at 12:27:58AM -0700, Alex Krohn wrote:
  while (1) {
  {
  my $var = 'x' x 50;
  my $sub = sub { my $sub2 = sub { $var; } };
  }
  # $var and $sub should be gone, but memory is never freed
  sleep 1; # Don't crash things =)
  }
  
  will grow forever
 
  it does not grow, definately something strange going on. Happens on
  perl 5.004_04, 5.005_03 and 5.6.1. 
 
 confirmed in bleadperl (patch 11936).  CCing p5p.
 
 atleast one sub { sub{} } leak was fixed recently, but not this one.
 
 - Barrie

Seems like we are not properly freeing the prototype CV which is cloned.

Not likely, since there are always a fixed number of closure prototypes
when there is no eval to create new ones.

It is more likely that the reference loop between the inner and outer
CVs is preventing the freeing of either of them.  I'm not in fact sure
that the reference loop *can* be eliminated trivially, given these two
CVs can have different lifetimes.  Perhaps the right solution is to
move to using weakrefs for CvOUTSIDE(), I dunno.


Sarathy
[EMAIL PROTECTED]