HELP??? Installation on MAC OS X

2001-04-25 Thread David Campion



Hi


I am trying to 
install mod perl on the Apple OS X Server platform.

I can compile the 
code OK, both as static and as a DSO but when I try to restart the apache 
server, I get all sorts of errors.

example 
:

dyld: 
/usr/sbin/httpd multiple definitions of symbol 
_vhost_alias_module/System/Library/Apache/Modules/mod_vhost_alias.so 
definition of 
_vhost_alias_module/System/Library/Apache/Modules/mod_vhost_alias.so 
definition of _vhost_alias_module

this was built as a 
DSO with all options enabled, if I don't load this module it just complains 
about the next one in the list.

Any help, pointers, 
kick in the right direction would be very much appreciated.

Dave.


Re: HELP??? Installation on MAC OS X

2001-04-25 Thread G.W. Haywood

Hi there,

On Wed, 25 Apr 2001, David Campion wrote:

 I am trying to install mod perl on the Apple OS X Server platform.

Best of luck!

 example :
 
 dyld: /usr/sbin/httpd multiple definitions of symbol _vhost_alias_module
 /System/Library/Apache/Modules/mod_vhost_alias.so definition of
 _vhost_alias_module
 /System/Library/Apache/Modules/mod_vhost_alias.so definition of
 _vhost_alias_module
 
 this was built as a DSO with all options enabled, if I don't load this
 module it just complains about the next one in the list.

Never built for your platform, must be somebody who's tried it out there,
but for a start it might be worth trying without loading any modules.
You can get by without lots of them.

Can you run Apache at all without mod_perl?

73,
Ged.




What is the difference: PerlRun and MaxRequestsPerChild 1

2001-04-25 Thread newsreader

I recently began to experience many lingering
mod_perl processes which slow down my tcp connection.

I use Apache::Registry for all my mod_perl need.
Not the real handler.

The practical solution I found was to cut down the 
number MaxRequestPerChild and kill off the processes
after a few requests.

I understand that Apache::PerlRun has the overhead
of compiling each script with a new request.  I would
like to know whether there is a compilation overhead
if I set say MaxRequestsPerChild 1  ??

I was also thinking that because the script is loaded
from the disk with each request there will be performance
degradation because of disk data ransfer rate will be
order of magnitude less than if the script were
to remain in the memory all the time.

That leads me to think about using very cool RAMFS that
comes linux-2.4.  What does everyone think about using
RAMFS to reduce the performance degradation due to
loading script from the disk if there is one.
I have over 100 scripts altogether but the total size of them
is less than 1 MB and I have plenty of memory.

Thanks in advance



Re: What is the difference: PerlRun and MaxRequestsPerChild 1

2001-04-25 Thread Stas Bekman

On Wed, 25 Apr 2001 [EMAIL PROTECTED] wrote:

 I recently began to experience many lingering
 mod_perl processes which slow down my tcp connection.

 I use Apache::Registry for all my mod_perl need.
 Not the real handler.

 The practical solution I found was to cut down the
 number MaxRequestPerChild and kill off the processes
 after a few requests.

 I understand that Apache::PerlRun has the overhead
 of compiling each script with a new request.  I would
 like to know whether there is a compilation overhead
 if I set say MaxRequestsPerChild 1  ??

Not if you preload your scripts at the server startup. But then you pay
the price of the time to spawn a new process, which has a very little
overhead under low load since Apache preforks processes (assuming that you
have MaxSpareServers set to a reasonable number). Under very high load
your machine will spend a lot of CPU, spawning processes, which is not
good.

 I was also thinking that because the script is loaded
 from the disk with each request there will be performance
 degradation because of disk data ransfer rate will be
 order of magnitude less than if the script were
 to remain in the memory all the time.

true, see above

 That leads me to think about using very cool RAMFS that
 comes linux-2.4.  What does everyone think about using
 RAMFS to reduce the performance degradation due to
 loading script from the disk if there is one.
 I have over 100 scripts altogether but the total size of them
 is less than 1 MB and I have plenty of memory.

don't. preload the code at the server startup.


_
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: What is the difference: PerlRun and MaxRequestsPerChild 1

2001-04-25 Thread G.W. Haywood

Hi there,

On Wed, 25 Apr 2001 [EMAIL PROTECTED] wrote:

 like to know whether there is a compilation overhead if I set say
 MaxRequestsPerChild 1 ??

http://perl.apache.org/guide

 disk data ransfer rate will be order of magnitude less than if the
 script were to remain in the memory all the time.

Not order, orders :)

 That leads me to think about using very cool RAMFS that
 comes linux-2.4.

You can use ramdisks with almost *any* Linux.

 What does everyone think about using RAMFS to reduce the performance
 degradation due to loading script from the disk if there is one.

Anything that reduces the need to go to a rusty, spinning plate to get
your data is a Good Thing.

73,
Ged.




Re: HELP??? Installation on MAC OS X

2001-04-25 Thread darren chamberlain

David Campion ([EMAIL PROTECTED]) said something to this effect on 04/25/2001:
 I am trying to install mod perl on the Apple OS X Server platform.
 
 I can compile the code OK, both as static and as a DSO  but when I try to
 restart the apache server, I get all sorts of errors.
 
 example :
 
 dyld: /usr/sbin/httpd multiple definitions of symbol _vhost_alias_module
 /System/Library/Apache/Modules/mod_vhost_alias.so definition of
 _vhost_alias_module
 /System/Library/Apache/Modules/mod_vhost_alias.so definition of
 _vhost_alias_module
 
 this was built as a DSO with all options enabled, if I don't load this
 module it just complains about the next one in the list.
 
 Any help, pointers, kick in the right direction would be very much
 appreciated.

Did you put ClearModuleList before the AddModule lines?

URL:http://httpd.apache.org/docs/mod/core.html#clearmodulelist
ClearModuleList directive

Syntax: ClearModuleList
Context: server config
Status: core
Compatibility: ClearModuleList is only available in Apache 1.2
   and later

The server comes with a built-in list of active modules. This
directive clears the list. It is assumed that the list will then
be re-populated using the AddModule directive

(darren)

-- 
Premature optimization is the root of all evil in programming.
-- C.A.R. Hoare



Re: What is the difference: PerlRun and MaxRequestsPerChild 1

2001-04-25 Thread newsreader

On Wed, Apr 25, 2001 at 12:10:01PM +0100, G.W. Haywood wrote:
 Hi there,
 
 On Wed, 25 Apr 2001 [EMAIL PROTECTED] wrote:
 
  like to know whether there is a compilation overhead if I set say
  MaxRequestsPerChild 1 ??
 
 http://perl.apache.org/guide

I have read the guide cover to cover long ago :)


 You can use ramdisks with almost *any* Linux.
 

Ah.. ramdisk and ramfs are different animals





Re: What is the difference: PerlRun and MaxRequestsPerChild 1

2001-04-25 Thread newsreader

Thanks.  I think that is what I really need :)

On Wed, Apr 25, 2001 at 08:19:21PM +0800, Stas Bekman wrote:
 the two events contrudict and lead to the need to re-read the guide, and
 especially this section:
 http://perl.apache.org/guide/performance.html#Preloading_Registry_Scripts_at_S
 
 :)
 _
 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/
 



