Re: [MP2] Perl_Tstack_sp_ptr

2003-01-27 Thread Stas Bekman
Xiaodong Shen wrote:

During the weekend I had no connectivity due to the worm, sorry.

Okay I tried remove my old perl installation and compiled a new one 
(5.8.0), and then installed a new mod_perl 1.99_08, and got the exactly 
same error. So I don't think it was because of my Perl installation as I 
suspected before.

Then I tried nm all the *.so under my /usr/local/lib/perl5, there are 
dozens of *.so contain symbol Perl_Tstack_sp_ptr, but all have 'U' 
(unresolved).

Then I nm-ed my modules/mod_perl.so under /usr/local/apache2, no symbol 
Perl_Tstack_sp_ptr at all.

 From your analysis, my mod_perl.so must have perl library linked in, 
which should have a resolved Perl_Tstack_sp_ptr, but it doesn't contain 
this symbol at all.

OK, let's step back and see first why this kind of errors happen in first 
place. Let's say you have a program that says:

test.c:
---
#include something.h
...
foo();
...

where something.h includes a declaration:

void foo();

The test.c program will compile, though if you look at test.o it'll have
the foo symbol undefined (U) and should be resolved at linking time against 
libsomething.so (we are talking dynamic linking here).

Now if libsomethings.so includes the symbol for foo, everything is cool. If it 
doesn't than you get the 'unresolved symbol' error. And this error may come 
from using the wrong header file or having some defines wrong.

Now getting back to our business, I've two versions of perl5.8.0 installed. 
One with ithreads enabled and the other without. Let's see:

% nm ~/perl/5.8.0/lib/5.8.0/i686-linux/CORE/libperl.so | grep stack_sp_ptr
nada

% nm ~/perl/5.8.0-ithread/lib/5.8.0/i686-linux-thread-multi/CORE/libperl.so | 
grep stack_sp_ptr
0011c6c8 T Perl_Tstack_sp_ptr

so I have this symbol in the lib built with ithreads. Now let's look at the 
perlapi.h:

grep -n stack_sp_ptr /home/stas/perl/5.8.0/lib/5.8.0/i686-linux/CORE/perlapi.h
920:#define PL_stack_sp (*Perl_Tstack_sp_ptr(aTHX))
it's also defined in CORE/thdrvar.h via a macro:
PERLVAR(Tstack_sp,	SV **)		/* top of the stack */

one of these definitions will work only if

  #if defined (MULTIPLICITY)

which is true in the ithreads build. And you can see it from the nm's output 
above.

So which libperl.so do you link against? Use 'ldd' on mod_perl.so to see. Does 
that libperl.so has the symbol in question defined? (use 'nm').

Most likely, your problem happends because you build with compile options for 
ithreads perl, but using the libperl.so lib which was built without ithreads.
please post your build env, see:
http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_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: [MP2] Perl_Tstack_sp_ptr

2003-01-25 Thread Stas Bekman
Xiaodong Shen wrote:

Thanks for the reply.

Several things to clear:

1. I have successfully passed the make  make test  make install 
phase.

2. I have moved into Server configuration phase and was doing the 
mod_perl rocks thingy, where the error happens.

3. Before seeing your reply, I already found a solution: I renamed 
Const.so to Const.so.bak (there are several other xxx.so mod_perl 
complains about, I removed them as well). It works, mod_perl did rock.

4. However this put me into a bigger misery, I can't explain why!!!

After reading the thread, I delved into my setting and found:

- my perl installation doesn't have libperl.so (libperl.a only).

Meaning that you perl is compiled without shared library support.


- my httpd is DSO enabled.
- my mod_perl is mod_perl.so (mod_perl.a is not used).


Currently mod_perl builds itself as static and dynamic, no matter what you 
choose, so at the later point you can simply link the static archive.

- my mod_perl.so is not linked against ibperl.so.


So it must have the perl library linked in. do you have that symbol that was 
reported missing in mod_perl.so? (hint: use 'nm')

