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 Bekman JAm_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



Reply via email to