You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Markus Wichitill <ma...@gmx.de> on 2004/12/13 22:00:54 UTC

[mp2] t/modperl/util hangs on Linux

With current SVN, t/modperl/util hangs on Linux when run alone or as part of 
the whole test suite. On Win32/Apache 2.0.52/Perl 5.8.6 and ActivePerl 
5.8.4, this test and all others pass.

error_log:
/usr/local/apache2/bin/httpd: relocation error: 
/usr/src/modperl-2.0/blib/arch/auto/ModPerl/Util/Util.so: undefined symbol: 
newSVpvf

$ nm /usr/src/modperl-2.0/blib/arch/auto/ModPerl/Util/Util.so | grep newSVpvf
          U newSVpvf

$ nm /usr/local/perl/lib/CORE/libperl.so | grep newSVpvf
000a4ae0 T Perl_newSVpvf
000a4a90 T Perl_newSVpvf_nocontext
000a4b20 T Perl_vnewSVpvf


*** mod_perl version 1.9919

*** using /usr/src/modperl-2.0/lib/Apache/BuildConfig.pm

*** Makefile.PL options:
   MP_APR_LIB     => aprext
   MP_AP_PREFIX   => /usr/local/apache2
   MP_COMPAT_1X   =>
   MP_GENERATE_XS => 1
   MP_LIBNAME     => mod_perl
   MP_USE_DSO     => 1

*** /usr/local/apache2/bin/httpd -V
Server version: Apache/2.0.52
Server built:   Sep 28 2004 21:28:17
Server's Module Magic Number: 20020903:9
Architecture:   32-bit
Server compiled with....
  -D APACHE_MPM_DIR="server/mpm/worker"
  -D APR_HAS_SENDFILE
  -D APR_HAS_MMAP
  -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
  -D APR_USE_SYSVSEM_SERIALIZE
  -D APR_USE_PTHREAD_SERIALIZE
  -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
  -D APR_HAS_OTHER_CHILD
  -D AP_HAVE_RELIABLE_PIPED_LOGS
  -D HTTPD_ROOT="/usr/local/apache2"
  -D SUEXEC_BIN="/usr/local/apache2/bin/suexec"
  -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
  -D DEFAULT_ERRORLOG="logs/error_log"
  -D AP_TYPES_CONFIG_FILE="conf/mime.types"
  -D SERVER_CONFIG_FILE="conf/httpd.conf"

*** (apr|apu)-config linking info

  -L/usr/local/apache2/lib -lapr-0 -lrt -lm -lcrypt -lnsl  -lpthread -ldl
  -L/usr/local/apache2/lib -laprutil-0 -lgdbm -ldb-4.1 -lexpat

*** /usr/local/perl/bin/perl -V
Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
   Platform:
     osname=linux, osvers=2.4.21-199-athlon, archname=i686-linux-thread-multi
     uname='linux red 2.4.21-199-athlon #1 fri mar 12 08:24:04 utc 2004 i686 
athlon i386 gnulinux '
     config_args='-df config.sh'
     hint=previous, useposix=true, d_sigaction=define
     usethreads=define use5005threads=undef useithreads=define 
usemultiplicity=define
     useperlio=define d_sfio=undef uselargefiles=undef usesocks=undef
     use64bitint=undef use64bitall=undef uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS 
-fno-strict-aliasing -I/usr/local/include',
     optimize='-O3 -march=athlon-tbird',
     cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS 
-fno-strict-aliasing -I/usr/local/include'
     ccversion='', gccversion='3.3.1 (SuSE Linux)', gccosandvers=''
     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize=4
     alignbytes=4, prototype=define
   Linker and Libraries:
     ld='cc', ldflags =' -L/usr/local/lib'
     libpth=/usr/local/lib /lib /usr/lib
     libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
     perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
     libc=, so=so, useshrplib=true, libperl=libperl.so
     gnulibc_version='2.3.2'
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E 
-Wl,-rpath,/usr/local/perl/lib/CORE'
     cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Characteristics of this binary (from libperl):
   Compile-time options: MULTIPLICITY USE_ITHREADS PERL_IMPLICIT_CONTEXT
   Built under linux
   Compiled at Dec  2 2004 13:18:13
   %ENV:
     PERL_LWP_USE_HTTP_10="1"
   @INC:
     /usr/local/perl/lib
     /usr/local/perl/lib
     /usr/local/perl/lib
     /usr/local/perl/lib
     .

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] t/modperl/util hangs on Linux

