RE: Perl_Tstack_sp_ptr

2002-06-13 Thread Doug MacEachern

On Tue, 11 Jun 2002, Paul G. Weiss wrote:

 OK, until I can decide whether to take a chance on FreeBSD-current 
 or to convince my employers who were so enamored of FreeBSD that
 we should rebuild the server with Linux, I'm going prefork.

worth skimming the [EMAIL PROTECTED] archives.  if the issue has 
already been fixed in the freebsd kernel, you'd need to upgrade from 4.5
 
 It still doesn't work precisely as it should though.  I decided
 to go with the cvs builds of apache and mod_perl.  I have to 
 confess that the installation instructions seem strange (both for
 CVS and non-CVS).  You have to build and install Apache in order
 to get the include files to build mod_perl.  Then after doing 
 a make for mod_perl you are supposed to go back to Apache and
 configure, make, make-install -- even though the mod_perl make
 touched nothing in the Apache tree!  I assume after all of this
 you do make install on both Apache and mod_perl although the
 doc doesn't say so.

the docs are broken then.  all you have to do is:
- install perl 
- install apache
- build modperl with:
perl Makefile.PL MP_AP_PREFIX=/usr/local/apache2  make test  make install

 I suppose I could have done --enable-threads in Apache 
 with --with-mpm=prefork and it might have worked.  Is
 that considered kosher?

maybe.  but if you are using prefork, no need to build perl with 
-Dusethreads





Re: Perl_Tstack_sp_ptr

2002-06-11 Thread Stas Bekman

Paul G. Weiss wrote:
 Sorry if this has been covered - I searched to no avail.
 
 I'm getting the following error when trying to start
 an Apache 2.0.36 with ModPerl::Registry:
 
 /usr/libexec/ld-elf.so.1:
 /usr/lib/perl5/site_perl/5.6.1/i386-freebsd-thread-multi/auto/Apache/Request
 Rec/RequestRec.so: Undefined symbol Perl_Tstack_sp_ptr
 
 All relevant build info is below.  Has anyone seen and conquered this?

Confirmed, I've a similar problem on linux with 5.6.1

/home/stas/httpd/prefork/bin/httpd: relocation error: 
/home/stas/apache.org/mp-5.6.1-prefork/ModPerl-Registry/t/../../blib/arch/Apache2/auto/Apache/RequestIO/RequestIO.so:
 
undefined symbol: Perl_sv_2pv

it happens when I run the test suite in:

ModPerl-Registry:

and I've traced it down to:
print exists $ENV{QUERY_STRING}  $ENV{QUERY_STRING};

Though I don't understand why there is relocation error, the libperl.so
lib includes the symbol:
nm 
/home/stas/perl/5.6.1-ithread/lib/5.6.1/i686-linux-thread-multi/CORE/libperl.so 
| grep Perl_sv_2pv
0009ae10 T Perl_sv_2pv

and mod_perl is linked against it:
ldd src/modules/perl/mod_perl.so
libperl.so = 
/home/stas/perl/5.6.1-ithread/lib/5.6.1/i686-linux-thread-multi/CORE/libperl.so 
(0x40023000)


__
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: Perl_Tstack_sp_ptr

2002-06-11 Thread Paul G. Weiss

I should also mention -- my perl is patched with the patch
to DynaLoader.pm that Doug MacEachern posted in this list.