Apache growing (memory)

2001-04-25 Thread Kurt George Gjerde

Hi,

I recently discovered the following on an Apache/mod_perl server.

I have Apache for win32, ActiveState's Perl and the mod_perl PPM installed
(on a Windows 2000 Pro OS, but read on anyway ;). All were downloaded and
installed last week so they are the latest versions.

Each time a page is downloaded the Apache service process claims more
memory. Well, not each time but like for every 20th download the task
manager shows Apache using 20-30K more...

A test showed that reloading the same page 2000 times raised Apaches
memory by approx 1000k.

At first I thought that this was due to some sloppy programming (of mine)
in my recent mod_perl handler, but not so. When using an empty handler
(just the handler sub shell without any code inside it) the same thing
occurred.

This does not happen when loading non-script files (plain html).

Then I did the same test on an ordinary CGI Perl script (no mod_perl) and
the same thing happened then as well (so why am I posting this here?!).

Since this is on win32 Apache will continue using the same (sub-)process
until it's restarted (unlike Unix; though it IS possible to set up a
'retirement plan' on win32 as well). My fear is that Apache will end up
using all the RAM...

Does anyone know why this is happening? Is it the win32 build of Apache or
does this happen on other platforms also?


Thanks,
-Kurt.
__
kurt george gjerde [EMAIL PROTECTED]
dept. of media studies, university of bergen






Re: What is the difference: PerlRun and MaxRequestsPerChild 1

2001-04-25 Thread Stas Bekman

On Wed, 25 Apr 2001 [EMAIL PROTECTED] wrote:

In a different thread [EMAIL PROTECTED] said:

 I have read the guide cover to cover long ago :)

In the other thread [EMAIL PROTECTED] has asked:

 Not exactly sure how to preload these scripts.  I have the following

the two events contrudict and lead to the need to re-read the guide, and
especially this section:
http://perl.apache.org/guide/performance.html#Preloading_Registry_Scripts_at_S

:)
_
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: What is the difference: PerlRun and MaxRequestsPerChild 1

2001-04-25 Thread newsreader

On Wed, Apr 25, 2001 at 07:19:25PM +0800, Stas Bekman wrote:
  if I set say MaxRequestsPerChild 1  ??
 
 Not if you preload your scripts at the server startup. But then you pay
 the price of the time to spawn a new process, which has a very little
 overhead under low load since Apache preforks processes (assuming that you
 have MaxSpareServers set to a reasonable number). Under very high load
 your machine will spend a lot of CPU, spawning processes, which is not
 good.
 

I have lots of custom modules that I preload with startup.pl.

Still I have many scripts that run under Apache::Registry.
Not exactly sure how to preload these scripts.  I have the following
directive

PerlTaintCheck On
IfModule mod_perl.c
Location /

#  PerlSetVar PerlRunOnce On

SetHandler perl-script
PerlRequire /home/apache/modperl/startup.pl
PerlHandler Apache::Registry

#  PerlSendHeader On

  Options +ExecCGI
/Location
/IfModule

Note: this is a dedicated mod_perl server and I'm not serving
any static pages.
-

Document root / contains 100 perl scripts.

I preload 40 modules (of which 29 is my own
custom modules) in startup.pl as
explained in your guide.

So I guess I don't understand what you mean by 
preloading scripts.  One of the reasons
I like having 100 scripts in document root
with Apache::Registry is that I can modify
them at any time and I don't have restart
the server.  This is also one of the reasons
I don't bother with the real handler.

Thanks



RE: Apache growing (memory)

2001-04-25 Thread Brendan McAdams

It sounds like you are globalising some variables and never freeing
them, to start with.  You definitely need to run in strict and keep your
namespaces managed lest you have processes keep variables in Memory.

I've found that setting MaxRequestsPerChild in apache to a reasonable
amount minimises this leakage also: Our application performance actually
improved across the board when we implements MaxRequests... (This
basically kills a child process and restarts it after it serves $x
number of requests: Starting with a fresh memory space and freeing the
old).

-
Brendan W. McAdams   |   [EMAIL PROTECTED]
Senior Applications Developer | (212) 208-9116
TheMuniCenter, LLC | www.themunicenter.com

Always listen to experts. They'll tell you what can't be done, and why.
Then do it.
- Robert A. Heinlein

-Original Message-
From: Kurt George Gjerde [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 25, 2001 08:13
To: [EMAIL PROTECTED]
Subject: Apache growing (memory)


Hi,

I recently discovered the following on an Apache/mod_perl server.

I have Apache for win32, ActiveState's Perl and the mod_perl PPM
installed
(on a Windows 2000 Pro OS, but read on anyway ;). All were downloaded
and
installed last week so they are the latest versions.

Each time a page is downloaded the Apache service process claims more
memory. Well, not each time but like for every 20th download the task
manager shows Apache using 20-30K more...

A test showed that reloading the same page 2000 times raised Apaches
memory by approx 1000k.

At first I thought that this was due to some sloppy programming (of
mine)
in my recent mod_perl handler, but not so. When using an empty handler
(just the handler sub shell without any code inside it) the same thing
occurred.

This does not happen when loading non-script files (plain html).

Then I did the same test on an ordinary CGI Perl script (no mod_perl)
and
the same thing happened then as well (so why am I posting this here?!).

Since this is on win32 Apache will continue using the same (sub-)process
until it's restarted (unlike Unix; though it IS possible to set up a
'retirement plan' on win32 as well). My fear is that Apache will end up
using all the RAM...

Does anyone know why this is happening? Is it the win32 build of Apache
or
does this happen on other platforms also?


Thanks,
-Kurt.
__
kurt george gjerde [EMAIL PROTECTED]
dept. of media studies, university of bergen






[Patch] Apache-dso_module() to find if a module is loaded as DSO or not

2001-04-25 Thread Philippe M . Chiasson

A suggested new feature.

Apache-dso_module('mod_example.c') behaves like 
Apache-module('mod_example.c') except it returns 1 if the
module is loaded as DSO, 0 if it's compiled in and undef
if it's not present at all.

I wrote this because of a few problems I had with the 'slight'
differences in behaviour of mod_perl under DSO and compiled in.

In my case, I call an init function from a startup.pl, and because
of the way apache starts then restarts, it gets called twice if mod_perl
is compiled in and only once if it's a DSO.

So I end up with code like this:

sub init {
return if($Apache::Server::Starting  not $Global::MOD_PERL_AS_DSO);
}

I guess it could be usefull for other purposes to, so here is the patch.
-- 
+---+
| Philippe M. Chiasson  [EMAIL PROTECTED]|
| SmartWorker http://www.smartworker.org|
| IM : gozerhbe  ICQ : gozer/18279998   |
|   64.8% computer corrupt according to |
| http://www.freespeech.org/ljk/purity.html |
+---+
C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg.
-- Bjarne Stroustrup

perl -e '$$=\${gozer};{$_=unpack(P26,pack(L,$$));/^Just Another Perl 
Hacker!\n$/print||$$++redo}'