Posted by Stas Bekman <st...@stason.org>.
Markus Wichitill wrote:
> Stas Bekman wrote:
> 
>> Markus Wichitill wrote:
>>
>>> Well, I haven't written any C/C++ in a while and I've never had to 
>>> deal with macro hell, but as far as I can see, newSVpvf is defined in 
>>> Perl's embed.h:
>>>
>>> #define newSVpvf        Perl_newSVpvf
>>>
>>> If I add that line to the top of ModPerl__Util.h manually, it works. 
>>> If I add
>>>
>>> #ifndef newSVpvf
>>> #error newSVpvf not defined
>>> #endif
>>>
>>> to the end of embed.h and compile, it seems that newSVpvf doesn't get 
>>> defined. But I have no idea how to trace through that horrible, 
>>> generated #ifdef jungle.
> 
> 
> Ok, so embed.h mostly consists of two halves, the first half is for 
> !PERL_IMPLICIT_CONTEXT, the second half is for PERL_IMPLICIT_CONTEXT. 
> Since I have it defined, the aforementioned "#define newSVpvf 
> Perl_newSVpvf" in the first half isn't used, and in the second half 
> there's no macro for newSVpvf.
> 
> Then there's a few special macros at the bottom of embed.h, one section 
> with the comment "varargs functions can't be handled with CPP macros". 
> But the workaround macro "#  define newSVpvf Perl_newSVpvf_nocontext" 
> (note the misplaced (?) spaces in #define) isn't used either, since I 
> have PERL_CORE defined. If I remove the PERL_CORE check, the code 
> compiles and the macro used, but the test fails with some garbage 
> output, which is probably ok since I don't think the _nocontext version 
> is the right one when you pass that aTHX_ thingy (but what do I know).
> 
> Anyway, unless you can see the difference between our setups from my 
> description, just use the explicit Perl_ prefix for vararg functions. 
> Doug did that, too, in Apache__Access.h.

If you ask me, that's worth to perlbug to p5p. The Perl API manpage 
advertises newSVpvf, so either it or embed.h should get fixed. Could you 
do it? You could just post it as a question to p5p first.

But regardless, we now use the Perl_ version, so we are good. I just want 
to see that fixed for the future, so we don't have to waste cycles every 
time, this buglet is forgotten.

Thanks.


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] t/modperl/util hangs on Linux

Posted by Markus Wichitill <ma...@gmx.de>.
Stas Bekman wrote:
> Markus Wichitill wrote:
>> Well, I haven't written any C/C++ in a while and I've never had to 
>> deal with macro hell, but as far as I can see, newSVpvf is defined in 
>> Perl's embed.h:
>>
>> #define newSVpvf        Perl_newSVpvf
>>
>> If I add that line to the top of ModPerl__Util.h manually, it works. 
>> If I add
>>
>> #ifndef newSVpvf
>> #error newSVpvf not defined
>> #endif
>>
>> to the end of embed.h and compile, it seems that newSVpvf doesn't get 
>> defined. But I have no idea how to trace through that horrible, 
>> generated #ifdef jungle.

Ok, so embed.h mostly consists of two halves, the first half is for 
!PERL_IMPLICIT_CONTEXT, the second half is for PERL_IMPLICIT_CONTEXT. Since 
I have it defined, the aforementioned "#define newSVpvf Perl_newSVpvf" in 
the first half isn't used, and in the second half there's no macro for newSVpvf.

Then there's a few special macros at the bottom of embed.h, one section with 
the comment "varargs functions can't be handled with CPP macros". But the 
workaround macro "#  define newSVpvf Perl_newSVpvf_nocontext" (note the 
misplaced (?) spaces in #define) isn't used either, since I have PERL_CORE 
defined. If I remove the PERL_CORE check, the code compiles and the macro 
used, but the test fails with some garbage output, which is probably ok 
since I don't think the _nocontext version is the right one when you pass 
that aTHX_ thingy (but what do I know).

Anyway, unless you can see the difference between our setups from my 
description, just use the explicit Perl_ prefix for vararg functions. Doug 
did that, too, in Apache__Access.h.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] t/modperl/util hangs on Linux

