Build error, requiring threads when threads are not built in

2012-07-12 Thread Susan
 

I keep getting this error trying to build the dso mod_perl2 with
apache2. Httpd was built with mpm-prefork, perl was not compiled with
threads. below are configure options. 

this is the build error with the
configure options: 

root [ ~/.cpan/build/mod_perl-2.0.7-gdtpWS ]# perl
Makefile.PL MP_APXS=/usr/bin/apxs MP_APR_CONFIG=/usr/bin/apr-1-config 
>
MP_USE_DSO=1 MP_AP_CONFIGURE="--with-mpm=prefork"
Reading Makefile.PL
args from @ARGV
 MP_APXS = /usr/bin/apxs
 MP_APR_CONFIG =
/usr/bin/apr-1-config
 MP_USE_DSO = 1
 MP_AP_CONFIGURE =
--with-mpm=prefork
no conflicting prior mod_perl version found -
good.
Configuring Apache/2.4.2 mod_perl/2.0.7 Perl/v5.14.2
[ error]
Using Perl 5.014002 w/o ithreads and 'dynamic' mpm httpd.
[ error]
Failed requirements:
[ error] - Perl built with ithreads (build perl
with -Dusethreads) 

 

this is config info from apache and
perl: 

root [ ~/.cpan/build/mod_perl-2.0.7-gdtsWQ ]# httpd -V
Server
version: Apache/2.4.2 (Unix)
Server loaded: APR 1.4.6, APR-UTIL
1.4.1
Compiled using: APR 1.4.6, APR-UTIL 1.4.1
Architecture:
32-bit
Server MPM: prefork
 threaded: no
 forked: yes (variable process
count) 

root [ ~/.cpan/build/mod_perl-2.0.7-gdtsWQ ]# perl -V
Summary
of my perl5 (revision 5 version 14 subversion 2) configuration: 


Platform:
 osname=linux, osvers=3.2.15, archname=i686-linux

uname='linux c5 3.2.15 #0 smp sat apr 28 12:52:13 edt 2012 i686 gnulinux
'
 config_args='-des -isR -Duseshrplib'
 hint=recommended,
useposix=true, d_sigaction=define
 useithreads=undef,
usemultiplicity=undef
 useperlio=define, d_sfio=undef,
uselargefiles=define, usesocks=undef
 use64bitint=undef,
use64bitall=undef, uselongdouble=undef
 usemymalloc=n,
bincompat5005=undef 

--- 

any help would be appreciated. I do not want
threads compiled into perl. 

Susan 

Message 1 of 90 
 

Re: [mod_perl2]: Install error with Makefile.PL - uninitialized value at TestRun.pm

2012-07-16 Thread Susan
 

Ok. I finally got it to glue together with apache 2.2.22, perl
5.14.2, and mod_perl 2.0.7. The perl can probably be upgraded to newest.


However, mod_perl 2.0.7 will NOT do a static build (as daniel states
below, tho that looks real good otherwise) with large file support
enabled and no perl thread support enabled. It throws constant errors in
various places -> error: unknown type name 'off64_t'. 

So it appears it
has to be built as a dso under those circumstances, and that goes pretty
smoothly with httpd installed first, --with-mpm=prefork and any other
apache options enabled, as a dso it or something else can be unloaded
anyway if memory issues with ssl, for instance, are an issue as the
mod_perl (1) docs state. 

Fred's patch is a lifesaver, so patch first:


Index:
lib/Apache/TestRun.pm
===
---
lib/Apache/TestRun.pm(revision 1359945)
+++
lib/Apache/TestRun.pm(working copy)
@@ -1097,6 +1097,9 @@

 my %args =
@Apache::TestMM::Argv;
 while (my($k, $v) = each %args) {
+ unless
(defined $v) {
+ die "key $k has no value";
+ }
 $v =~ s/|/\|/g;
 $body
.= "n$Apache::TestConfig::Argv{'$k'} = q|$v|;n";
 } 

and the makefile
cmd I used is: 

[mod_perl-2.0.7 ]# perl Makefile.PL MP_USE_DSO=1
MP_APR_CONFIG=/usr/local/bin/apr-1-config MP_APXS=/srv/httpd/sbin/apxs


configures without error, 'make' without error, 'make test' without
error, and then 'make install'. 

thanks for your help! 

Susan


= 

On
2012-07-15 09:40, Daniel Boerner wrote: 

