[mod_python] old libexpat shared library

Graham Dumpleton graham.dumpleton at gmail.com
Mon Apr 7 02:49:01 EDT 2008


You would need to go through the same ldd debugging to work out why.

BTW, if nothing is using the wrong/bad versions of apache/expat/apr
installed under /usr/local, can you just remove them so you are doing
a clean build with their only being the single expat version
installed.

Also be aware that if you can get past the dual expat linkage problem,
if you use Python 2.5, what version of expat library is used doesn't
even matter as in Python 2.5 the names of contained expat library in
Python expat module and namespace prefixed anyway and there is no
clash.

Graham

2008/4/7 Luyi Chen <lychen1109 at gmail.com>:
> Thanks Graham,
>
>  I am almost done, but still need one more step. Here's what I did:
>
>  1) I installed Apache2.2.6 included apr
>  2) When I tried to install the included version of apr-util, I got the
>  following error
>  libtool: install: error: cannot install `libaprutil-1.la' to a
>  directory not ending in /usr/local/apache2/lib
>
>  A little Googling shows someone else also meet the problem, but
>  without finding the reason.
>
>  3) So I downloaded apr-util-1.2.12 from Apache website, and installed
>  it without problem.
>  4) I compiled Apache again with options pointing to the formerly
>  installed apr and apr-util
>  5) Now, when I ldd httpd, I got the following info
>
>         libz.so.1 => /usr/lib/libz.so.1 (0x00002aebe6011000)
>         libm.so.6 => /lib/libm.so.6 (0x00002aebe6127000)
>         libaprutil-1.so.0 =>
>  /usr/local/apr-util-httpd//lib/libaprutil-1.so.0 (0x00002aebe62ac000)
>         libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00002aebe63c4000)
>
>         libapr-1.so.0 => /usr/local/apache2/lib/libapr-1.so.0
>  (0x00002aebe64e8000)
>         librt.so.1 => /lib/librt.so.1 (0x00002aebe6610000)
>         libcrypt.so.1 => /lib/libcrypt.so.1 (0x00002aebe6718000)
>         libpthread.so.0 => /lib/libpthread.so.0 (0x00002aebe684c000)
>         libdl.so.2 => /lib/libdl.so.2 (0x00002aebe6961000)
>         libc.so.6 => /lib/libc.so.6 (0x00002aebe6a63000)
>         /lib64/ld-linux-x86-64.so.2 (0x00002aebe5efa000)
>
>  This seems good, because the libexpat in my /usr/lib directory is the right one.
>
>  6) I restarted Apache
>  7) I checked runtime context of Apache, then I got this
>
>  $ ps aux | grep http | head -3
>  root      4757  0.0  3.9  47972 10212 ?        Ss   Apr04   0:00
>  /usr/local/apache2/bin/httpd -k restart
>  apache   29984  0.0  3.4  48104  8992 ?        S    23:31   0:00
>  /usr/local/apache2/bin/httpd -k restart
>  apache   29985  0.0  3.2  47972  8580 ?        S    23:31   0:00
>  /usr/local/apache2/bin/httpd -k restart
>
>  $ sudo /usr/sbin/lsof -p 4757 | grep expat
>  httpd   4757 root  mem    REG     8,1    397288 1183944
>  /usr/local/apache2/lib/libexpat.so.0.1.0
>  httpd   4757 root  mem    REG     8,1    143944 1115945
>  /usr/lib/libexpat.so.1.0.0
>
>  Here's the problem: the runtime Apache still loads two version of
>  libexpat. And the Segmentation fault error still hits me as expected.
>
>  After I recompiled Apache, the original libexpat.so.0.1.0 still sits
>  in Apache lib directory. According to the ldd httpd result, it's not
>  needed anymore.
>
>  My question is why does it still loaded? Does simply deleting them an
>  elegant way to solve it?
>
>  Luyi
>
>
>
>
>
>
>  On Sun, Apr 6, 2008 at 6:14 PM, Graham Dumpleton
>
>
> <graham.dumpleton at gmail.com> wrote:
>  > Try getting the following option passed through to configure of apr-util:
>  >
>  >   --with-expat=/usr
>  >
>  >  Can't remember if top level Apache configure will pass it through automatically.
>  >
>  >  Think that is the correct directory to give as argument.
>  >
>  >  Graham
>  >
>  >  2008/4/6 Luyi Chen <lychen1109 at gmail.com>:
>  >
>  >
>  > > Thanks Graham,
>  >  >
>  >  >  Here's the info:
>  >  >
>  >  >  $ ldd /usr/local/apache2/bin/httpd
>  >  >         libz.so.1 => /usr/lib/libz.so.1 (0x00002b02938de000)
>  >  >         libm.so.6 => /lib/libm.so.6 (0x00002b02939f4000)
>  >  >         libaprutil-1.so.0 => /usr/local/apache2/lib/libaprutil-1.so.0
>  >  >  (0x00002b0293b79000)
>  >  >
>  >  >         libexpat.so.0 => /usr/local/apache2/lib/libexpat.so.0
>  >  >  (0x00002b0293c91000)
>  >  >         libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00002b0293db3000)
>  >  >         libapr-1.so.0 => /usr/local/apache2/lib/libapr-1.so.0
>  >  >  (0x00002b0293ed6000)
>  >  >         librt.so.1 => /lib/librt.so.1 (0x00002b0293ffe000)
>  >  >         libcrypt.so.1 => /lib/libcrypt.so.1 (0x00002b0294107000)
>  >  >         libpthread.so.0 => /lib/libpthread.so.0 (0x00002b029423a000)
>  >  >         libdl.so.2 => /lib/libdl.so.2 (0x00002b029434f000)
>  >  >         libc.so.6 => /lib/libc.so.6 (0x00002b0294452000)
>  >  >         /lib64/ld-linux-x86-64.so.2 (0x00002b02937c7000)
>  >  >  $ ldd /usr/lib/libz.so.1
>  >  >         libc.so.6 => /lib/libc.so.6 (0x00002b2764dc5000)
>  >  >         /lib64/ld-linux-x86-64.so.2 (0x0000555555554000)
>  >  >  $ ldd /lib/libm.so.6
>  >  >         libc.so.6 => /lib/libc.so.6 (0x00002b8bf9a3c000)
>  >  >         /lib/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
>  >  >  (0x0000555555554000)
>  >  >  $ ldd /usr/local/apache2/lib/libaprutil-1.so.0
>  >  >
>  >  >         libexpat.so.0 => /usr/local/apache2/lib/libexpat.so.0
>  >  >  (0x00002b61001d0000)
>  >  >         libapr-1.so.0 => /usr/local/apache2/lib/libapr-1.so.0
>  >  >  (0x00002b61002f2000)
>  >  >         librt.so.1 => /lib/librt.so.1 (0x00002b610041e000)
>  >  >         libcrypt.so.1 => /lib/libcrypt.so.1 (0x00002b6100526000)
>  >  >         libpthread.so.0 => /lib/libpthread.so.0 (0x00002b610065a000)
>  >  >         libdl.so.2 => /lib/libdl.so.2 (0x00002b610076f000)
>  >  >         libc.so.6 => /lib/libc.so.6 (0x00002b6100871000)
>  >  >         /lib64/ld-linux-x86-64.so.2 (0x0000555555554000)
>  >  >  $ ldd /usr/local/apache2/lib/libexpat.so.0
>  >  >         libc.so.6 => /lib/libc.so.6 (0x00002af851439000)
>  >  >         /lib64/ld-linux-x86-64.so.2 (0x0000555555554000)
>  >  >  $ ldd /usr/lib/libexpat.so.1
>  >  >         libc.so.6 => /lib/libc.so.6 (0x00002b96d0162000)
>  >  >         /lib64/ld-linux-x86-64.so.2 (0x0000555555554000)
>  >  >  $ ldd /usr/local/apache2/lib/libapr-1.so.0
>  >  >         librt.so.1 => /lib/librt.so.1 (0x00002ba649f41000)
>  >  >         libcrypt.so.1 => /lib/libcrypt.so.1 (0x00002ba64a04a000)
>  >  >         libpthread.so.0 => /lib/libpthread.so.0 (0x00002ba64a17d000)
>  >  >         libdl.so.2 => /lib/libdl.so.2 (0x00002ba64a292000)
>  >  >         libc.so.6 => /lib/libc.so.6 (0x00002ba64a395000)
>  >  >         /lib64/ld-linux-x86-64.so.2 (0x0000555555554000)
>  >  >  $ ldd /lib/librt.so.1
>  >  >         libc.so.6 => /lib/libc.so.6 (0x00002aab3a499000)
>  >  >         libpthread.so.0 => /lib/libpthread.so.0 (0x00002aab3a6d3000)
>  >  >         /lib/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
>  >  >  (0x0000555555554000)
>  >  >  $ ldd /lib/libcrypt.so.1
>  >  >         libc.so.6 => /lib/libc.so.6 (0x00002ae20b9dd000)
>  >  >         /lib/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
>  >  >  (0x0000555555554000)
>  >  >  $ ldd /lib/libpthread.so.0
>  >  >         libc.so.6 => /lib/libc.so.6 (0x00002b15ada6d000)
>  >  >         /lib/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
>  >  >  (0x0000555555554000)
>  >  >  $ ldd /lib/libdl.so.2
>  >  >         libc.so.6 => /lib/libc.so.6 (0x00002b4f78de5000)
>  >  >         /lib/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
>  >  >  (0x0000555555554000)
>  >  >  $ ldd /lib/libc.so.6
>  >  >         /lib/ld-linux-x86-64.so.2 (0x00002b7744489000)
>  >  >
>  >  >  My own analysis is that apr-util depends on the old version of
>  >  >  libexpat. So I checked Apache installation doc, and found that I can
>  >  >  use --with-included-apr to force Apache use the bundled apr. Since my
>  >  >  os (Ubuntu 6.06) is an old version, I thought this is very likely to
>  >  >  be the cause.
>  >  >
>  >  >  I tried to recompile Apache with the --with-included-apr option,
>  >  >  here's my newest config.nice
>  >  >  #! /bin/sh
>  >  >  #
>  >  >  # Created by configure
>  >  >
>  >  >  "./configure" \
>  >  >  "--prefix=/usr/local/apache2" \
>  >  >  "--enable-proxy" \
>  >  >  "--enable-proxy-http" \
>  >  >  "--enable-proxy-balancer" \
>  >  >  "--enable-dav" \
>  >  >  "--enable-rewrite" \
>  >  >  "--enable-deflate" \
>  >  >  "--with-included-apr" \
>  >  >  "$@"
>  >  >
>  >  >
>  >  >  But it didn't solve the problem. The above information from ldd
>  >  >  command is actually after I recompiled Apache, which is unchanged.
>  >  >
>  >  >  The libexpat on my OS is the latest version, because I have runned this command:
>  >  >  apt-get install libexpat1
>  >  >  And it says it's already the newest version, which is 1.95.8-3
>  >  >  according to the ubuntu's pachage directory.
>  >  >
>  >  >  Luyi
>  >  >
>  >  >
>  >  >
>  >  >
>  >  >
>  >  >
>  >  >
>  >  >
>  >  >  On Sun, Apr 6, 2008 at 3:09 PM, Graham Dumpleton
>  >  >  <graham.dumpleton at gmail.com> wrote:
>  >  >  > 2008/4/5 Luyi Chen <lychen1109 at gmail.com>:
>  >  >  >
>  >  >  > > Hi,
>  >  >  >  >
>  >  >  >  >  I am trying to make mod_python working on Apache 2.2.6, ubuntu dapper
>  >  >  >  >  6.06. But I was hit by the problem of wrong expat library issue, as
>  >  >  >  >  stated by Graham Dumpleton, on this page
>  >  >  >  >  http://www.dscpl.com.au/wiki/ModPython/Articles/ExpatCausingApacheCrash
>  >  >  >  >
>  >  >  >  >  I am using a custom compiled Apache2 in /usr/local/apache2, so I
>  >  >  >  >  checked version of libexpat with the following line,
>  >  >  >  >
>  >  >  >  >  ldd /usr/local/apache2/bin/httpd
>  >  >  >  >
>  >  >  >  >  in the result there're two lines
>  >  >  >  >   libexpat.so.0 => /usr/local/apache2/lib/libexpat.so.0 (0x00002b4f4e1c5000)
>  >  >  >  >   libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00002b4f4e2e7000)
>  >  >  >
>  >  >  >  If you have this, then something is quite broken with your Apache
>  >  >  >  httpd to start with, before even mod_python is loaded.
>  >  >  >
>  >  >  >  What is the full 'ldd' output from running it against 'httpd'.
>  >  >  >
>  >  >  >  Also go through each of the .so file it is dependent upon and run
>  >  >  >  'ldd' on them as well and post all the results.
>  >  >  >
>  >  >  >  As far as I can tell, one of the .so files depended on by httpd is
>  >  >  >  itself dependent on libexpat (a different version), as I can't see
>  >  >  >  otherwise how you can get an executable dependent on two different
>  >  >  >  versions of a shared library.
>  >  >  >
>  >  >  >  Graham
>  >  >  >
>  >  >  >
>  >  >  >  >  The one in /usr/local/apache2/lib is an old version 1.95.2, while the
>  >  >  >  >  one in /usr/lib is 1.95.8, which is identical to the version of
>  >  >  >  >  libexpat used by python.
>  >  >  >  >
>  >  >  >  >  How do I tell Apache to use the new version of libexpat only?
>  >  >  >  >
>  >  >  >  >  Luyi
>  >  >  >  >  _______________________________________________
>  >  >  >  >  Mod_python mailing list
>  >  >  >  >  Mod_python at modpython.org
>  >  >  >  >  http://mailman.modpython.org/mailman/listinfo/mod_python
>  >  >  >  >
>  >  >  >
>  >  >
>  >
>


More information about the Mod_python mailing list