Posted by Stas Bekman <st...@stason.org>.
Markus Wichitill wrote:
> Stas Bekman wrote:
> 
>>> Déjà-vu:
>>>
>>> http://article.gmane.org/gmane.comp.apache.mod-perl.devel/4427
>>
>>
>> But I want to know why does this happen on your build and I can't 
>> reproduce it here. That what bugs me. In case you have some time to 
>> look at it, 
> 
> 
> Well, I haven't written any C/C++ in a while and I've never had to deal 
> with macro hell, but as far as I can see, newSVpvf is defined in Perl's 
> embed.h:
> 
> #define newSVpvf        Perl_newSVpvf
> 
> If I add that line to the top of ModPerl__Util.h manually, it works. If 
> I add
> 
> #ifndef newSVpvf
> #error newSVpvf not defined
> #endif
> 
> to the end of embed.h and compile, it seems that newSVpvf doesn't get 
> defined. But I have no idea how to trace through that horrible, 
> generated #ifdef jungle. To quote embed.h:
> 
> /* (Doing namespace management portably in C is really gross.) */
> 
> /* By defining PERL_NO_SHORT_NAMES (not done by default) the short forms
>  * (like warn instead of Perl_warn) for the API are not defined.
>  * Not defining the short forms is a good thing for cleaner embedding. */

It goes like this:

WrapXS/ModPerl/Util/Util.c

includes:

#include "mod_perl.h"

which includes:

#include "modperl_common_includes.h"

which includes:

#include "modperl_perl_includes.h"

which includes:

#include "perl.h"

which finally includes:

#  include "embed.h"

which defines:

#define newSVpvf                Perl_newSVpvf

but of course this doesn't include possible #ifdef branching. so you want 
to check that.

Also there is:

cd WrapXS/ModPerl/Util
make Util.i

now you will find all the macros expanded in Util.i. I see:

  SV* Perl_newSVpvf( PerlInterpreter *my_perl __attribute__((unused)), 
const char
* pat, ...)

w/o the patch that was applied to fix this for you.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] t/modperl/util hangs on Linux

Posted by Markus Wichitill <ma...@gmx.de>.
Stas Bekman wrote:
>> Déjà-vu:
>>
>> http://article.gmane.org/gmane.comp.apache.mod-perl.devel/4427
> 
> But I want to know why does this happen on your build and I can't 
> reproduce it here. That what bugs me. In case you have some time to look 
> at it, 

Well, I haven't written any C/C++ in a while and I've never had to deal with 
macro hell, but as far as I can see, newSVpvf is defined in Perl's embed.h:

#define newSVpvf		Perl_newSVpvf

If I add that line to the top of ModPerl__Util.h manually, it works. If I add

#ifndef newSVpvf
#error newSVpvf not defined
#endif

to the end of embed.h and compile, it seems that newSVpvf doesn't get 
defined. But I have no idea how to trace through that horrible, generated 
#ifdef jungle. To quote embed.h:

/* (Doing namespace management portably in C is really gross.) */

/* By defining PERL_NO_SHORT_NAMES (not done by default) the short forms
  * (like warn instead of Perl_warn) for the API are not defined.
  * Not defining the short forms is a good thing for cleaner embedding. */

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] t/modperl/util hangs on Linux

Posted by Stas Bekman <st...@stason.org>.
Markus Wichitill wrote:
> Stas Bekman wrote:
> 
>>>> 2) Perl_newSVpvf(aTHX_ "0x%lx", (unsigned long)aTHX)
>>>
>>>
>>> Succeeds.

>> really? That's strange. I guess I'll just use it then.

Thanks, committed.

> Déjà-vu:
> 
> http://article.gmane.org/gmane.comp.apache.mod-perl.devel/4427

But I want to know why does this happen on your build and I can't 
reproduce it here. That what bugs me. In case you have some time to look 
at it, here is one of the perls I'm using:

Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
   Platform:
     osname=linux, osvers=2.6.8.1-12mdk, archname=i686-linux-thread-multi
     uname='linux rabbit.stason.org 2.6.8.1-12mdk #1 fri oct 1 12:53:41 
cest 2004 i686 mobile intel(r) pentium(r) 4 - m cpu 2.00ghz unknown gnulinux '
     config_args='-des -Dprefix=/home/stas/perl/5.8.6-ithread -Dusethreads 
-Doptimize=-g -Duseshrplib -Dusedevel -Accflags=-DDEBUG_LEAKING_SCALARS'
     hint=recommended, useposix=true, d_sigaction=define
     usethreads=define use5005threads=undef useithreads=define 