So I assume that httpd loads mod_perl.so, which loads other xxx.so, such 
as Const.so, but when does mod_perl load libperl.so (from the thread I 
assume those undefined symbols would be resolved by libperl.so)? before 
laoding Const.so? but why did it not complain about no libperl.so on my 
system?

see above.

I suppose that we have a problem here of installing dynamic .so objects, when 
the static build is used and perl trying to load them. But it's also possible 
that you've the leftovers from an older install as you suggest below.

Now I start to have some ideas, it must have to do with my Perl 
installation, which contains some leftovers that should have been 
cleaned up before I made numerous rebuilds,  everytime Perl uses a 
package it looks for *.so by going through @INC, lots of library files 
with same names.

I will let you after I clean up my perl.

Have you installed mod_perl using the shared libperl.so before into the same 
directory?

__
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: [MP2] Perl_Tstack_sp_ptr

2003-01-24 Thread Stas Bekman
Xiaodong Shen wrote:

Hi all,

Does anyone have experience of seeing from error_log:

/usr/local/apache2/bin/httpd: error while loading shared libraries: 
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux/auto/Apache/Const/Const.so: 
undefined symbol: Perl_Tstack_sp_ptr

I am playing with 2.0.44 (-with-mpm=prefork) with mod_perl 2.0 (moer 
specifically 1.99_08) on linux 2.4.7 with Perl 5.8.0 (no thread), I saw 
the above error message when requesting the mod_perl 2.0 rocks testing 
page (see mod_perl 2.0 User Guide).

any hint is welcomed.

xd

Take a look at this thread:
http://marc.theaimsgroup.com/?t=10430802132r=1w=2
In particular at:
http://marc.theaimsgroup.com/?l=apache-modperlm=104312560827233w=2

Does this help?

__
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: [MP2] Perl_Tstack_sp_ptr

2003-01-24 Thread Xiaodong Shen
Thanks for the reply.

Several things to clear:

1. I have successfully passed the make  make test  make install phase.

2. I have moved into Server configuration phase and was doing the 
mod_perl rocks thingy, where the error happens.

3. Before seeing your reply, I already found a solution: I renamed 
Const.so to Const.so.bak (there are several other xxx.so mod_perl 
complains about, I removed them as well). It works, mod_perl did rock.

4. However this put me into a bigger misery, I can't explain why!!!

After reading the thread, I delved into my setting and found:

- my perl installation doesn't have libperl.so (libperl.a only).
- my httpd is DSO enabled.
- my mod_perl is mod_perl.so (mod_perl.a is not used).
- my mod_perl.so is not linked against ibperl.so.

So I assume that httpd loads mod_perl.so, which loads other xxx.so, such 
as Const.so, but when does mod_perl load libperl.so (from the thread I 
assume those undefined symbols would be resolved by libperl.so)? before 
laoding Const.so? but why did it not complain about no libperl.so on my 
system?

..

Now I start to have some ideas, it must have to do with my Perl 
installation, which contains some leftovers that should have been 
cleaned up before I made numerous rebuilds,  everytime Perl uses a 
package it looks for *.so by going through @INC, lots of library files 
with same names.

I will let you after I clean up my perl.

thanks again,

xd
Stas Bekman wrote:
Xiaodong Shen wrote:


Hi all,

Does anyone have experience of seeing from error_log:

/usr/local/apache2/bin/httpd: error while loading shared libraries: 
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux/auto/Apache/Const/Const.so: 
undefined symbol: Perl_Tstack_sp_ptr

I am playing with 2.0.44 (-with-mpm=prefork) with mod_perl 2.0 (moer 
specifically 1.99_08) on linux 2.4.7 with Perl 5.8.0 (no thread), I 
saw the above error message when requesting the mod_perl 2.0 rocks 
testing page (see mod_perl 2.0 User Guide).

any hint is welcomed.

xd


Take a look at this thread:
http://marc.theaimsgroup.com/?t=10430802132r=1w=2
In particular at:
http://marc.theaimsgroup.com/?l=apache-modperlm=104312560827233w=2

Does this help?

__
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