Index: src/modules/perl/Apache.xs
===
RCS file: /home/cvs/modperl-1/src/modules/perl/Apache.xs,v
retrieving revision 1.120
diff -u -U10 -b -B -I'$Id' -I'$Revision' -r1.120 Apache.xs
--- src/modules/perl/Apache.xs  2001/04/17 21:57:20 1.120
+++ src/modules/perl/Apache.xs  2001/04/25 13:57:04
@@ -476,20 +476,40 @@
 
 CODE:
 if((*(SvEND(name) - 2) == '.')  (*(SvEND(name) - 1) == 'c'))
 RETVAL = find_linked_module(SvPVX(name)) ? 1 : 0;
 else
 RETVAL = (sv  perl_module_is_loaded(SvPVX(name)));
 
 OUTPUT:
 RETVAL
 
+I32
+dso_module(sv,name)
+SV *sv
+SV *name
+
+PREINIT:
+module *mod;
+
+CODE:
+mod = find_linked_module(SvPVX(name));
+if(name  mod) {
+RETVAL = (mod-dynamic_load_handle) ? 1 : 0;
+}
+else {
+ XSRETURN_UNDEF;
+}
+
+OUTPUT:
+RETVAL
+
 char *
 mod_perl_set_opmask(r, sv)
 Apache r
 SV *sv
 
 void
 untaint(...)
 
 PREINIT:
 int i;



Re: Apache growing (memory)

2001-04-25 Thread newsreader

On Wed, Apr 25, 2001 at 10:02:06AM -0400, Brendan McAdams wrote:
Our application performance actually
 improved across the board when we implements MaxRequests... (This

Do you have numbers to back this up?  How does reading in a new
script every now and then IMPROVE anything compared to keeping
in memory all the time?  It's not like perl gets tired
after using the same memory all the time.

Memory leakage is a separate issue which I don't seem to be able to solve
any how with use strict and I'm not using any global variables at all.




Global Variables Question

2001-04-25 Thread Warren D. Johnson

Hello All,

I apologize if this is in a FAQ somewhere.

I have a script, lets call it test.pl.  Test.pl requires in config.pl.

Test.pl uses variables (via use vars) from config.pl.  These variables are
defined and given values in config.pl.  AFter the first usage of test.pl,
the variables we are pulling in from config.pl no longer have values.  So
it's something like this:

config.pl

use vars ($G_ROOTPATH);
$G_ROOTPATH = /home/warren;

config.pl



test.pl

require config.pl;

use vars ($G_ROOTPATH);
# at this point, G_ROOTPATH is inherited from config.pl and has the value of
/home/warren

test.pl

On the first run of the script G_ROOTPATH in test.pl has the value of
home/warren...  subsequent runs, it does not.

I'm a little confused as to exact ways modperl handles global variables.
Anyone have a simple tweak for this? Or do I have to make a config package?

Thanks in advance!






Re: Global Variables Question

2001-04-25 Thread Mike Cameron

http://perl.apache.org/guide/porting.html#Configuration_Files_Writing_Dy

Guide Good!

Warren D. Johnson wrote:

 Hello All,

 I apologize if this is in a FAQ somewhere.

 I have a script, lets call it test.pl.  Test.pl requires in config.pl.

 Test.pl uses variables (via use vars) from config.pl.  These variables are
 defined and given values in config.pl.  AFter the first usage of test.pl,
 the variables we are pulling in from config.pl no longer have values.  So
 it's something like this:

 config.pl

 use vars ($G_ROOTPATH);
 $G_ROOTPATH = /home/warren;

 config.pl

 test.pl

 require config.pl;

 use vars ($G_ROOTPATH);
 # at this point, G_ROOTPATH is inherited from config.pl and has the value of
 /home/warren

 test.pl

 On the first run of the script G_ROOTPATH in test.pl has the value of
 home/warren...  subsequent runs, it does not.

 I'm a little confused as to exact ways modperl handles global variables.
 Anyone have a simple tweak for this? Or do I have to make a config package?

 Thanks in advance!




Re: Apache growing (memory)

2001-04-25 Thread Joe Schaefer

Kurt George Gjerde [EMAIL PROTECTED] writes:

 Each time a page is downloaded the Apache service process claims more
 memory. Well, not each time but like for every 20th download the task
 manager shows Apache using 20-30K more...
 
 A test showed that reloading the same page 2000 times raised Apaches
 memory by approx 1000k.
 

Even if your script were coded perfectly, it is still possible for this
to happen in modperl.  Three main reasons are

1) the copy-on-write effect will cause memory growth (~4K per page),
2) Perl's garbage collection and overall memory management does not 
   really mesh well with modperl,
3) Some XS modules do leak, and occasionally so does perl itself :(

Personally, I would consider an average growth rate of only .5kB/hit 
absolutely wonderful :)

However, odds are that if you are just starting out with mod_perl,
your script can be written in a more memory-friendly way.  Be sure
to consult the guide for tips:

  http://perl.apache.org/guide/


-- 
Joe Schaefer



Re: [Patch] Apache-dso_module() to find if a module is loaded asDSO or not

2001-04-25 Thread Stas Bekman

On Wed, 25 Apr 2001, Philippe M . Chiasson wrote:

 A suggested new feature.

 Apache-dso_module('mod_example.c') behaves like
 Apache-module('mod_example.c') except it returns 1 if the
 module is loaded as DSO, 0 if it's compiled in and undef
 if it's not present at all.

 I wrote this because of a few problems I had with the 'slight'
 differences in behaviour of mod_perl under DSO and compiled in.

 In my case, I call an init function from a startup.pl, and because
 of the way apache starts then restarts, it gets called twice if mod_perl
 is compiled in and only once if it's a DSO.

 So I end up with code like this:

 sub init {
   return if($Apache::Server::Starting  not $Global::MOD_PERL_AS_DSO);
   }


Back to the old problem... Eric Cholet has implemented
$Apache::Server::Restarting, but for various reasons it's never went in.

Currently I think there is a slight bug in the latest mod_perl 1.x,
where PerlRequire doesn't work as require() in Perl per se on restart. A
few people have reported this behavior.

So as a quick workaround do this:

start.pl:
-
require real-startup.pl;

this require(), won't be called twice.

 I guess it could be usefull for other purposes to, so here is the patch.

I'm not underestimating the power of your patch of course :) I think the
real fix should be in PerlRequire.

BTW, the same problem happens to PerlModule. I've moved all my preloadings
into the Perl domain, mod_perl reloads them twice.

_
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://logilune.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/





mod_perl and infinite loops

2001-04-25 Thread Jason Terry

I have a rather large script I run through mod_perl and occasionally, I have 
notice some users with stuck processes.  It seems
like they are in some sort of infinite loop.

The CPU that the child is using is high, and the memory gradually grows until my 
server would eventually start to thrash (however, I
built a script to kill the child before this occurs)

Does anyone know of a way (even if it costs more memory/cpu) that I could load an 
ability into modperl and view where in the perl
code a mod_perl process is atually at?  Would Apache::Status or B::TerseSize or 
something else make this possible?

I know that B::TerseSize will allow me to view the code loaded into memory, but I 
havent' found a way to actually analyze a child
to find out what it is CURRENTLY runnning.




