Loading ...
Sorry, an error occurred while loading the content.

Re: [MP2] Bug report - errors when compiling with MP_DEBUG flag

Expand Messages
  • Stas Bekman
    ... d_status.la modules/generators/mod_autoindex.la modules/generators/mod_asis.la modules/generators/mod_cgi.la modules/mappers/mod_negotiation.la
    Message 1 of 8 , Jun 4, 2005
    • 0 Attachment
      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@... http://use.perl.org http://apacheweek.com
      http://modperlbook.org http://apache.org http://ticketmaster.com
    • William McKee
      ... 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
      Message 2 of 8 , Jun 5, 2005
      • 0 Attachment
        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
      • Stas Bekman
        ... 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
        Message 3 of 8 , Jun 6, 2005
        • 0 Attachment
          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@... http://use.perl.org http://apacheweek.com
          http://modperlbook.org http://apache.org http://ticketmaster.com
        • William McKee
          ... 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
          Message 4 of 8 , Jun 6, 2005
          • 0 Attachment
            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
          • Stas Bekman
            ... 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
            Message 5 of 8 , Jun 7, 2005
            • 0 Attachment
              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@... http://use.perl.org http://apacheweek.com
              http://modperlbook.org http://apache.org http://ticketmaster.com
            • William McKee
              ... OK, that s useful to know. ... Actually, I had taken a look in that file but there s nothing being defined in there. ... OK, I ran the following command
              Message 6 of 8 , Jun 9, 2005
              • 0 Attachment
                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
              • Stas Bekman
                William McKee wrote: [...] ... 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
                Message 7 of 8 , Jun 11, 2005
                • 0 Attachment
                  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@... http://use.perl.org http://apacheweek.com
                  http://modperlbook.org http://apache.org http://ticketmaster.com
                Your message has been successfully submitted and would be delivered to recipients shortly.