> Hi Fred, Hi Todd
> I just
subscribed to this list and still don't know how to link my message to
your thread from July 10th. Sorry.
> I just want to show you my
workaround of the same problem: "Install error with Makefile.PL -
uninitialized value at TestRun.pm"
> 
> Here my proceedings aiming at a
statically mod_perl Apache with Perl 5.14.2 on Debian "squeeze" Linux:
>

> cd ~/src
> tar -xvzf perl-5.14.2.tar.gz
> cd perl-5.14.2
> mkdir
"$HOME/perl"
> ./Configure -des -Dprefix="$HOME/perl" -Dusethreads
>
make
> make test
> make install
> 
> Making some symlinks... (basically
appending a '5' to the name of each executable in the newly installed
$HOME/perl/bin).
> su ./perl_version_links.pl [1] /home/dani
/usr/local/bin
> 
> Some prerequisites:
> cpan5
> install CPAN
> reload
cpan5
> exit
> 
> cpan5
> install YAML
> install LWP
> install CGI
>
install Chatbot::Eliza
> install Compress::Zlib
> install
Devel::CoreStack
> install Devel::Symdump
> install Digest::MD5
>
install IPC::Run3
> exit
> 
> And now, making up a statically mod_perl
Apache server:
> 
> cd ~/src
> tar -xvzf httpd-2.2.22.tar.gz
> tar -xvzf
mod_perl-2.0-current.tar.gz
> 
> mkdir "$HOME/apache2"
> cd
mod_perl-2.0.7/
> perl5 Makefile.PL MP_USE_STATIC=1
MP_AP_PREFIX="$HOME/src/httpd-2.2.22"
MP_AP_CONFIGURE="--prefix=$HOME/apache2 --with-mpm=prefork"
MP_COMPAT_1X=0
> 
> Error:
> ERROR from evaluation of
/home/dani/src/mod_perl-2.0.7/Apache-Reload/Makefile.PL: Use of
uninitialized value $v in concatenation (.) or string at
Apache-Test/lib/Apache/TestRun.pm line 1100
> 
> Locating line 1100 and
adding two print statements just before it:
> 
> my %args =
@Apache::TestMM::Argv;
> while (my($k, $v) = each %args) {
> print "-->
$kn";
> print "---> $vn";
> $v =~ s/|/\|/g;
> $body .=
"n$Apache::TestConfig::Argv{'$k'} = q|$v|;n";
> }
> 
> Running again:
>
perl5 Makefile.PL MP_USE_STATIC=1 MP_AP_PREFIX="$HOME/src/httpd-2.2.22"
MP_AP_CONFIGURE="--prefix=$HOME/apache2 --with-mpm=prefork"
MP_COMPAT_1X=0
> 
> Result:
> Configuring Apache/2.2.22 mod_perl/2.0.7
Perl/v5.14.2
> --> httpd
> ---> /home/dani/src/httpd-2.2.22/httpd
> -->
apxs
> ERROR from evaluation of
/home/dani/src/mod_perl-2.0.7/Apache-Reload/Makefile.PL: Use of
uninitialized value $v in concatenation (.) or string at
Apache-Test/lib/Apache/TestRun.pm line 1101.
> 
> Ok. As I'm building
mod_perl statically, I don't need apxs so I apply the following
workaround: enclose lines 1100 and 1101 in an if-block testing if $v is
defined: 
> 
> my %args = @Apache::TestMM::Argv;
> while (my($k, $v) =
each %args) {
> if (defined $v) {
> $v =~ s/|/\|/g;
> $body .=
"n$Apache::TestConfig::Argv{'$k'} = q|$v|;n";
> }
> }
> 
> Now, no error
and I could proceed with make:
> 
> make
> make test
> 
> ...
> All
tests successful.
> Files=242, Tests=2469, 427 wallclock secs ( 4.71 usr
0.94 sys + 372.71 cusr 45.48 csys = 423.84 CP

Benchmark!

2012-07-22 Thread Susan

so ok.. I have been using perl for years.. I had an old site online a
looong time which had lots of old perl and really had to 
upgrade..things were real smooth BUT.. so I am doing this mod_perl2 
thing..


and check out the benchmark between the same exact page, which is just 
a test page in written in perl/mod_perl, it loads a real big image, some 
perl output text/html etc.. first in cgi, then (handler) 
apache2::registry, then (handler) apache2::perlrun, it's an amazing 
difference!!


I actually ran the first old type cgi again last to make sure I wasn't 
seeing things.. should have done this a long time ago!


***  ***      ***  ***

root [ /thisplace/apache2/thatplace ]# ab -c1 -n50 
http://10.x.x.x/cgi-bin/pretty1

This is ApacheBench, Version 2.3 <$Revision: 1178079 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, 
http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.x.x.x (be patient).done


Server Software:Apache
Server Hostname:10.x.x.x
Server Port:80

Document Path:  /cgi-bin/pretty1
Document Length:1259 bytes

Concurrency Level:  1
Time taken for tests:   9.234 seconds
Complete requests:  50
Failed requests:0
Write errors:   0
Total transferred:  74950 bytes
HTML transferred:   62950 bytes
Requests per second:5.41 [#/sec] (mean)
Time per request:   184.673 [ms] (mean)
Time per request:   184.673 [ms] (mean, across all concurrent 
requests)

Transfer rate:  7.93 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:00   0.0  0   0
Processing:   182  184   3.6184 201
Waiting:  177  181   4.0181 199
Total:182  185   3.6184 201

Percentage of the requests served within a certain time (ms)
  50%184
  66%184
  75%185
  80%185
  90%186
  95%187
  98%201
  99%201
 100%201 (longest request)

root [ /thisplace/apache2/thatplace ]# ab -c1 -n50 
http://10.x.x.x/registry/pretty1

This is ApacheBench, Version 2.3 <$Revision: 1178079 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, 
http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.x.x.x (be patient).done


Server Software:Apache
Server Hostname:10.x.x.x
Server Port:80

Document Path:  /registry/pretty1
Document Length:1396 bytes

Concurrency Level:  1
Time taken for tests:   0.207 seconds
Complete requests:  50
Failed requests:0
Write errors:   0
Total transferred:  75600 bytes
HTML transferred:   69800 bytes
Requests per second:240.96 [#/sec] (mean)
Time per request:   4.150 [ms] (mean)
Time per request:   4.150 [ms] (mean, across all concurrent 
requests)

Transfer rate:  355.80 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:00   0.0  0   0
Processing: 34   1.8  3   9
Waiting:03   1.2  2   6
Total:  34   1.8  3   9

Percentage of the requests served within a certain time (ms)
  50%  3
  66%  3
  75%  5
  80%  6
  90%  7
  95%  7
  98%  9
  99%  9
 100%  9 (longest request)

root [ /thisplace/apache2/thatplace ]# ab -c1 -n50 
http://10.x.x.x/perlrun/pretty1

This is ApacheBench, Version 2.3 <$Revision: 1178079 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, 
http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.x.x.x (be patient).done


Server Software:Apache
Server Hostname:10.x.x.x
Server Port:80

Document Path:  /perlrun/pretty1
Document Length:1396 bytes

Concurrency Level:  1
Time taken for tests:   0.331 seconds
Complete requests:  50
Failed requests:0
Write errors:   0
Total transferred:  75600 bytes
HTML transferred:   69800 bytes
Requests per second:151.15 [#/sec] (mean)
Time per request:   6.616 [ms] (mean)
Time per request:   6.616 [ms] (mean, across all concurrent 
requests)

Transfer rate:  223.18 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:00   0.0  0   0
Processing: 56   1.7  5   9
Waiting:04   0.9  4   7
Total:  56   1.7  5   9

Percentage of the requests served within a certain time (ms)
  50%  5
  66%  8
  75%  8
  80%  9
  90%  9
  95%  9
  98%  9
  99%  9
 100%  9 (longest request)

root [ /thisplace/apache2/thatplace ]# ab -c1 -n50 
http://10.x.x.x/cgi-bin/pretty1

This is ApacheBench, Version 2.3 <$Revision: 1178079 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, 
http://www.zeustech.net/

Licensed to 

Re: [mod_perl2]: Install error with Makefile.PL - uninitialized value at TestRun.pm

2012-07-25 Thread Susan
 

yes thank you, but I am not using threads! 

my dev server is
already kind of low on memory all the time.. but I will save this for
future reference, thanks! 

On 2012-07-25 15:16, Daniel Boerner wrote:


> Responding to Susan (about not a static build with large file
support, thread support...) here my
> perl5 -V:
> 
> Summary of my perl5
(revision 5 version 14 subversion 2) configuration:
> 
> Platform:
>
osname=linux, osvers=2.6.32-5-amd64,
archname=x86_64-linux-thread-multi
> uname='linux oak 2.6.32-5-amd64 #1
smp sun may 6 04:00:17 utc 2012 x86_64 gnulinux '
> config_args='-des
-Dprefix=/home/dani/perl -Dusethreads'
> hint=recommended,
useposix=true, d_sigaction=define
> useithreads=define,
usemultiplicity=define
> useperlio=define, d_sfio=undef,
uselargefiles=define, usesocks=undef
> use64bitint=define,
use64bitall=define, uselongdouble=undef
> usemymalloc=n,
bincompat5005=undef
> Compiler:
> cc='cc', ccflags ='-D_REENTRANT
-D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
>
optimize='-O2',
> cppflags='-D_REENTRANT -D_GNU_SOURCE
-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
>
ccversion='', gccversion='4.4.5', gccosandvers=''
> intsize=4,
longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
>
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
>
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
> alignbytes=8, prototype=define
> Linker and Libraries:
>
ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
>
libpth=/usr/local/lib /lib/../lib /usr/lib/../lib /lib /usr/lib /lib64
/usr/lib64
> libs=-lnsl -lgdbm -ldl -lm -lcrypt -lutil -lpthread -lc
-lgdbm_compat
> perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
>
libc=/lib/libc-2.11.3.so [7], so=so, useshrplib=false,
libperl=libperl.a
> gnulibc_version='2.11.3'
> Dynamic Linking:
>
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
>
cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib
-fstack-protector'
> 
> Characteristics of this binary (from libperl):

> Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
>
PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
> PERL_PRESERVE_IVUV
USE_64_BIT_ALL USE_64_BIT_INT
> USE_ITHREADS USE_LARGE_FILES USE_PERLIO
USE_PERL_ATOF
> USE_REENTRANT_API
> Built under linux
> Compiled at Jul
8 2012 12:59:50
> @INC:
>
/home/dani/perl/lib/site_perl/5.14.2/x86_64-linux-thread-multi
>
/home/dani/perl/lib/site_perl/5.14.2
>
/home/dani/perl/lib/5.14.2/x86_64-linux-thread-multi
>
/home/dani/perl/lib/5.14.2
> .
> 
> Best,
> Daniel
> 
> 2012/7/16 Susan

> 
>> Ok. I finally got it to glue together with
apache 2.2.22, perl 5.14.2, and mod_perl 2.0.7. The perl can probably be
upgraded to newest. 
>> 
>> However, mod_perl 2.0.7 will NOT do a static
build (as daniel states below, tho that looks real good otherwise) with
large file support enabled and no perl thread support enabled. It throws
constant errors in various places -> error: unknown type name 'off64_t'.

>> 
>> So it appears it has to be built as a dso under those
circumstances, and that goes pretty smoothly with httpd installed first,
--with-mpm=prefork and any other apache options enabled, as a dso it or
something else can be unloaded anyway if memory issues with ssl, for
instance, are an issue as the mod_perl (1) docs state. 
>> 
>> Fred's
patch is a lifesaver, so patch first: 
>> 
>> Index:
lib/Apache/TestRun.pm
>>
===
>>
--- lib/Apache/TestRun.pm(revision 1359945)
>> +++
lib/Apache/TestRun.pm(working copy)
>> @@ -1097,6 +1097,9 @@ 
>> 
>> my
%args = @Apache::TestMM::Argv;
>> while (my($k, $v) = each %args) { +
unless (defined $v) {
>> + die "key $k has no value";
>> + } 
>> 
>> $v
=~ s/|/\|/g;
>> $body .= "n$Apache::TestConfig::Argv{'$k'} =
q|$v|;n";
>> } 
>> 
>> and the makefile cmd I used is: 
>> 
>>
[mod_perl-2.0.7 ]# perl Makefile.PL MP_USE_DSO=1
MP_APR_CONFIG=/usr/local/bin/apr-1-config MP_APXS=/srv/httpd/sbin/apxs

>> 
>> configures without error, 'make' without error, 'make test'
without error, and then 'make install'. 
>> 
>> thanks for your help!

>> 
>> Susan 
>> 
>>
= 
>> 
>> On
2012-07-15 09:40, Daniel Boerner wrote: 
>> 
>>> Hi Fre