Re: mod_perl and infinite loops

2001-04-25 Thread Stas Bekman

On Wed, 25 Apr 2001, Jason Terry wrote:

 I have a rather large script I run through mod_perl and occasionally, I have 
notice some users with stuck processes.  It seems
 like they are in some sort of infinite loop.

 The CPU that the child is using is high, and the memory gradually grows until my 
server would eventually start to thrash (however, I
 built a script to kill the child before this occurs)

This should help:
http://perl.apache.org/guide/debug.html#Hanging_Processes_Detection_and

 Does anyone know of a way (even if it costs more memory/cpu) that I could load an 
ability into modperl and view where in the perl
 code a mod_perl process is atually at?  Would Apache::Status or B::TerseSize or 
something else make this possible?

 I know that B::TerseSize will allow me to view the code loaded into memory, but I 
havent' found a way to actually analyze a child
 to find out what it is CURRENTLY runnning.




_
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://logilune.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/





mod Perl installation failures

2001-04-25 Thread jim . a . davidson

Sirs,
I have discovered that my printer for some reason omitted some characters
from the mod Perl installation
README file which caused subsequent compilation failures.
I have now rectified this and the install looks ok.
Apologies for any time wasted.
Thanks.


Regards,

Jim 
___
BTcd  Information Systems Engineering
 CORES  Infrastructure Support 

* 0131-662 4724
*  
* [EMAIL PROTECTED]
*pp HWP186
  PO Box 234 (HOM-EH)
  Edinburgh 
  Midlothian , EH12 9UR
 
___






looking for help finishing a module

2001-04-25 Thread Steven Lembark


something like Apache::Digest::FixMSHak.

MS decided that their version of digest security was better than
the RFC.  i should be doable to add a re-write module that hacks
the MS hak back to stock values so that mod_digest works again.

people i've spoken to so far don't know if there is anything
other than simply truncating the uri to its path (leaving off
the arguments) that's done by MS.  if anyone knows how their
process works, or is willing to help check it, please warn me.
it'll be a big help in this thing done sooner.

thanx.

-- 
 Steven Lembark   2930 W. Palmer St.
 Chicago, IL  60647
 [EMAIL PROTECTED]   800-762-1582



Re: Apache growing (memory)

2001-04-25 Thread Matt Sergeant

On Wed, 25 Apr 2001, G.W. Haywood wrote:

 Hi all,

 On Wed, 25 Apr 2001, Remco Schaar wrote:

  It is very hard to write perfect code,

 True, but it's not hard to write code that doesn't leak memory.

 void *p = NULL;
 ...
 ...
 if( p ) { exit(POINTER_ERROR); }
 void *p = malloc(n);
 ...
 ...
 free( p );
 p = NULL;
 ...
 ...

 By which I mean that I use a certain set of pointers for memory
 allocation and nothing else.  The pointers are declared and
 initialized to NULL in the same statement.  Whenever I free some
 memory I set the pointer which was used to point to it back to NULL.
 Whenever I use a pointer for memory I first check that its value is
 NULL.  Then if I try to use it when it's already being used for
 something else my program tells me in a fairly unceremonious fashion.

 This is one of a number of defensive techniques I've developed over
 the years.  It's better to wrap this kind of stuff in a library of
 defensive memory management routines (I expect you can buy one:) as
 there's less room for errors and it saves a lot of typing.

Easier still, just use boehm gc. ;-)

(I've found boehm gc to not only be easier to work with, but also to be
*faster* than hand de-allocating memory)

-- 
Matt/

/||** Founder and CTO  **  **   http://axkit.com/ **
   //||**  AxKit.com Ltd   **  ** XML Application Serving **
  // ||** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
 \\//
 //\\
//  \\




Re: [OT] Apache growing (memory)

2001-04-25 Thread G.W. Haywood

Hi Matt,

On Wed, 25 Apr 2001, Matt Sergeant wrote:

 Easier still, just use boehm gc. ;-)

Can you get that for MS-DOS?

73,
Ged.




Re: [Patch] Apache-dso_module() to find if a module is loaded as DSO or not

2001-04-25 Thread Philippe M . Chiasson

On Wed, Apr 25, 2001 at 10:59:51PM +0800, Stas Beckman wrote:
 On Wed, 25 Apr 2001, Philippe M . Chiasson wrote:

  A suggested new feature.
 
  Apache-dso_module('mod_example.c') behaves like
  Apache-module('mod_example.c') except it returns 1 if the
  module is loaded as DSO, 0 if it's compiled in and undef
  if it's not present at all.
 
  I wrote this because of a few problems I had with the 'slight'
  differences in behaviour of mod_perl under DSO and compiled in.
 
  In my case, I call an init function from a startup.pl, and because
  of the way apache starts then restarts, it gets called twice if mod_perl
  is compiled in and only once if it's a DSO.
 
  So I end up with code like this:
 
  sub init {
  return if($Apache::Server::Starting  not $Global::MOD_PERL_AS_DSO);
  }
 

 Back to the old problem... Eric Cholet has implemented
 $Apache::Server::Restarting, but for various reasons it's never went in.

 Currently I think there is a slight bug in the latest mod_perl 1.x,
 where PerlRequire doesn't work as require() in Perl per se on restart. A
 few people have reported this behavior.

 So as a quick workaround do this:

 start.pl:
 -
 require real-startup.pl;

 this require(), won't be called twice.

I know that, but my problem is that I need to call an init() function
in a loaded library that can't be called twice ;-(


  I guess it could be usefull for other purposes to, so here is the patch.

 I'm not underestimating the power of your patch of course :) I think the
 real fix should be in PerlRequire.

Yeah, Matt said he could use it ;-)


 BTW, the same problem happens to PerlModule. I've moved all my preloadings
 into the Perl domain, mod_perl reloads them twice.

I agree, I experienced the strange differences between PerlModule Foo 
Perluse Foo;/Perl ;-(

I guess that problem couold be fixed usign perl_module-dynamic_load_handle.
That way code like PerlModule and such could figure out if they should
skip the first run or not.

I wouldn't mind volunteering to look at this problem and suggest a fix. It's
been annoying for a long time now.

There is also the strange case of mod_perl leaking memory on graceful resta=
rts
when compiled as DSO.  But I don't feel like getting into this one quite ye=
t.

 _
 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://logilune.com/
 http://singlesheaven.com http://perl.apache.org http://perlmonth.com/




--
+---+
| Philippe M. Chiasson  [EMAIL PROTECTED]|
| SmartWorker http://www.smartworker.org|
| IM : gozerhbe  ICQ : gozer/18279998   |
|   64.8% computer corrupt according to |
| http://www.freespeech.org/ljk/purity.html |
+---+
die_if_kernel(Whee... Hello Mr. Penguin,current-tss.kregs);
-- Linux2.2.16
/usr/src/linux/arch/sparc/kernel/traps.c

perl -e '$$=3D\${gozer};{$_=3Dunpack(P26,pack(L,$$));/^Just Another Perl 
Hacker!\n$/print||$$++redo}'




Re: [OT] writing code (was: Apache growing (memory))

2001-04-25 Thread Remco Schaar