-P

 -Original Message-
 From: Stas Bekman [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, June 11, 2002 4:06 AM
 To: Paul G. Weiss
 Cc: [EMAIL PROTECTED]
 Subject: Re: Perl_Tstack_sp_ptr
 
 
 Paul G. Weiss wrote:
  Sorry if this has been covered - I searched to no avail.
  
  I'm getting the following error when trying to start
  an Apache 2.0.36 with ModPerl::Registry:
  
  /usr/libexec/ld-elf.so.1:
  
 /usr/lib/perl5/site_perl/5.6.1/i386-freebsd-thread-multi/auto/
 Apache/Request
  Rec/RequestRec.so: Undefined symbol Perl_Tstack_sp_ptr
  
  All relevant build info is below.  Has anyone seen and 
 conquered this?
 
 Confirmed, I've a similar problem on linux with 5.6.1
 
 /home/stas/httpd/prefork/bin/httpd: relocation error: 
 /home/stas/apache.org/mp-5.6.1-prefork/ModPerl-Registry/t/../.
./blib/arch/Apache2/auto/Apache/RequestIO/RequestIO.so: 
 undefined symbol: Perl_sv_2pv
 
 it happens when I run the test suite in:
 
 ModPerl-Registry:
 
 and I've traced it down to:
 print exists $ENV{QUERY_STRING}  $ENV{QUERY_STRING};
 
 Though I don't understand why there is relocation error, the 
 libperl.so
 lib includes the symbol:
 nm 
 /home/stas/perl/5.6.1-ithread/lib/5.6.1/i686-linux-thread-mult
 i/CORE/libperl.so 
 | grep Perl_sv_2pv
 0009ae10 T Perl_sv_2pv
 
 and mod_perl is linked against it:
 ldd src/modules/perl/mod_perl.so
   libperl.so = 
 /home/stas/perl/5.6.1-ithread/lib/5.6.1/i686-linux-thread-mult
 i/CORE/libperl.so 
 (0x40023000)
 
 
 __
 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: Perl_Tstack_sp_ptr

2002-06-11 Thread Doug MacEachern

On Tue, 11 Jun 2002, Paul G. Weiss wrote:

 I had already thought of that.  Strace shows that the 
 correct libperl.so is the one that is being loaded.  Just
 to make sure I deleted all others and did 
 
 ln -s /usr/lib/perl5/5.6.1/i386-freebsd-thread-multi/CORE /usr/lib
 
 but strace tells me that it is still directly loading the correct
 one, probably because of the 
 
 -Wl,-R/usr/lib/perl5/5.6.1/i386-freebsd-thread-multi/CORE
 
 used in linking mod_perl.so.

ok.
 
 That being said I tried the LoadFile directive as you suggested.
 This indeed lets the system start, but now it can serve no
 pages ( not even static ones ).  This is true even when all
 mod_perl configuration directive are removed from the conf
 file (except the LoadFile and the LoadModule).
 
 However, when I do httpd -X, it
 works - I can even serve mod_perl content.  But regular httpd
 just hangs.  The strace output of an httpd process shows this:
 
 accept(5, {sin_family=AF_INET6, sin6_port=htons(1303), inet_pton(AF_INET6,
 :::65.204.1.133, sin6_addr), sin6_flowinfo=0}, [28]) = 20

could this be a version of freebsd with broken threads support?  i've 
heard many cases of that.  chances are if you rebuild perl without 
-Dusethreads and apache with the prefork mpm, this problem won't be there.




Re: Perl_Tstack_sp_ptr

2002-06-11 Thread Stas Bekman

could this be a version of freebsd with broken threads support?  i've
  heard many cases of that.  chances are if you rebuild perl without
  -Dusethreads and apache with the prefork mpm, this problem won't be 
there.

so the problem that I see on linux is unrelated?

this tested with prefork Apache cvs and perl built as:
./Configure -des -Dprefix=/home/stas/perl/5.6.1-ithread \
-Dusethreads -Doptimize='-g' -Duseshrplib -Dusedevel

Stas Bekman wrote:
 Paul G. Weiss wrote:
 
 Sorry if this has been covered - I searched to no avail.

 I'm getting the following error when trying to start
 an Apache 2.0.36 with ModPerl::Registry:

 /usr/libexec/ld-elf.so.1:
 /usr/lib/perl5/site_perl/5.6.1/i386-freebsd-thread-multi/auto/Apache/Request 

 Rec/RequestRec.so: Undefined symbol Perl_Tstack_sp_ptr

 All relevant build info is below.  Has anyone seen and conquered this?
 
 
 Confirmed, I've a similar problem on linux with 5.6.1
 
 /home/stas/httpd/prefork/bin/httpd: relocation error: 
 
/home/stas/apache.org/mp-5.6.1-prefork/ModPerl-Registry/t/../../blib/arch/Apache2/auto/Apache/RequestIO/RequestIO.so:
 
 undefined symbol: Perl_sv_2pv
 
 it happens when I run the test suite in:
 
 ModPerl-Registry:
 
 and I've traced it down to:
 print exists $ENV{QUERY_STRING}  $ENV{QUERY_STRING};
 
 Though I don't understand why there is relocation error, the libperl.so
 lib includes the symbol:
 nm 
 /home/stas/perl/5.6.1-ithread/lib/5.6.1/i686-linux-thread-multi/CORE/libperl.so 
 | grep Perl_sv_2pv
 0009ae10 T Perl_sv_2pv
 
 and mod_perl is linked against it:
 ldd src/modules/perl/mod_perl.so
 libperl.so = 
 /home/stas/perl/5.6.1-ithread/lib/5.6.1/i686-linux-thread-multi/CORE/libperl.so 
 (0x40023000)
 
 
 __
 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



-- 


__
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: Perl_Tstack_sp_ptr

2002-06-11 Thread dougm

On Wed, 12 Jun 2002, Stas Bekman wrote:

 so the problem that I see on linux is unrelated?

dunno, i built with -Duseshrplib and seems ok linkage wise.  tho 
some ModPerl-Registry are tests failing with the same problem in 
special_blocks:
# testing : ModPerl::Registry is not running BEGIN blocks on the second req
# expected: ''
# received: undef
not ok 6





RE: Perl_Tstack_sp_ptr

2002-06-11 Thread Doug MacEachern

On Tue, 11 Jun 2002, Paul G. Weiss wrote:

 I suspect that pre-fork would work too, but I'm desparately 
 trying to get threads working.

you should try a different os then.  i'm sitting next to the guy who wrote 
worker mpm, he says the freebsd thread library does not work well enough 
for use with apache.  which is why the apache configure is supposed to 
force disabling of threads on freebsd (which is what i saw), not sure how 
you were able to end up with APR_HAVE_THREADS 1.  there is more in the
[EMAIL PROTECTED] mail archive on this subject.




RE: Perl_Tstack_sp_ptr

2002-06-11 Thread Paul G. Weiss

OK, until I can decide whether to take a chance on FreeBSD-current 
or to convince my employers who were so enamored of FreeBSD that
we should rebuild the server with Linux, I'm going prefork.

It still doesn't work precisely as it should though.  I decided
to go with the cvs builds of apache and mod_perl.  I have to 
confess that the installation instructions seem strange (both for
CVS and non-CVS).  You have to build and install Apache in order
to get the include files to build mod_perl.  Then after doing 
a make for mod_perl you are supposed to go back to Apache and
configure, make, make-install -- even though the mod_perl make
touched nothing in the Apache tree!  I assume after all of this
you do make install on both Apache and mod_perl although the
doc doesn't say so.

Even after all of that I *still* get the Perl_Tstack_sp_ptr
error!  Putting in the explicit LoadFile for libperl.so gets
rid of that problem, only to create another:

Cannot load /usr/lib/perl5/5.6.1/i386-freebsd-thread-multi/CORE/libperl.so
into server: /usr/lib/perl5/5.6.1/i386-freebsd-thread-multi/CORE/libperl.so:
Undefined symbol pthread_getspecific

Presumably this is because the Perl I used had thread support.  
My workaround is to edit apachectl to preload libc_r.so:

start|stop|restart|graceful)
LD_PRELOAD=libc_r.so $HTTPD -k $ARGV
ERROR=$?
;;
startssl|sslstart|start-SSL)
LD_PRELOAD=libc_r.so $HTTPD -k start -DSSL
ERROR=$?

