Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#4454 closed defect (worksforme)

Trac 0.11 and Apache trouble

Reported by: Christian Boos Owned by: Christopher Lenz
Priority: normal Milestone:
Component: web frontend/mod_python Version: devel
Severity: major Keywords: genshi expat apache
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

This ticket is mostly for documenting a problem that can happen when upgrading an existing Trac 0.10 installation running under Apache to Trac 0.11.

You may get the following segfault:

#0  0x0000002a96408140 in strlen () from /lib64/tls/libc.so.6
#1  0x0000002a96eef8bb in PyString_FromString (str=0x0) at stringobject.c:106
#2  0x0000002a96f3de3c in PyModule_AddStringConstant (m=0x2a984d4210,
    name=0x2a988dd6d3 "XML_ERROR_UNDECLARING_PREFIX",
    value=<value optimized out>) at modsupport.c:567
#3  0x0000002a988b9e98 in initpyexpat ()
    at /usr/local/src/Python-2.4.2/Modules/pyexpat.c:1972
#4  0x0000002a96f3a52b in _PyImport_LoadDynamicModule (
    name=0x7fbfff46cc "pyexpat",
    pathname=0x7fbfff4200 "/opt/python-2.4.2/lib/python2.4/lib-dynload/pyexpat.so", fp=<value optimized out>) at importdl.c:53
#5  0x0000002a96f38f54 in import_submodule (mod=0x2a970a7d90,
    subname=0x7fbfff46cc "pyexpat", fullname=0x7fbfff46cc "pyexpat")
    at import.c:2262

This happens due to a binary incompatibility related to the expat library.

Apache uses one version:

# ldd $(which httpd) | grep expat
        libexpat.so.0 => /usr/lib64/libexpat.so.0 (0x0000002a95a8a000)

# strings /usr/lib64/libexpat.so.0  |grep expat_
expat_1.95.7

Python expects another:

# strings /opt/python-2.4.2/lib/python2.4/lib-dynload/pyexpat.so  | grep expat_
expat_1.95.8

At runtime, Python will get to use some symbols found in the already loaded 1.95.7 one.

At this point, there's not much to do, you need to upgrade either one so that they use the same library (who said DLL hell was Windows specific?).

I believe that Python 2.5 "namespaces" the expat library, so it might be worth to give it a try.

Attachments (0)

Change History (4)

comment:1 by Matthew Good, 18 years ago

It looks good on my system (Ubuntu Edgy):

$ ldd /usr/sbin/apache2 | grep expat
        libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00002b9241cb9000)
$ strings /usr/lib/libexpat.so.1 | grep expat_
expat_1.95.8
$ strings /usr/lib/python2.4/lib-dynload/pyexpat.so | grep expat_
expat_1.95.8

How did you install Python? One of the features of packaging systems on Linux is to make sure that your programs are consistent in the library versions they're compiled against to prevent these sorts of linking errors.

Besides possibly documenting this in the Wiki I don't see anything here that we can take action on here. So, I think this either needs converted to a task for documenting this, or simply closed.

comment:2 by Christian Boos, 18 years ago

Resolution: worksforme
Status: newclosed

See also http://www.dscpl.com.au/wiki/ModPython/Articles/ExpatCausingApacheCrash which describes this issue at length and suggests some workarounds.

(worksforme as there are documented workarounds)

comment:3 by anonymous, 18 years ago

Milestone: none0.11

set to 0.11 as expat is used since then extensively

in reply to:  3 comment:4 by Matthew Good, 18 years ago

Milestone: 0.11

Replying to anonymous:

set to 0.11 as expat is used since then extensively

The milestone does not apply since this is closed as worksforme.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.