On Wed, 25 Apr 2001, G.W. Haywood wrote:

 Hi all,

Hi again,
 
 On Wed, 25 Apr 2001, Remco Schaar wrote:
 
  It is very hard to write perfect code,
 
 True, but it's not hard to write code that doesn't leak memory.
 
 void *p = NULL;
 ...
 ...
 if( p ) { exit(POINTER_ERROR); }
 void *p = malloc(n);
 ...
 ...
 free( p );
 p = NULL;
 ...
 ...

Of course I did not refer to hello world, but more complex program that
generate new code which is executed etc... I was not even thinking about
starting a discussion or flame war about code correctness :-)

 By which I mean that I use a certain set of pointers for memory
 allocation and nothing else.  The pointers are declared and
 initialized to NULL in the same statement.  Whenever I free some
 memory I set the pointer which was used to point to it back to NULL.
 Whenever I use a pointer for memory I first check that its value is
 NULL.  Then if I try to use it when it's already being used for
 something else my program tells me in a fairly unceremonious fashion.

Ok, but this requires all programmers to write clean and _consequent_ 
code, with all proper checks and a well-thought design 
and... and... and... Theory is great, but in practice, this seems to
happen only with small groups/projects and then even rarely (all
software-enginering literature will confirm this, sadly). Certainly with
continuous running programs (as apache/mod_perl), even the smallest
mistake or misplacement in freeing memory (or not-freeing on purpose) will
cause growth of memory consumption per request.

 This is one of a number of defensive techniques I've developed over
 the years.  It's better to wrap this kind of stuff in a library of
 defensive memory management routines (I expect you can buy one:) as
 there's less room for errors and it saves a lot of typing.
 
 Just my $0.02.

Go, and tell those guys in redmond... please :-)))

 Geoff, I expect this will turn out to be one of those threads...

No intensions !-)

 73,
 Ged.

Bye,
Remco






Re: Apache growing (memory)

2001-04-25 Thread G.W. Haywood

Hi all,

On Wed, 25 Apr 2001, Remco Schaar wrote:

 It is very hard to write perfect code,

True, but it's not hard to write code that doesn't leak memory.

void *p = NULL;
...
...
if( p ) { exit(POINTER_ERROR); }
void *p = malloc(n);
...
...
free( p );
p = NULL;
...
...

By which I mean that I use a certain set of pointers for memory
allocation and nothing else.  The pointers are declared and
initialized to NULL in the same statement.  Whenever I free some
memory I set the pointer which was used to point to it back to NULL.
Whenever I use a pointer for memory I first check that its value is
NULL.  Then if I try to use it when it's already being used for
something else my program tells me in a fairly unceremonious fashion.

This is one of a number of defensive techniques I've developed over
the years.  It's better to wrap this kind of stuff in a library of
defensive memory management routines (I expect you can buy one:) as
there's less room for errors and it saves a lot of typing.

Just my $0.02.

Geoff, I expect this will turn out to be one of those threads...

73,
Ged.




Re: Apache growing (memory)

2001-04-25 Thread Remco Schaar

On 25 Apr 2001, Joe Schaefer wrote:

 Kurt George Gjerde [EMAIL PROTECTED] writes:

Hi,

 Even if your script were coded perfectly, it is still possible for this
 to happen in modperl.

 Personally, I would consider an average growth rate of only .5kB/hit 
 absolutely wonderful :)

As far I ever monitored memory usage, apache itself seems to leak some
memory itself as well...
This was when using apache 1.3.9 (debian/potato), and took up to a couple
hunderds of bytes every requests (thus growing a mem-page (4k) every dozen
or so requests per process) serving just static files. It is very hard to
write perfect code, and some work arounds or often the best 
solution... You can consider limiting MaxRequestPerChild in combination
with Apache::GTopLimit, or whatever limits the apache-docs, mod_perl guide
or CPAN modules propose.

Bye,
Remco




Re: modperl/ASP and MVC design pattern

2001-04-25 Thread f . pasqualini

Quoting ed phillips [EMAIL PROTECTED]:

 Francesco Pasqualini wrote:
 
  - Original Message -
  From: [EMAIL PROTECTED]
  To: Francesco Pasqualini [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED]
  Sent: Friday, April 20, 2001 8:11 PM
  Subject: Re: modperl/ASP and MVC design pattern
 
  
   You can (I have) accomplish this with mod_perl and HTML::Mason, Mason's
   root level autohandler can play the role of the JSP model 2
   controller servlet: dispatching logic processing to Perl objects (er,
   beans) and forwarding to a view (with the Mason $m-call_next or
   $m-comp mechanisms).  I think the Apache::Dispatch stuff can also
   perform this role (haven't played with it to say for certain).  I'll
   qualify this by saying MVC is not a end in itself, there are a lot of
   modern requirements for flexible branding, client form factor
 appropriate
   and locale specific presentations that require the view/controller part
 to
   be a lot smarter than the traditional concepts of MVC that I've seen
 call
   for.  I've been referring to these needs in my own engineering
 discussions
   as (yikes) MVC++  :)
 
  ... this is really interesting, can you point me to documentation about
  MVC++
  thanks
  Francesco
 
 Francesco, I believe that Ian was joking, hence the yikes before the name,
 so
 the above post is the documentation!
 
 Ed
 

.. so the best environment for the MVC++ design pattern is parrot/mod_parrot :)
http://www.oreilly.com/news/parrotstory_0401.html

Thanks
Francesco



---
This mail sent through the IMP demo site: demo.horde.org
 Find out more at http://www.horde.org/imp/



Re: modperl/ASP and MVC design pattern

2001-04-25 Thread ed phillips

[EMAIL PROTECTED] wrote:

  Francesco, I believe that Ian was joking, hence the yikes before the name,
  so  the above post is the documentation!
 
  Ed
 

 .. so the best environment for the MVC++ design pattern is parrot/mod_parrot :)
 http://www.oreilly.com/news/parrotstory_0401.html

 Thanks
 Francesco


Exactly!

Wasn't Ian the one responsible for the mod_parrot MVC++ API?

ed






Re: [Patch] Apache-dso_module() to find if a module is loaded as DSO or not

2001-04-25 Thread Jens-Uwe Mager

On Wed, Apr 25, 2001 at 12:49:24PM -0400, Philippe M . Chiasson wrote:

 There is also the strange case of mod_perl leaking memory on graceful
 restarts when compiled as DSO.  But I don't feel like getting into
 this one quite yet.

I would believe that is caused by perl, it does keep its global variable
allocations around. It probably needs a function that destroys all it's
global allocations.

-- 
Jens-Uwe Mager

HELIOS Software GmbH
Steinriede 3
30827 Garbsen
Germany

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



Prblem in loading modules

2001-04-25 Thread Mohammed Azam



Hi,
I am using
perl 5.00503
mod_perl 1.22
apache 1.3.12
aix 4.3.3


I have  recompiled perl 5.00503 after applying patch for dl_aix.xs. Then I
compiled my mod_perl with the following command
perl Makefile.PL \
USE_APXS=1 \
WITH_APXS=/usr/HTTPServer/bin/apxs \
EVERYTHING=1