usemultiplicity=define
     useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
     use64bitint=undef use64bitall=undef uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS 
-DDEBUG_LEAKING_SCALARS -DDEBUGGING -fno-strict-aliasing -pipe 
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr/include/gdbm',
     optimize='-g',
     cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS 
-DDEBUG_LEAKING_SCALARS -DDEBUGGING -fno-strict-aliasing -pipe 
-I/usr/local/include -I/usr/include/gdbm'
     ccversion='', gccversion='3.4.1 (Mandrakelinux 10.1 3.4.1-4mdk)', 
gccosandvers=''
     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize=8
     alignbytes=4, prototype=define
   Linker and Libraries:
     ld='cc', ldflags =' -L/usr/local/lib'
     libpth=/usr/local/lib /lib /usr/lib
     libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
     perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
     libc=/lib/libc-2.3.3.so, so=so, useshrplib=true, libperl=libperl.so
     gnulibc_version='2.3.3'
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E 
-Wl,-rpath,/home/stas/perl/5.8.6-ithread/lib/5.8.6/i686-linux-thread-multi/CORE'
     cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
   Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS 
USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
   Built under linux
   Compiled at Nov 28 2004 13:25:05
   %ENV:
     PERLDOC_PAGER="less -R"
   @INC:
     /home/stas/perl/5.8.6-ithread/lib/5.8.6/i686-linux-thread-multi
     /home/stas/perl/5.8.6-ithread/lib/5.8.6
     /home/stas/perl/5.8.6-ithread/lib/site_perl/5.8.6/i686-linux-thread-multi
     /home/stas/perl/5.8.6-ithread/lib/site_perl/5.8.6
     /home/stas/perl/5.8.6-ithread/lib/site_perl
     .


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] t/modperl/util hangs on Linux

Posted by Markus Wichitill <ma...@gmx.de>.
Stas Bekman wrote:
>>> 2) Perl_newSVpvf(aTHX_ "0x%lx", (unsigned long)aTHX)
>>
>> Succeeds.
> 
> really? That's strange. I guess I'll just use it then.

Déjà-vu:

http://article.gmane.org/gmane.comp.apache.mod-perl.devel/4427

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] t/modperl/util hangs on Linux

Posted by Stas Bekman <st...@stason.org>.
Markus Wichitill wrote:
> Stas Bekman wrote:
> 
>> Markus, any difference if you replace both occurences of newSVpvf with
>>
>> 1) Perl_form(aTHX_ "0x%lx", (unsigned long)aTHX)
> 
> 
> t/modperl/util....1..1
> # Running under perl version 5.008006 for linux
> # Current time local: Tue Dec 14 16:32:57 2004
> # Current time GMT:   Tue Dec 14 15:32:57 2004
> # Using Test.pm version 1.25
> # Using Apache/Test.pm version 1.18
> # testing : perl interpreter id
> # expected: (?-xism:0x\w+)
> # received: undef
> not ok 1
> FAILED test 1

it was a bad idea anyway, since it requires you to copy the resulting string.

>> 2) Perl_newSVpvf(aTHX_ "0x%lx", (unsigned long)aTHX)
> 
> 
> Succeeds.

really? That's strange. I guess I'll just use it then.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] t/modperl/util hangs on Linux

Posted by Markus Wichitill <ma...@gmx.de>.
Stas Bekman wrote:
> Markus, any difference if you replace both occurences of newSVpvf with
> 
> 1) Perl_form(aTHX_ "0x%lx", (unsigned long)aTHX)

t/modperl/util....1..1
# Running under perl version 5.008006 for linux
# Current time local: Tue Dec 14 16:32:57 2004
# Current time GMT:   Tue Dec 14 15:32:57 2004
# Using Test.pm version 1.25
# Using Apache/Test.pm version 1.18
# testing : perl interpreter id
# expected: (?-xism:0x\w+)
# received: undef
not ok 1
FAILED test 1

> 2) Perl_newSVpvf(aTHX_ "0x%lx", (unsigned long)aTHX)

Succeeds.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] t/modperl/util hangs on Linux

Posted by Stas Bekman <st...@stason.org>.
Stas Bekman wrote:

Markus, any difference if you replace both occurences of newSVpvf with