and finally everything appears to be working.

I suppose I could have done --enable-threads in Apache 
with --with-mpm=prefork and it might have worked.  Is
that considered kosher?  Anyway this seems good enough
for now.

-P


 -Original Message-
 From: Paul G. Weiss 
 Sent: Tuesday, June 11, 2002 1:22 PM
 To: 'Doug MacEachern'
 Cc: [EMAIL PROTECTED]
 Subject: RE: Perl_Tstack_sp_ptr 
 
 
 I suspect that pre-fork would work too, but I'm desparately 
 trying to get threads working.
 
 Here is apr.h
 
 [/usr/local/apache2/htdocs/perl]# grep -i thread 
 /usr/local/apache2/include/apr.h
 #define APR_HAVE_PTHREAD_H   1
 #define APR_USE_PROC_PTHREAD_SERIALIZE0
 #define APR_USE_PTHREAD_SERIALIZE 1
 #define APR_HAS_PROC_PTHREAD_SERIALIZE0
 #define APR_HAS_THREADS   1
 #define APR_HAS_XTHREAD_FILES 0
 #define APR_THREAD_FUNC
 /* Does the proc mutex lock threads too */
 
 One more odd thing to report:  I've noticed that I have both
 libc.so and libc_r.so in the mix.  That can't be good, can it?
 
 Here is why I think so:
 
 INSTALLATION
  The current FreeBSD POSIX thread implementation is built 
 in the library
  libc_r which contains both thread-safe libc functions 
 and the thread
  functions.  This library replaces libc for threaded applications.
 
  By default, libc_r is built as part of a 'make world'.  
 To disable the
  build of libc_r you must supply the '-DNOLIBC_R' option 
 to make(1).
 
  A FreeBSD specific option has been added to gcc to make 
 linking threaded
  processes simple.  gcc -pthread links a threaded process 
 against libc_r
  instead of libc.
 
 -P
 
 [/usr/local/apache2/htdocs/perl]# LD_TRACE_LOADED_OBJECTS=1 \
