You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by William McKee <wi...@knowmad.com> on 2005/06/03 04:43:51 UTC
[MP2] Bug report - errors when compiling with MP_DEBUG flag
-------------8<---------- Start Bug Report ------------8<----------
1. Problem Description:
While trying to track down a segfault that is occurring with
Image::Magick, I went to build a version of mod_perl with debugging
flags. Unfortunately this does not build for me under FreeBSD 5.3. Here
is the error I receive during make:
/usr/local/src/httpd-2.0.54/srclib/apr/libtool --silent --mode=link gcc -D_REENTRANT -D_THREAD_SAFE -DAP_HAVE_DESIGNATED_INITIALIZER -I/usr/local/src/httpd-2.0.54/srclib/apr/include -I/usr/local/src/httpd-2.0.54/srclib/apr-util/include -I/usr/local/include -I. -I/usr/local/src/httpd-2.0.54/os/unix -I/usr/local/src/httpd-2.0.54/server/mpm/prefork -I/usr/local/src/httpd-2.0.54/modules/http -I/usr/local/src/httpd-2.0.54/modules/filters -I/usr/local/src/httpd-2.0.54/modules/proxy -I/usr/local/src/httpd-2.0.54/include -I/usr/local/src/httpd-2.0.54/modules/generators -I/usr/local/src/httpd-2.0.54/modules/dav/main -export-dynamic -L/usr/local/lib -o httpd modules.lo /stubs/usr_local/src/mod_perl-2.0.0/src/modules/perl/mod_perl.a modules/aaa/mod_access.la modules/aaa/mod_auth.la modules/filters/mod_include.la modules/loggers/mod_log_config.la modules/metadata/mod_env.la modules/metadata/mod_setenvif.la modules/http/mod_http.la modules/http/mod_mime.la modules/generators/mod_status.la modules/generators/mod_autoindex.la modules/generators/mod_asis.la modules/generators/mod_cgi.la modules/mappers/mod_negotiation.la modules/mappers/mod_dir.la modules/mappers/mod_imap.la modules/mappers/mod_actions.la modules/mappers/mod_userdir.la modules/mappers/mod_alias.la modules/mappers/mod_rewrite.la modules/mappers/mod_so.la server/mpm/prefork/libprefork.la server/libmain.la os/unix/libos.la /usr/local/src/httpd-2.0.54/srclib/pcre/libpcre.la -Wl,-R/usr/public/lib/perl5/5.8.6/i386-freebsd-64int/CORE -Wl,-E -L/usr/local/lib /usr/public/lib/perl5/5.8.6/i386-freebsd-64int/auto/DynaLoader/DynaLoader.a -L/usr/public/lib/perl5/5.8.6/i386-freebsd-64int/CORE -lperl -lm -lcrypt -lutil /usr/local/src/httpd-2.0.54/srclib/apr-util/libaprutil-0.la -lexpat /usr/local/src/httpd-2.0.54/srclib/apr/libapr-0.la -lm -lcrypt
/stubs/usr_local/src/mod_perl-2.0.0/src/modules/perl/mod_perl.a(modperl_util.o)(.text+0x14a8): In function `modperl_perl_call_list':
/stubs/usr_local/src/mod_perl-2.0.0/src/modules/perl/modperl_util.c:472: undefined reference to `apr_os_thread_current'
*** Error code 1
Stop in /stubs/usr_local/src/httpd-2.0.54.
*** Error code 1
Stop in /stubs/usr_local/src/httpd-2.0.54.
*** Error code 1
Stop in /stubs/usr_local/src/mod_perl-2.0.0.
2. Used Components and their Configuration:
*** mod_perl version 2.000000
*** using /stubs/usr_local/src/mod_perl-2.0.0/lib/Apache2/BuildConfig.pm
*** Makefile.PL options:
MP_APR_LIB => aprext
MP_AP_CONFIGURE => --with-mpm=prefork --prefix=/usr/local/apache2_perl --enable-rewrite=static
MP_AP_PREFIX => /usr/local/src/httpd-2.0.54
MP_COMPAT_1X => 1
MP_DEBUG => 1
MP_GENERATE_XS => 1
MP_LIBNAME => mod_perl
MP_TRACE => 1
MP_USE_STATIC => 1
*** The httpd binary was not found
*** (apr|apu)-config linking info
-L/usr/local/src/httpd-2.0.54/srclib/apr-util/.libs
-L/usr/local/src/httpd-2.0.54/srclib/apr-util -laprutil-0 -lexpat
-L/usr/local/src/httpd-2.0.54/srclib/apr/.libs
-L/usr/local/src/httpd-2.0.54/srclib/apr -lapr-0 -lm -lcrypt
*** /usr/public/bin/perl -V
Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
Platform:
osname=freebsd, osvers=5.3-release-p5, archname=i386-freebsd-64int
uname='freebsd hobbiton.shire.net 5.3-release-p5 freebsd 5.3-release-p5 #3: thu feb 3 23:10:24 mst 2005 chad@bywater.shire.net:usrobjusrsrcsysbywater-smp i386 '
config_args='-sde -Dprefix=/usr/public/ -Dotherlibdirs=/usr/public//lib/perl5/site_perl/5.8.6/mach:/usr/public//lib/perl5/site_perl/5.8.6 -Darchlib=/usr/public//lib/perl5/5.8.6/mach -Dprivlib=/usr/public//lib/perl5/5.8.6 -Dman3dir=/usr/public//lib/perl5/5.8.6/perl/man/man3 -Dman1dir=/usr/public//man/man1 -Dscriptdir=/usr/public//bin -Dsitearch=/usr/local/lib/perl5/site_perl/5.8.6/mach -Dsitelib=/usr/local/lib/perl5/site_perl/5.8.6 -Dsiteman3dir=/usr/local/lib/perl5/5.8.6/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsitebin=/usr/local/bin -Dsitescript=/usr/local/bin -Ui_malloc -Ui_iconv -Uinstallusrbinperl -Dcc=cc -Doptimize=-O -pipe -Duseshrplib -Dccflags=-DAPPLLIB_EXP="/usr/public//lib/perl5/5.8.6/BSDPAN" -Ud_dosuid -Ui_gdbm -Dusethreads=n -Dusemymalloc=y -Duse64bitint'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=define use64bitall=undef uselongdouble=undef
usemymalloc=y, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-DAPPLLIB_EXP="/usr/public//lib/perl5/5.8.6/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -I/usr/local/include',
optimize='-O -pipe ',
cppflags='-DAPPLLIB_EXP="/usr/public//lib/perl5/5.8.6/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -I/usr/local/include'
ccversion='', gccversion='3.4.2 [FreeBSD] 20040728', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -Wl,-E -L/usr/local/lib'
libpth=/usr/lib /usr/local/lib
libs=-lm -lcrypt -lutil
perllibs=-lm -lcrypt -lutil
libc=, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -Wl,-R/usr/public/lib/perl5/5.8.6/i386-freebsd-64int/CORE'
cccdlflags='-DPIC -fPIC', lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: USE_64_BIT_INT USE_LARGE_FILES
Locally applied patches:
SUIDPERLIO0 - fix PERLIO_DEBUG local root exploit (CAN-2005-0155)
SUIDPERLIO1 - fix PERLIO_DEBUG buffer overflow (CAN-2005-0156)
Built under freebsd
Compiled at Feb 15 2005 07:22:27
%ENV:
PERL_LWP_USE_HTTP_10="1"
@INC:
/usr/local/lib/perl5/site_perl/5.8.6/mach
/usr/local/lib/perl5/site_perl/5.8.6
/usr/local/lib/perl5/site_perl
/usr/public//lib/perl5/5.8.6/BSDPAN
/usr/public/lib/perl5/5.8.6/i386-freebsd-64int
/usr/public/lib/perl5/5.8.6
/usr/public//lib/perl5/site_perl/5.8.6/mach
/usr/public//lib/perl5/site_perl/5.8.6/i386-freebsd-64int
/usr/public//lib/perl5/site_perl/5.8.6
.
*** Packages of interest status:
Apache2 : -
Apache2::Request : -
CGI : 3.05, 3.10
ExtUtils::MakeMaker: 6.17, 6.17
LWP : 5.803
mod_perl : -
mod_perl2 : 2.000000
3. This is the core dump trace: (if you get a core dump):
[CORE TRACE COMES HERE]
This report was generated by t/REPORT on Fri Jun 3 02:29:45 2005 GMT.
-------------8<---------- End Bug Report --------------8<----------
--
Knowmad Services Inc.
http://www.knowmad.com
Re: [MP2] Bug report - errors when compiling with MP_DEBUG flag
Posted by Stas Bekman <st...@stason.org>.
William McKee wrote:
[...]
>>If you look at the linking command that you've pasted in the original
>>report it had:
>>
>> /usr/local/src/httpd-2.0.54/srclib/apr/libapr-0.la
>>
>>which is the one that you need to check.
>
>
> Actually, I had taken a look in that file but there's nothing being
> defined in there.
certainly, it's a C define, which can't be seen from .la. I was just
saying that .so has nothing to do with it. It's .la that's linked.
>>>I then grepped by mod_perl and httpd source directories for header files
>>>which defined APR_HAS_THREADS. I changed srclib/apr/include/apr.h and
>>>srclib/apr/include/apr.hnw then reconfigured mod_perl but it still
>>>failed.
>>
>>Please find all occurences of apr.h and check the value of APR_HAS_THREADS.
>
>
> OK, I ran the following command and have found the file which set that
> value to 1:
>
> find / -name *apr.h -print -exec grep APR_HAS_THREADS {} \;
>
> After setting it to 0, I reran the build process. That appears to be
> working now but I'm still having some problems with tests failing :(.
> The important thing is the debug flags should be on for this build. I
> can live with some of the tests failing.
I'd suggest to nuke all occurences of Apache and libapr, clean your system
completely and then start from scratch.
--
__________________________________________________________________
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
Re: [MP2] Bug report - errors when compiling with MP_DEBUG flag
Posted by William McKee <wi...@knowmad.com>.
On Tue, Jun 07, 2005 at 11:35:46PM +1000, Stas Bekman wrote:
> That's OK, William. But you aren't after defined symbols in .so, you are
> after the APR_HAS_THREADS define which should be undef. Moreover, you are
> building a static version so the symbols aren't coming from .so but .a/.la
> archives.
OK, that's useful to know.
> If you look at the linking command that you've pasted in the original
> report it had:
>
> /usr/local/src/httpd-2.0.54/srclib/apr/libapr-0.la
>
> which is the one that you need to check.
Actually, I had taken a look in that file but there's nothing being
defined in there.
> >I then grepped by mod_perl and httpd source directories for header files
> >which defined APR_HAS_THREADS. I changed srclib/apr/include/apr.h and
> >srclib/apr/include/apr.hnw then reconfigured mod_perl but it still
> >failed.
>
> Please find all occurences of apr.h and check the value of APR_HAS_THREADS.
OK, I ran the following command and have found the file which set that
value to 1:
find / -name *apr.h -print -exec grep APR_HAS_THREADS {} \;
After setting it to 0, I reran the build process. That appears to be
working now but I'm still having some problems with tests failing :(.
The important thing is the debug flags should be on for this build. I
can live with some of the tests failing.
Thanks,
William
--
Knowmad Services Inc.
http://www.knowmad.com
Re: [MP2] Bug report - errors when compiling with MP_DEBUG flag
Posted by Stas Bekman <st...@stason.org>.
William McKee wrote:
> On Tue, Jun 07, 2005 at 09:34:29AM +1000, Stas Bekman wrote:
>
>>William, as you can see from the source src/modules/perl/modperl_util.h
>>
>>#if defined(MP_TRACE) && defined(APR_HAS_THREADS)
>>#define MP_TRACEf_TID "/tid 0x%lx"
>>#define MP_TRACEv_TID (unsigned long)apr_os_thread_current()
>>
>>The symbol is available if APR_HAS_THREADS is defined. So the apr header
>>containing this definition found by mod_perl says that APR_HAS_THREADS is
>>defined, whereas the library it tries to link against was compiled with
>>threads disabled. Meaning that you have more than one libapr on your
>>system and the wrong library gets linked.
>
>
> Stas,
>
> Thanks for the references. I tried searching for libaprutil-0.so but
> couldn't see any in the path. I used nm on every libaprutil-0.so file I
> could find but turned up no instances of a library which had the
> apr_os_thread_current function.
That's OK, William. But you aren't after defined symbols in .so, you are
after the APR_HAS_THREADS define which should be undef. Moreover, you are
building a static version so the symbols aren't coming from .so but .a/.la
archives. If you look at the linking command that you've pasted in the
original report it had:
/usr/local/src/httpd-2.0.54/srclib/apr/libapr-0.la
which is the one that you need to check.
> I then grepped by mod_perl and httpd source directories for header files
> which defined APR_HAS_THREADS. I changed srclib/apr/include/apr.h and
> srclib/apr/include/apr.hnw then reconfigured mod_perl but it still
> failed.
Please find all occurences of apr.h and check the value of APR_HAS_THREADS.
--
__________________________________________________________________
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
Re: [MP2] Bug report - errors when compiling with MP_DEBUG flag
Posted by William McKee <wi...@knowmad.com>.
On Tue, Jun 07, 2005 at 09:34:29AM +1000, Stas Bekman wrote:
> William, as you can see from the source src/modules/perl/modperl_util.h
>
> #if defined(MP_TRACE) && defined(APR_HAS_THREADS)
> #define MP_TRACEf_TID "/tid 0x%lx"
> #define MP_TRACEv_TID (unsigned long)apr_os_thread_current()
>
> The symbol is available if APR_HAS_THREADS is defined. So the apr header
> containing this definition found by mod_perl says that APR_HAS_THREADS is
> defined, whereas the library it tries to link against was compiled with
> threads disabled. Meaning that you have more than one libapr on your
> system and the wrong library gets linked.
Stas,
Thanks for the references. I tried searching for libaprutil-0.so but
couldn't see any in the path. I used nm on every libaprutil-0.so file I
could find but turned up no instances of a library which had the
apr_os_thread_current function.
I then grepped by mod_perl and httpd source directories for header files
which defined APR_HAS_THREADS. I changed srclib/apr/include/apr.h and
srclib/apr/include/apr.hnw then reconfigured mod_perl but it still
failed.
Once I commented out the defines in modperl_util.h, it appears to have
worked. I'll submit my bug report in a separate email.
Thanks,
William
--
Knowmad Services Inc.
http://www.knowmad.com
Re: [MP2] Bug report - errors when compiling with MP_DEBUG flag
Posted by Stas Bekman <st...@stason.org>.
William McKee wrote:
> On Sat, Jun 04, 2005 at 09:29:53PM +1000, Stas Bekman wrote:
>
>>>/stubs/usr_local/src/mod_perl-2.0.0/src/modules/perl/modperl_util.c:472:
>>>undefined reference to `apr_os_thread_current'
>>>*** Error code 1
>>
>>William, please try:
>>http://perl.apache.org/docs/2.0/user/troubleshooting/troubleshooting.html#undefined_symbol__apr_table_compress
>
>
> Stas,
>
> Thanks for the link. Unfortunately the error is occurring during the make
> process so I never get a blib/arch/auto/APR/APR.so being created. I
> tried running nm on the libapr-0.so.9 in my httpd-2.0.54 source
> directory.
>
> nm /usr/local/src/httpd-2.0.54/srclib/apr/.libs/libapr-0.so.9 | grep os_thread_current
>
> However, running that command without _current returns the following:
>
> 00015f3c T apr_os_thread_get
> 00015f48 T apr_os_threadkey_get
>
> While debugging last week, I seem to remember reading that
> apr_os_thread_get is synonymous with apr_os_thread_current. I wonder why
> the later would not be defined?
William, as you can see from the source src/modules/perl/modperl_util.h
#if defined(MP_TRACE) && defined(APR_HAS_THREADS)
#define MP_TRACEf_TID "/tid 0x%lx"
#define MP_TRACEv_TID (unsigned long)apr_os_thread_current()
The symbol is available if APR_HAS_THREADS is defined. So the apr header
containing this definition found by mod_perl says that APR_HAS_THREADS is
defined, whereas the library it tries to link against was compiled with
threads disabled. Meaning that you have more than one libapr on your
system and the wrong library gets linked.
--
__________________________________________________________________
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
Re: [MP2] Bug report - errors when compiling with MP_DEBUG flag
Posted by William McKee <wi...@knowmad.com>.
On Sat, Jun 04, 2005 at 09:29:53PM +1000, Stas Bekman wrote:
> >/stubs/usr_local/src/mod_perl-2.0.0/src/modules/perl/modperl_util.c:472:
> >undefined reference to `apr_os_thread_current'
> >*** Error code 1
>
> William, please try:
> http://perl.apache.org/docs/2.0/user/troubleshooting/troubleshooting.html#undefined_symbol__apr_table_compress
Stas,
Thanks for the link. Unfortunately the error is occurring during the make
process so I never get a blib/arch/auto/APR/APR.so being created. I
tried running nm on the libapr-0.so.9 in my httpd-2.0.54 source
directory.
nm /usr/local/src/httpd-2.0.54/srclib/apr/.libs/libapr-0.so.9 | grep os_thread_current
However, running that command without _current returns the following:
00015f3c T apr_os_thread_get
00015f48 T apr_os_threadkey_get
While debugging last week, I seem to remember reading that
apr_os_thread_get is synonymous with apr_os_thread_current. I wonder why
the later would not be defined?
Thanks,
William
--
Knowmad Services Inc.
http://www.knowmad.com
Re: [MP2] Bug report - errors when compiling with MP_DEBUG flag
Posted by Stas Bekman <st...@stason.org>.
William McKee wrote:
> -------------8<---------- Start Bug Report ------------8<----------
> 1. Problem Description:
>
> While trying to track down a segfault that is occurring with
> Image::Magick, I went to build a version of mod_perl with debugging
> flags. Unfortunately this does not build for me under FreeBSD 5.3. Here
> is the error I receive during make:
>
> /usr/local/src/httpd-2.0.54/srclib/apr/libtool --silent --mode=link gcc -D_REENTRANT -D_THREAD_SAFE -DAP_HAVE_DESIGNATED_INITIALIZER -I/usr/local/src/httpd-2.0.54/srclib/apr/include -I/usr/local/src/httpd-2.0.54/srclib/apr-util/include -I/usr/local/include -I. -I/usr/local/src/httpd-2.0.54/os/unix -I/usr/local/src/httpd-2.0.54/server/mpm/prefork -I/usr/local/src/httpd-2.0.54/modules/http -I/usr/local/src/httpd-2.0.54/modules/filters -I/usr/local/src/httpd-2.0.54/modules/proxy -I/usr/local/src/httpd-2.0.54/include -I/usr/local/src/httpd-2.0.54/modules/generators -I/usr/local/src/httpd-2.0.54/modules/dav/main -export-dynamic -L/usr/local/lib -o httpd modules.lo /stubs/usr_local/src/mod_perl-2.0.0/src/modules/perl/mod_perl.a modules/aaa/mod_access.la modules/aaa/mod_auth.la modules/filters/mod_include.la modules/loggers/mod_log_config.la modules/metadata/mod_env.la modules/metadata/mod_setenvif.la modules/http/mod_http.la modules/http/mod_mime.la modules/generators/mo
d_status.la modules/generators/mod_autoindex.la modules/generators/mod_asis.la modules/generators/mod_cgi.la modules/mappers/mod_negotiation.la modules/mappers/mod_dir.la modules/mappers/mod_imap.la modules/mappers/mod_actions.la modules/mappers/mod_userdir.la modules/mappers/mod_alias.la modules/mappers/mod_rewrite.la modules/mappers/mod_so.la server/mpm/prefork/libprefork.la server/libmain.la os/unix/libos.la /usr/local/src/httpd-2.0.54/srclib/pcre/libpcre.la -Wl,-R/usr/public/lib/perl5/5.8.6/i386-freebsd-64int/CORE -Wl,-E -L/usr/local/lib /usr/public/lib/perl5/5.8.6/i386-freebsd-64int/auto/DynaLoader/DynaLoader.a -L/usr/public/lib/perl5/5.8.6/i386-freebsd-64int/CORE -lperl -lm -lcrypt -lutil /usr/local/src/httpd-2.0.54/srclib/apr-util/libaprutil-0.la -lexpat /usr/local/src/httpd-2.0.54/srclib/apr/libapr-0.la -lm -lcrypt
> /stubs/usr_local/src/mod_perl-2.0.0/src/modules/perl/mod_perl.a(modperl_util.o)(.text+0x14a8): In function `modperl_perl_call_list':
> /stubs/usr_local/src/mod_perl-2.0.0/src/modules/perl/modperl_util.c:472: undefined reference to `apr_os_thread_current'
> *** Error code 1
William, please try:
http://perl.apache.org/docs/2.0/user/troubleshooting/troubleshooting.html#undefined_symbol__apr_table_compress
--
__________________________________________________________________
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