1) Perl_form(aTHX_ "0x%lx", (unsigned long)aTHX)

2) Perl_newSVpvf(aTHX_ "0x%lx", (unsigned long)aTHX)

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] t/modperl/util hangs on Linux

Posted by Stas Bekman <st...@stason.org>.
Markus Wichitill wrote:
> Stas Bekman wrote:
> 
>> may be because it uses #define rather than a wrapper it doesn't see 
>> that symbol at compile time (bizarre!). How about this (replacing 
>> define with real func)?
>>
>> Index: xs/ModPerl/Util/ModPerl__Util.h
>> ===================================================================
>> --- xs/ModPerl/Util/ModPerl__Util.h     (revision 111732)
>> +++ xs/ModPerl/Util/ModPerl__Util.h     (working copy)
>> @@ -13,14 +13,19 @@
>>   * limitations under the License.
>>   */
>>
>> +static SV *current_perl_id()
>> +{
>>  #ifdef USE_ITHREADS
>> -#define mpxs_ModPerl__Util_current_perl_id() \
>> -    newSVpvf("0x%lx", (unsigned long)aTHX)
>> +    dTHX;
>> +    return newSVpvf("0x%lx", (unsigned long)aTHX);
>>  #else
>> -#define mpxs_ModPerl__Util_current_perl_id() \
>> -    newSVpvf("0x%lx", 0)
>> +    return newSVpvf("0x%lx", 0);
>>  #endif
>> +}
>>
>> +#define mpxs_ModPerl__Util_current_perl_id current_perl_id
>> +
>> +
>>  static MP_INLINE void mpxs_ModPerl__Util_untaint(pTHX_ I32 items,
>>                                                   SV **MARK, SV **SP)
>>  {
> 
> 
> Doesn't work either.

Really? Then I'm not sure what's wrong here.

Could you check some other perl symbols in Util.so and other .so modules? 
to check other examples?

As usual if I knew how to reproduce that I'd have been much more useful at 
resolving this.

I guess the only difference I see from your setup is that I use perl with 
DEBUGGING and gcc 3.4.1.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] t/modperl/util hangs on Linux