It compiled without any problem.
It dumps core giving segmentation fault when i try to load modules with
startup.pl file.
I figure it out that I can't load any module which have .so file with my
startup.pl. I have also tried with mensioning proper location for those modules.
But everytime it give segmentation fault and dumps core.

I am attaching the core file whe i used use DBI in startup.pl file below :

[using memory image in core]

Segmentation fault in boot_DBI at 0xd23667d0 ($t1)
0xd23667d0 (boot_DBI+0x14) 8085  l   r4,0x0(r5)
(dbx) where
boot_DBI(0x203553ac) at 0xd23667d0
fcgi_pm_main() at 0xd1479b90
fcgi_pm_main() at 0xd14b57e0
fcgi_pm_main() at 0xd1461ec4
fcgi_pm_main() at 0xd14634cc
fcgi_pm_main() at 0xd1491ec4
fcgi_pm_main() at 0xd148a324
fcgi_pm_main() at 0xd147f48c
fcgi_pm_main() at 0xd1483624
fcgi_pm_main() at 0xd14b57e0
fcgi_pm_main() at 0xd1461ec4
fcgi_pm_main() at 0xd14634cc
fcgi_pm_main() at 0xd1491ec4
fcgi_pm_main() at 0xd148d244
fcgi_pm_main() at 0xd148a650
fcgi_pm_main() at 0xd147f48c
fcgi_pm_main() at 0xd1483624
fcgi_pm_main() at 0xd14b57e0
fcgi_pm_main() at 0xd1460d08
fcgi_pm_main() at 0xd14cab0c
fcgi_pm_main() at 0xd14cbca8
fcgi_pm_main() at 0xd143b598
invoke_cmd() at 0x1001f528
ap_handle_command() at 0x100204d8
ap_srm_command_loop() at 0x10021840
ap_process_resource_config() at 0x10020bd4
include_config() at 0x10037200
invoke_cmd() at 0x1001f418
ap_handle_command() at 0x100204d8
ap_srm_command_loop() at 0x10021840
ap_process_resource_config() at 0x10020bd4
ap_read_config() at 0x100216dc
main() at 0x10001280
(dbx)

can you help me? could you tell me what is wrong? If you need more information
please let me know.

I appreciate your help
Thanks
Azam





Can mod_perl work with Apache 2.0?

2001-04-25 Thread Chad Phillips

Can mod_perl work with Apache 2.0? When I tried to compile mod_perl-1.25
against Apache 2.016 I get this error:

# perl Makefile.PL
Enter `q' to stop search
Please tell me where I can find your apache src
 [] ../httpd-2_0_16
Configure mod_perl with ../httpd-2_0_16 ? [y]
* WARNING *

  Apache Version 1.3.0 required, aborting...

* WARNING *

Thanks
chad




Re: Prblem in loading modules

2001-04-25 Thread Jens-Uwe Mager

On Wed, Apr 25, 2001 at 11:34:53AM -0700, Mohammed Azam wrote:

 perl 5.00503
 mod_perl 1.22
 apache 1.3.12
 aix 4.3.3

That appears to be an unfortunate combination that does not work
properly. Get APache 1.3.19, perl 5.6.1 and the newest modperl from CVS
and the patch I did mention here a few days ago and all should work
fine.

-- 
Jens-Uwe Mager

HELIOS Software GmbH
Steinriede 3
30827 Garbsen
Germany

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



readdir()

2001-04-25 Thread Lincoln Stein

Hi Doug,

Perl 5.6.0 breaks the readdir() function when running under mod_perl.
This is with the most recent versions of Apache and mod_perl, as well
as with older versions.  I see the same problem reported in the
mailing list going back to December 2000, but no hint of a
resolution.  Is there any fix?

Lincoln

-- 

Lincoln D. Stein   Cold Spring Harbor Laboratory
[EMAIL PROTECTED]   Cold Spring Harbor, NY

NOW HIRING BIOINFORMATICS POSTDOCTORAL FELLOWS AND PROGRAMMERS. 
PLEASE WRITE FOR DETAILS.




Child keeps seg faulting

2001-04-25 Thread Mod-Perl List



I have the following config: Solaris 2.7, perl 5.6, php4 and mod_perl 1.25 compiled 
statically into Apache 1.3.19. This exact same config works flawlessly on several
Suse machines and a few Red Hat machines. After building and testing the server, I
get the following error when trying to execute the printenv cgi script that comes
with Apache:
[Wed Apr 25 14:58:04 2001] [notice] Apache/1.3.19 (Unix) PHP/4.0.4pl1 mod_perl/1.25  \
configured -- resuming normal operations
[Wed Apr 25 14:58:07 2001] [notice] child pid 11107 exit signal Segmentation Fault (11)
[Wed Apr 25 14:59:06 2001] [notice] child pid 11108 exit signal Segmentation Fault (11)

Anyone have any ideas?

Thanks,
CC



Re: readdir()

2001-04-25 Thread Andrew Ho

Hello,

LSPerl 5.6.0 breaks the readdir() function when running under mod_perl.
LSThis is with the most recent versions of Apache and mod_perl, as well
LSas with older versions.  I see the same problem reported in the
LSmailing list going back to December 2000, but no hint of a
LSresolution.  Is there any fix?

Are there references to the problem reports? readdir() works fine for me
with Apache 1.3.19, mod_perl 1.25, and Perl 5.6.0 on Solaris 2.7 (x86).

Humbly,

Andrew

--
Andrew Ho   http://www.tellme.com/   [EMAIL PROTECTED]
Engineer   [EMAIL PROTECTED]  Voice 650-930-9062
Tellme Networks, Inc.   1-800-555-TELLFax 650-930-9101
--




Re: readdir()

2001-04-25 Thread Paul J. Lucas

On Wed, 25 Apr 2001, Andrew Ho wrote:

 LSPerl 5.6.0 breaks the readdir() function when running under mod_perl.
 LSThis is with the most recent versions of Apache and mod_perl, as well
 LSas with older versions.  I see the same problem reported in the
 LSmailing list going back to December 2000, but no hint of a
 LSresolution.  Is there any fix?
 
 Are there references to the problem reports? readdir() works fine for me
 with Apache 1.3.19, mod_perl 1.25, and Perl 5.6.0 on Solaris 2.7 (x86).

AFAIK, it's broken only under Linux and then only when using
glibc2.2.  It works fine under glibc2.1.

- Paul




Is this startup.pl ok?

2001-04-25 Thread Philip Mak

My Apache with modperl is acting weird with respect to memory usage.

When it first starts up, each process uses 10 MB of memory.

As time goes on, these processes' memory usage grows and grows. Right now
they're 20 MB (uptime 2 days). When I rebooted the machine two days ago,
they were using 80 MB each (shared memory, though). MaxRequestsPerChild is
set to 200.

Here are my startup.pl files; I was wondering if they were correct? (The
startup.pl in /home/animel is inside a VirtualHost container.)

root@trapezoid [/etc/httpd/conf]# egrep startup.pl *.conf
httpd_modperl.conf:PerlRequire /usr/local/apache/conf/startup.pl
httpd_modperl.conf:PerlRequire /home/animel/www/include/startup.pl
root@trapezoid [/etc/httpd/conf]# cat /usr/local/apache/conf/startup.pl
#!/usr/bin/perl

use strict;

use DBI ();
use DBD::mysql ();

1;
root@trapezoid [/etc/httpd/conf]# cat /home/animel/www/include/startup.pl
#!/usr/bin/perl

# For security reasons, this file is owned by root.

use lib qw(/home/animel/www/include);

1;

-Philip Mak ([EMAIL PROTECTED])




Re: [Patch] Apache-dso_module() to find if a module is loaded asDSO or not

2001-04-25 Thread Stas Bekman

  Currently I think there is a slight bug in the latest mod_perl 1.x,
  where PerlRequire doesn't work as require() in Perl per se on restart. A
  few people have reported this behavior.
 
  So as a quick workaround do this:
 
  start.pl:
  -
  require real-startup.pl;
 
  this require(), won't be called twice.

 I know that, but my problem is that I need to call an init() function
 in a loaded library that can't be called twice ;-(

Right, put this init call into real-startup.pl and it won't be called
twice.

   I guess it could be usefull for other purposes to, so here is the patch.
 
  I'm not underestimating the power of your patch of course :) I think the
  real fix should be in PerlRequire.

 Yeah, Matt said he could use it ;-)

sure, but that's a different matter. I say that PerlModule and PerlRequire
have a bug, which should be fixed. It's just that your problem made me
reiterate the problem.

  BTW, the same problem happens to PerlModule. I've moved all my preloadings
  into the Perl domain, mod_perl reloads them twice.

 I agree, I experienced the strange differences between PerlModule Foo 
 Perluse Foo;/Perl ;-(

 I guess that problem couold be fixed usign perl_module-dynamic_load_handle.
 That way code like PerlModule and such could figure out if they should
 skip the first run or not.

 I wouldn't mind volunteering to look at this problem and suggest a fix. It's
 been annoying for a long time now.

That would be cool :)

 There is also the strange case of mod_perl leaking memory on graceful
 restarts when compiled as DSO.  But I don't feel like getting into
 this one quite yet.

True, one of the reasons why I don't use DSO. I guess Doug dedicates all
his time on 2.0, and rather not do anything else than the critical bug
fixing for 1.x. But if anybody sends a patch in, the thing will be
probably added. Doug, please correct me if I'm wrong.

_
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/





mod_perl DSO leaking on restart?

2001-04-25 Thread Philip Mak

On Thu, 26 Apr 2001, Stas Bekman wrote:

  There is also the strange case of mod_perl leaking memory on graceful
  restarts when compiled as DSO.  But I don't feel like getting into
  this one quite yet.

Hmm. My httpd was using 20 MB. I did apachectl graceful ten times, and
the usage jumped to 24 MB. Then I did apachectl graceful another ten
times, and the usage jumped to 29 MB.

I guess that's the reason (or one of them) that my httpd grows bigger and
bigger as time passes. My mod_perl is a DSO (I run two copies of httpd,
one without mod_perl and one with; I set it up as a DSO since this way I
only need one executable). Should I recompile it statically linked?

-Philip Mak ([EMAIL PROTECTED])




apachecon/tpc and mod_perl 2.0

2001-04-25 Thread Stas Bekman

So ApacheCon was cool and loaded with mod_perl talks. You gotta read Nat's
comments from the last ApacheCon about mod_perl at his journal:
http://use.perl.org/journal.pl?op=displayuid=29start=5

Why? Remember last year we have talked about having a dedicated mod_perl
conference? And Nat promised us to make everything to have at least a
dedicated mod_perl track at the Perl Conference. Nat has kept his promise
and thanks to him we have a load of mod_perl talks at the upcoming TPC:

We have 6 tutorials (18 hours!)
http://conferences.oreillynet.com/cs/os2001/pub/10/mod_perl_tutorials.html

We have 16 sessions (10+ hours!)
http://conferences.oreillynet.com/cs/os2001/pub/w/os2001/sessions_modperl.html

Which gives about 28 hours of pure mod_perl. Nat rules!!!

So make sure to be there in crowds, so on the next conference we get this
amount of hours and more to cover mod_perl.

There are so many interesting talks to go to (not only in the modperl
domain), I really don't know what to do. I guess I'll end up jumping from
session to session, just to see people talking and then read the handouts
:( Oh, if you choose to go with Damian Conway's track, then you don't need
to worry.  You have him talking for almost all 5 days non-stop :) A good
choice :)

So to conclude this email, I want to thank Nat for giving us the mod_perl
track at the upcoming TPC, and hope that they will keep it in the future.

BTW, in Nat's story he incorrectly links to Doug's home page as a source
for mod_perl 2.0 cvs snapshots. Instead you want to go here:
http://perl.apache.org/from-cvs/modperl-2.0/ (you probably need to
subscribe to the dev list ([EMAIL PROTECTED]) if you like
playing with fire).

(Nat: it's too bad that this link at the top of my post will point to the
wrong place, after you add a few more stories, as there is no way to
directly link to the entry in your journal.)

_
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: readdir()

2001-04-25 Thread Mathew Hennessy

Hi,
I'm also experiencing issues using readdir() under mod_perl 
v1.25/apache 1.3.19 on a perl 5.6.1 system freshly compiled in RH7.1 + 
gcc 2.96/glibc 2.2.  I _can_ get correct behavior when running readdir() 
in perl -e on the command line, but when run thru mod_perl/apache it 
returns null/empty.  It's strange: I keep trying to run finds against 
the  mod_perl and apache source code to detect readdir, and I get hardly 
anything useful..  I wonder where the breakdown is :p

A temporary workaround is to shell out and do a find -maxdepth 1, 
but that's unworkable for anything beyond my own toy use :p..

Cheers,
- Matt



Re: readdir()

2001-04-25 Thread Stas Bekman

On Thu, 26 Apr 2001, Mathew Hennessy wrote:

 Hi,
   I'm also experiencing issues using readdir() under mod_perl
 v1.25/apache 1.3.19 on a perl 5.6.1 system freshly compiled in RH7.1 +
 gcc 2.96/glibc 2.2.  I _can_ get correct behavior when running readdir()
 in perl -e on the command line, but when run thru mod_perl/apache it
 returns null/empty.  It's strange: I keep trying to run finds against
 the  mod_perl and apache source code to detect readdir, and I get hardly
 anything useful..  I wonder where the breakdown is :p

   A temporary workaround is to shell out and do a find -maxdepth 1,
 but that's unworkable for anything beyond my own toy use :p..

use glob() or the diamond operator *, the suggested workarounds in the
two threads from the past (see the archives).

Of course this should be resolved.

_
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: [Patch] Apache-dso_module() to find if a module is loaded asDSO or not

2001-04-25 Thread Doug MacEachern

On Thu, 26 Apr 2001, Stas Bekman wrote:
 
 sure, but that's a different matter. I say that PerlModule and PerlRequire
 have a bug, which should be fixed. It's just that your problem made me
 reiterate the problem.

patch below fixes.  problem was the reference to
@Apache::ReadConfig::PerlConfig created an entry in %Apache::ReadConfig::,
which triggered perl_section_self_boot() to delete $INC{$startup_pl}

i think that using *Apache::ReadConfig elsewhere will still trigger the
double loading of all Perl{Require,Module}s, but i doubt the people
suffering from the double load problem are using that feature.  so i'll
deal with that later.

 True, one of the reasons why I don't use DSO. I guess Doug dedicates all
 his time on 2.0, and rather not do anything else than the critical bug
 fixing for 1.x. But if anybody sends a patch in, the thing will be
 probably added. Doug, please correct me if I'm wrong.

i am still committed to supporting 1.xx, its just a matter of time.  of
course it is much more fun working on the new stuff :)

--- Apache/Apache.pm2001/01/29 16:07:08 1.62
+++ Apache/Apache.pm2001/04/26 05:16:08
@@ -30,7 +30,10 @@
 
 sub httpd_conf {
 shift;
-push @Apache::ReadConfig::PerlConfig,
+no strict 'refs';
+#use a symbolic reference so %Apache::ReadConfig::
+#is empty at compile time
+push @{Apache::ReadConfig::PerlConfig},
   map $_\n, @_;
 }
 





problem compiling under win98

2001-04-25 Thread pascal.barbedor




Hi 

i have succesfully compiled apache 1_3.19 under win 98 with 
vc6 and dsw project


I'm trying to compile mod_perl 1_25 under windows 98 the same 
way 

i downloaded the source 1_25 and found themodperl.dsp for vc++ compiling



i followed the install.win32 notes but when compiling there 
are missing files :

these files (apache.c etc...) do not exist anywhere on my 
disc, are they supposed to be generated 


***

fatal error C1083: Cannot open source file: 
'C:\mod_perl-1.25\src\modules\perl\Apache.c': No such file or 
directoryConnection.cfatal error C1083: Cannot open source file: 
'C:\mod_perl-1.25\src\modules\perl\Connection.c': No such file or 
directoryConstants.cfatal error C1083: Cannot open source file: 
'C:\mod_perl-1.25\src\modules\perl\Constants.c': No such file or 
directoryFile.cfatal error C1083: Cannot open source file: 
'C:\mod_perl-1.25\src\modules\perl\File.c': No such file or 
directoryLog.cfatal error C1083: Cannot open source file: 
'C:\mod_perl-1.25\src\modules\perl\Log.c': No such file or 
directorymod_perl.cc:\apache_1.3.19\src\include\ap_config.h(114) : fatal 
error C1083: Cannot open include file: 'os.h': No such file or 
directorymod_perl_opmask.cc:\apache_1.3.19\src\include\ap_config.h(114) 
: fatal error C1083: Cannot open include file: 'os.h': No such file or 
directoryperl_config.cc:\apache_1.3.19\src\include\ap_config.h(114) : 
fatal error C1083: Cannot open include file: 'os.h': No such file or 
directoryperl_util.cc:\apache_1.3.19\src\include\ap_config.h(114) : 
fatal error C1083: Cannot open include file: 'os.h': No such file or 
directoryperlio.cc:\apache_1.3.19\src\include\ap_config.h(114) : fatal 
error C1083: Cannot open include file: 'os.h': No such file or 
directoryServer.cfatal error C1083: Cannot open source file: 
'C:\mod_perl-1.25\src\modules\perl\Server.c': No such file or 
directoryTable.cfatal error C1083: Cannot open source file: 
'C:\mod_perl-1.25\src\modules\perl\Table.c': No such file or 
directoryURI.cfatal error C1083: Cannot open source file: 
'C:\mod_perl-1.25\src\modules\perl\URI.c': No such file or 
directoryUtil.cfatal error C1083: Cannot open source file: 
'C:\mod_perl-1.25\src\modules\perl\Util.c': No such file or directoryError 
executing cl.exe.

mod_perl.so - 14 error(s), 1 
warning(s)***





i also tried with perl makefile.pl which works but then nmake 
install does not work

any help available ?




cvs commit: modperl-2.0/src/modules/perl mod_perl.c

2001-04-25 Thread dougm

dougm   01/04/25 09:19:45

  Modified:src/modules/perl mod_perl.c
  Log:
  fix #ifndef USE_ITHREADS
  
  Revision  ChangesPath
  1.50  +1 -1  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.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- mod_perl.c2001/04/19 18:08:08 1.49
  +++ mod_perl.c2001/04/25 16:19:44 1.50
  @@ -17,7 +17,7 @@
   perl_free(perl);
   
   if (handles) {
  -modperl_xs_dl_handles_close(handles);
  +modperl_xs_dl_handles_close(cdata-pool, handles);
   }
   
   return APR_SUCCESS;
  
  
  



cvs commit: modperl-2.0/pod modperl_style.pod

2001-04-25 Thread dougm

dougm   01/04/25 08:25:46

  Modified:pod  modperl_style.pod
  Log:
  fix typo
  
  Revision  ChangesPath
  1.3   +1 -1  modperl-2.0/pod/modperl_style.pod
  
  Index: modperl_style.pod
  ===
  RCS file: /home/cvs/modperl-2.0/pod/modperl_style.pod,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- modperl_style.pod 2001/02/18 22:00:48 1.2
  +++ modperl_style.pod 2001/04/25 15:25:45 1.3
  @@ -106,7 +106,7 @@
   =item Avoid inherting from certain modules
   
   Exporter 
  -To void inherting BAutoLoader::AUTOLOAD
  +To avoid inherting BAutoLoader::AUTOLOAD
   
instead of this:
   
  
  
  



cvs commit: modperl/Apache Apache.pm

2001-04-25 Thread dougm

dougm   01/04/25 22:30:46

  Modified:.Changes
   Apache   Apache.pm
  Log:
  fix double-loading bug of Perl{Require,Module}s at startup time
  
  Revision  ChangesPath
  1.588 +2 -0  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.587
  retrieving revision 1.588
  diff -u -r1.587 -r1.588
  --- Changes   2001/04/17 22:39:06 1.587
  +++ Changes   2001/04/26 05:30:44 1.588
  @@ -10,6 +10,8 @@
   
   =item 1.25_01-dev
   
  +fix double-loading bug of Perl{Require,Module}s at startup time
  +
   improve Apache::MyConfig [Stas Bekman [EMAIL PROTECTED]]
   
   back out 'stop win32 crash when bringing down service' change, no
  
  
  
  1.63  +4 -1  modperl/Apache/Apache.pm
  
  Index: Apache.pm
  ===
  RCS file: /home/cvs/modperl/Apache/Apache.pm,v
  retrieving revision 1.62
  retrieving revision 1.63
  diff -u -r1.62 -r1.63
  --- Apache.pm 2001/01/29 16:07:08 1.62
  +++ Apache.pm 2001/04/26 05:30:45 1.63
  @@ -30,7 +30,10 @@
   
   sub httpd_conf {
   shift;
  -push @Apache::ReadConfig::PerlConfig,
  +no strict 'refs';
  +#use a symbolic reference so %Apache::ReadConfig::
  +#is empty at compile time
  +push @{Apache::ReadConfig::PerlConfig},
 map $_\n, @_;
   }