Re: Apache::ServerUtil pb in modperl2

2002-04-15 Thread Stas Bekman

pascal barbedor wrote:
 
 
 apache 2.0.35 / mod_perl 1.99_01 / winnt or win2k

You don't say which perl version you are using. Please remember to run 
t/REPORT when sending bug reports. If this is 5.6.0 before we continue, 
first update to 5.6.1. 5.6.0 is very buggy. 5.6.1 is very stable.

 I confirm that using a module in startup.pl consisting of
 
 
use Data::Dumper ;
use XML::LibXML() ;

[1] use Apache::ServerUtil ;
[2] my $s=Apache-server ;
[3] my $base=$s-dir_config('some');
[4] my $xml=XML::LibXML-new();
[5] print Dumper $xml ;

I cannot reproduce this problem with the same setup and perl 5.6.1 on 
linux. i.e. I run the whole test suite without any segfaults.

 here is a backtrace in case useful
 
 PERL56! 28021683()
 PERL56! 28071c17()
 PERL56! 2805c910()

you realize that this bt is not useful :) even if we knew to do the 
easily pointer
arithmetics in our head :) You need to recompile your perl and mod_perl 
with debugging enabled.
(at least mod_perl to start with). Use MP_DEBUG=1 when building mod_perl 
2.0's Makefile.PL.
I'll prepare a proper doc how to build mod_perl for debuggging and 
report bugs with 2.0.

For now if you need to recompile perl with debug mode on please use the 
info at: 
http://perl.apache.org/preview/modperl-docs/dst_html/docs/1.0/guide/help.html#How_to_Report_Problems

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




Re: Apache::ServerUtil pb in modperl2

2002-04-15 Thread Randy Kobes

On Sat, 13 Apr 2002, pascal barbedor wrote:

  Does the following, or some variation, work?
[ .. ]
  sub handler {
  my $r = shift;
  my $key = $r-dir_config-get('TEST');
  $r-content_type('text/plain');
  $r-print($key);
  Apache::OK;
  }

 yes it works perfectly well.

 but you are accessing dir_config through a request object and
 in my example I am accessing it through the server object in
 a use module in startup.pl

I just wanted to verify that accessing it this way worked ... On
my XP machine (ActivePerl 631, based on perl-5.6.1) and with
httpd-2/modperl-2 from cvs I too find that accessing dir_config
values from a server object doesn't work - it just returns an
empty value. The modperl-2 server object tests run OK, but the
dir_config tests result in a server error when trying to set a
dir_config value from the request object (this occurs after the
tests involving getting a value, but before accessing it from the
server object). I've verified that accessing dir_config thru a
server object gives an APR::Table object, and the table tests
pass; this looks like a more detailed analysis is needed ...

best regards,
randy




Re: Apache::ServerUtil pb in modperl2

2002-04-13 Thread pascal barbedor




apache 2.0.35 / mod_perl 1.99_01 / winnt or win2k

I confirm that using a module in startup.pl consisting of

use Data::Dumper ;
use XML::LibXML() ;

[1] use Apache::ServerUtil ;
[2] my $s=Apache-server ;
[3] my $base=$s-dir_config('some');
[4] my $xml=XML::LibXML-new();
[5] print Dumper $xml ;

causes the line [3] to output message Attempt to free
unreferenced scalar

line [4] causes apache segfaults unhandled exception
perl56.dll (XML::LibXML in version 1.31 or 1.40)

line [5] is executed before apache stops
$VAR1 = bless( {}, 'XML::LibXML' );

here is a backtrace in case useful

PERL56! 28021683()
PERL56! 28071c17()
PERL56! 2805c910()
PERL56! 2805c5b1()
PERL56! 2805c577()
PERL56! 2805c577()
PERL56! 2805c870()
PERL56! 2805ba24()
PERL56! 2800c882()
PERL56! 2805c7f3()
PERL56! 2805ba24()
PERL56! 2800c882()
PERL56! 2805b9fd()
PERL56! 2800c882()
PERL56! 2805b9fd()
PERL56! 2800c882()
PERL56! 2805b9fd()
PERL56! 2800c882()
PERL56! 2805c248()
PERL56! 2805d510()
PERL56! 2805d16f()
MOD_PERL! 10001fb3()
MOD_PERL! 10002a22()
MOD_PERL! 10001840()
MOD_PERL! 10001796()
ap_run_post_config(apr_pool_t * 0x0078a830, apr_pool_t * 0x007ba660,
apr_pool_t * 0x007bc6a8, server_rec * 0x007a2508) line 130 + 89 bytes
main(int 1, const char * const * 0x00782760) line 569 + 22 bytes
mainCRTStartup() line 338 + 17 bytes
KERNEL32! 77e77903()


if I drop line [4] and [5], there is the line [3] message, but
apache does not seem to segfault.




pascal









Accédez au courrier électronique de La Poste : www.laposte.net ; 3615
LAPOSTENET (0,13 ?/mn) ; tél : 08 92 68 13 50 (0,34?/mn)







Re: Apache::ServerUtil pb in modperl2