Posted by Markus Wichitill <ma...@gmx.de>.
Stas Bekman wrote:
> may be because it uses #define rather than a wrapper it doesn't see that 
> symbol at compile time (bizarre!). How about this (replacing define with 
> real func)?
> 
> Index: xs/ModPerl/Util/ModPerl__Util.h
> ===================================================================
> --- xs/ModPerl/Util/ModPerl__Util.h     (revision 111732)
> +++ xs/ModPerl/Util/ModPerl__Util.h     (working copy)
> @@ -13,14 +13,19 @@
>   * limitations under the License.
>   */
> 
> +static SV *current_perl_id()
> +{
>  #ifdef USE_ITHREADS
> -#define mpxs_ModPerl__Util_current_perl_id() \
> -    newSVpvf("0x%lx", (unsigned long)aTHX)
> +    dTHX;
> +    return newSVpvf("0x%lx", (unsigned long)aTHX);
>  #else
> -#define mpxs_ModPerl__Util_current_perl_id() \
> -    newSVpvf("0x%lx", 0)
> +    return newSVpvf("0x%lx", 0);
>  #endif
> +}
> 
> +#define mpxs_ModPerl__Util_current_perl_id current_perl_id
> +
> +
>  static MP_INLINE void mpxs_ModPerl__Util_untaint(pTHX_ I32 items,
>                                                   SV **MARK, SV **SP)
>  {

Doesn't work either.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] t/modperl/util hangs on Linux

Posted by Stas Bekman <st...@stason.org>.
Markus Wichitill wrote:
> Stas Bekman wrote:
> 
>> So mod_perl.so has loaded the right libperl.so which has Perl_newSVpvf 
>> resolved, Util.so shouldn't complain then, no? It doesn't for me 
>> (linux here too).
>>
>> Is it possible that somehow Apache tries to load by itself? (httpd.conf?)
>> /usr/src/modperl-2.0/blib/arch/auto/ModPerl/Util/Util.so
>> Otherwise it should be a Dynaloader reporting the failure and not httpd
> 
> 
> I don't see anything in httpd.conf. I only see "use ModPerl::Util" in 
> t/conf/post_config_startup.pl and various test modules.

may be because it uses #define rather than a wrapper it doesn't see that 
symbol at compile time (bizarre!). How about this (replacing define with 
real func)?

Index: xs/ModPerl/Util/ModPerl__Util.h
===================================================================
--- xs/ModPerl/Util/ModPerl__Util.h     (revision 111732)
+++ xs/ModPerl/Util/ModPerl__Util.h     (working copy)
@@ -13,14 +13,19 @@
   * limitations under the License.
   */

+static SV *current_perl_id()
+{
  #ifdef USE_ITHREADS
-#define mpxs_ModPerl__Util_current_perl_id() \
-    newSVpvf("0x%lx", (unsigned long)aTHX)
+    dTHX;
+    return newSVpvf("0x%lx", (unsigned long)aTHX);
  #else
-#define mpxs_ModPerl__Util_current_perl_id() \
-    newSVpvf("0x%lx", 0)
+    return newSVpvf("0x%lx", 0);
  #endif
+}

+#define mpxs_ModPerl__Util_current_perl_id current_perl_id
+
+
  static MP_INLINE void mpxs_ModPerl__Util_untaint(pTHX_ I32 items,
                                                   SV **MARK, SV **SP)
  {

this is just a quick hack so you don't need to rebuild anything, but just 
run make. This is not how it's going to be in the final version.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] t/modperl/util hangs on Linux

Posted by Markus Wichitill <ma...@gmx.de>.
Stas Bekman wrote:
> So mod_perl.so has loaded the right libperl.so which has Perl_newSVpvf 
> resolved, Util.so shouldn't complain then, no? It doesn't for me (linux 
> here too).
> 
> Is it possible that somehow Apache tries to load by itself? (httpd.conf?)
> /usr/src/modperl-2.0/blib/arch/auto/ModPerl/Util/Util.so
> Otherwise it should be a Dynaloader reporting the failure and not httpd

I don't see anything in httpd.conf. I only see "use ModPerl::Util" in 
t/conf/post_config_startup.pl and various test modules.

> I see though that the test is broken. Does this make any difference?
> 
> -- Index: t/response/TestModperl/util.pm
> ===================================================================
> --- t/response/TestModperl/util.pm      (revision 111732)
> +++ t/response/TestModperl/util.pm      (working copy)
> @@ -8,8 +8,7 @@
>  use Apache::Test;
>  use Apache::TestUtil;
> 
> -use Apache::RequestIO ();
> -use Apache::RequestUtil ();
> +use ModPerl::Util ();
> 
>  use Apache::Const -compile => 'OK';

Nope.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] t/modperl/util hangs on Linux

Posted by Stas Bekman <st...@stason.org>.
Markus Wichitill wrote:
> Stas Bekman wrote:
> 
>> Markus Wichitill wrote:
>>
>>> With current SVN, t/modperl/util hangs on Linux when run alone or as 
>>> part of the whole test suite. On Win32/Apache 2.0.52/Perl 5.8.6 and 
>>> ActivePerl 5.8.4, this test and all others pass.
>>>
>>> error_log:
>>> /usr/local/apache2/bin/httpd: relocation error: 
>>> /usr/src/modperl-2.0/blib/arch/auto/ModPerl/Util/Util.so: undefined 
>>> symbol: newSVpvf
>>>
>>> $ nm /usr/src/modperl-2.0/blib/arch/auto/ModPerl/Util/Util.so | grep 
>>> newSVpvf
>>>          U newSVpvf
>>> $ nm /usr/local/perl/lib/CORE/libperl.so | grep newSVpvf
>>> 000a4ae0 T Perl_newSVpvf
>>> 000a4a90 T Perl_newSVpvf_nocontext
>>> 000a4b20 T Perl_vnewSVpvf
>>
>>
>> Markus, please post:
>>
>> ldd /usr/src/modperl-2.0/blib/arch/auto/ModPerl/Util/Util.so
>> ldd src/module/perl/mod_perl.so
>> nm src/module/perl/mod_perl.so | grep newSVpvf
> 
> 
> $ ldd blib/arch/auto/ModPerl/Util/Util.so
>   libc.so.6 => /lib/i686/libc.so.6 (0x40013000)
>   /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
> 
> $ ldd src/modules/perl/mod_perl.so
>   libperl.so => /usr/local/perl/lib/CORE/libperl.so (0x40030000)

So mod_perl.so has loaded the right libperl.so which has Perl_newSVpvf 
resolved, Util.so shouldn't complain then, no? It doesn't for me (linux 
here too).

Is it possible that somehow Apache tries to load by itself? (httpd.conf?)
/usr/src/modperl-2.0/blib/arch/auto/ModPerl/Util/Util.so
Otherwise it should be a Dynaloader reporting the failure and not httpd

I see though that the test is broken. Does this make any difference?

-- Index: t/response/TestModperl/util.pm
===================================================================
--- t/response/TestModperl/util.pm      (revision 111732)
+++ t/response/TestModperl/util.pm      (working copy)
@@ -8,8 +8,7 @@
  use Apache::Test;
  use Apache::TestUtil;

-use Apache::RequestIO ();
-use Apache::RequestUtil ();
+use ModPerl::Util ();

  use Apache::Const -compile => 'OK';

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] t/modperl/util hangs on Linux