/usr/local/apache2/bin/httpd  
 libaprutil.so.0 = 
 /usr/local/apache2/lib/libaprutil.so.0 (0x280a9000)
 libapr.so.0 = /usr/local/apache2/lib/libapr.so.0 (0x280b9000)
 libm.so.2 = /usr/lib/libm.so.2 (0x280d4000)
 libcrypt.so.2 = /usr/lib/libcrypt.so.2 (0x280f)
 libssl.so.3 = /usr/lib/libssl.so.3 (0x28109000)
 libcrypto.so.3 = /usr/lib/libcrypto.so.3 (0x28136000)
 libexpat.so.1 = /usr/local/apache2/lib/libexpat.so.1 
 (0x281ea000)
 libc_r.so.4 = /usr/lib/libc_r.so.4 (0x28206000)
 libc.so.4 = /usr/lib/libc.so.4 (0x282bb000)
 
 
 [/usr/local/apache2/htdocs/perl]# readelf -dD 
 /usr/local/apache2/lib/libapr.so.0
 
 Dynamic segment at offset 0x1941c contains 17 entries:
   TagType Name/Value
  0x0001 (NEEDED) Shared library: [libc.so.4]
  0x000e (SONAME) Library soname: [libapr.so.0]
  0x000c (INIT)   0x5f08
  0x000d (FINI)   0x18164
  0x0004 (HASH)   0x94
  0x0005 (STRTAB) 0x3494
  0x0006 (SYMTAB) 0x1184
  0x000a (STRSZ)  8540 (bytes)
  0x000b (SYMENT) 16 (bytes)
  0x0003 (PLTGOT) 0x19fc8
  0x0002 (PLTRELSZ)   2072 (bytes)
  0x0014 (PLTREL) REL
  0x0017 (JMPREL) 0x56f0
  0x0011 (REL)0x55f0
  0x0012 (RELSZ)  256 (bytes)
  0x0013 (RELENT) 8 (bytes)
  0x (NULL)   0x0
 
 
 
 
  -Original Message-
  From: Doug MacEachern [mailto:[EMAIL PROTECTED