2002-04-13 Thread pascal barbedor

 Does the following, or some variation, work?

 ==
 package Apache::Test;

 # PerlModule Apache::Test
 # Location /hello-world
 #   SetHandler modperl
 #   PerlResponseHandler Apache::Test
 #   PerlSetVar TEST jdjdsds
 # /Location

 use strict;

 # based on t/conf/modperl_extra.pl in the mod_perl-2 sources
 use Apache::RequestRec ();
 use Apache::RequestIO ();
 use Apache::ServerUtil ();
 use Apache::RequestUtil ();
 use APR::Table;
 use Apache::Const -compile = qw(:common);
 use APR::Const -compile = qw(:common);

 sub handler {
 my $r = shift;
 my $key = $r-dir_config-get('TEST');
 $r-content_type('text/plain');
 $r-print($key);
 Apache::OK;
 }

 1;

 ===

 best regards,
 randy kobes



yes it works perfectly well.

but you are accessing dir_config through a request object and in my example
I am accessing it through the server object in a use module in startup.pl


best regards
pascal









Apache::ServerUtil pb in modperl2

2002-04-12 Thread [EMAIL PROTECTED]

Hi

apache 2.0.35 / mod_perl 1.99_01 / winnt

I confirm that using a module in startup.pl consisting of

use Data::Dumper ;
use XML::LibXML() ;

[1] use Apache::ServerUtil ;
[2] my $s=Apache-server ;
[3] my $base=$s-dir_config('some');
[4] my $xml=XML::LibXML-new();
[5] print Dumper $xml ;

causes the line [3] to output message Attempt to free
unreferenced scalar

line [4] causes apache segfaults unhandled exception
perl56.dll (XML::LibXML in version 1.31 or 1.40)

line [5] is executed before apache stops
$VAR1 = bless( {}, 'XML::LibXML' );


if I drop line [4] and [5], there is the line [3] message, but
apache does not seem to segfault.




pascal









Accédez au courrier électronique de La Poste : www.laposte.net ; 3615 LAPOSTENET (0,13 
€/mn) ; tél : 08 92 68 13 50 (0,34€/mn)






Re: Apache::ServerUtil pb in modperl2

2002-04-12 Thread Randy Kobes

On Thu, 11 Apr 2002, pascal barbedor wrote:

 I have a problem with Apache::ServerUtil though :

 when using $s-dir_config('some') i have this message (and apache segfaults)

 Attempt to free unreferenced scalar at .. line 17

 i have installed modperl through ppd, so have not the t/report procedure
 i am under win2k ppd from theoryx5, ASperl build 631

 for now the only lines in httpd.conf concerning modperl are

 perlsetvar statpath path
 perlrequire startup.pl

 then,
 in startup.pl :
 use Apache2;
 use Apache::ServerUtil();
 use Apache::Const();

 use Mymodule();
 --

 in Mymodule.pm

 use Apache::ServerUtil;
 my $s=Apache-server;
 [and the incriminated line 17: ] my $base=$s-dir_config('StatPath');

Does the following, or some variation, work?

==
package Apache::Test;

# PerlModule Apache::Test
# Location /hello-world
#   SetHandler modperl
#   PerlResponseHandler Apache::Test
#   PerlSetVar TEST jdjdsds
# /Location

use strict;

# based on t/conf/modperl_extra.pl in the mod_perl-2 sources
use Apache::RequestRec ();
use Apache::RequestIO ();
use Apache::ServerUtil ();
use Apache::RequestUtil ();
use APR::Table;
use Apache::Const -compile = qw(:common);
use APR::Const -compile = qw(:common);

sub handler {
my $r = shift;
my $key = $r-dir_config-get('TEST');
$r-content_type('text/plain');
$r-print($key);
Apache::OK;
}

1;

===

best regards,
randy kobes





Apache::ServerUtil pb in modperl2

2002-04-11 Thread pascal barbedor

Hi thanks for preceeding answer

I had missed this doc.

I have a problem with Apache::ServerUtil though :

when using $s-dir_config('some') i have this message (and apache segfaults)
:

Attempt to free unreferenced scalar at .. line 17

i have installed modperl through ppd, so have not the t/report procedure
i am under win2k ppd from theoryx5, ASperl build 631

for now the only lines in httpd.conf concerning modperl are

perlsetvar statpath path
perlrequire startup.pl

then,
in startup.pl :
use Apache2;
use Apache::ServerUtil();
use Apache::Const();

use Mymodule();
--

in Mymodule.pm

use Apache::ServerUtil;
my $s=Apache-server;
[and the incriminated line 17: ] my $base=$s-dir_config('StatPath');



pascal






Re: Apache::ServerUtil pb in modperl2

2002-04-11 Thread Stas Bekman

pascal barbedor wrote:
 Hi thanks for preceeding answer
 
 I had missed this doc.
 
 I have a problem with Apache::ServerUtil though :
 
 when using $s-dir_config('some') i have this message (and apache segfaults)

can you get a backtrace and send here?

Also try building from scratch and see if 'make test' passes for you. 
That would be the best help, instead of trying to use pre-compiled 
binaries at this point.

 Attempt to free unreferenced scalar at .. line 17
 
 i have installed modperl through ppd, so have not the t/report procedure
 i am under win2k ppd from theoryx5, ASperl build 631


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