Posted by Markus Wichitill <ma...@gmx.de>.
Stas Bekman wrote:
> Markus Wichitill wrote:
>> With current SVN, t/modperl/util hangs on Linux when run alone or as 
>> part of the whole test suite. On Win32/Apache 2.0.52/Perl 5.8.6 and 
>> ActivePerl 5.8.4, this test and all others pass.
>>
>> error_log:
>> /usr/local/apache2/bin/httpd: relocation error: 
>> /usr/src/modperl-2.0/blib/arch/auto/ModPerl/Util/Util.so: undefined 
>> symbol: newSVpvf
>>
>> $ nm /usr/src/modperl-2.0/blib/arch/auto/ModPerl/Util/Util.so | grep 
>> newSVpvf
>>          U newSVpvf
>> $ nm /usr/local/perl/lib/CORE/libperl.so | grep newSVpvf
>> 000a4ae0 T Perl_newSVpvf
>> 000a4a90 T Perl_newSVpvf_nocontext
>> 000a4b20 T Perl_vnewSVpvf
> 
> Markus, please post:
> 
> ldd /usr/src/modperl-2.0/blib/arch/auto/ModPerl/Util/Util.so
> ldd src/module/perl/mod_perl.so
> nm src/module/perl/mod_perl.so | grep newSVpvf

$ ldd blib/arch/auto/ModPerl/Util/Util.so
   libc.so.6 => /lib/i686/libc.so.6 (0x40013000)
   /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

$ ldd src/modules/perl/mod_perl.so
   libperl.so => /usr/local/perl/lib/CORE/libperl.so (0x40030000)
   libnsl.so.1 => /lib/libnsl.so.1 (0x40177000)
   libdl.so.2 => /lib/libdl.so.2 (0x4018c000)
   libm.so.6 => /lib/i686/libm.so.6 (0x40190000)
   libcrypt.so.1 => /lib/libcrypt.so.1 (0x401b3000)
   libutil.so.1 => /lib/libutil.so.1 (0x401e5000)
   libpthread.so.0 => /lib/i686/libpthread.so.0 (0x401e8000)
   libc.so.6 => /lib/i686/libc.so.6 (0x40239000)
   /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

$ nm src/modules/perl/mod_perl.so | grep newSVpvf
          U Perl_vnewSVpvf

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] t/modperl/util hangs on Linux

Posted by Stas Bekman <st...@stason.org>.
Markus Wichitill wrote:
> With current SVN, t/modperl/util hangs on Linux when run alone or as 
> part of the whole test suite. On Win32/Apache 2.0.52/Perl 5.8.6 and 
> ActivePerl 5.8.4, this test and all others pass.
> 
> error_log:
> /usr/local/apache2/bin/httpd: relocation error: 
> /usr/src/modperl-2.0/blib/arch/auto/ModPerl/Util/Util.so: undefined 
> symbol: newSVpvf
> 
> $ nm /usr/src/modperl-2.0/blib/arch/auto/ModPerl/Util/Util.so | grep 
> newSVpvf
>          U newSVpvf

Markus, please post:

ldd /usr/src/modperl-2.0/blib/arch/auto/ModPerl/Util/Util.so
ldd src/module/perl/mod_perl.so
nm src/module/perl/mod_perl.so | grep newSVpvf

> $ nm /usr/local/perl/lib/CORE/libperl.so | grep newSVpvf
> 000a4ae0 T Perl_newSVpvf
> 000a4a90 T Perl_newSVpvf_nocontext
> 000a4b20 T Perl_vnewSVpvf


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org