classification
Title: ElementTree parsing bus error (but only from mod_python)
Type: crash Stage:
Components: Library (Lib), macOS Versions: Python 2.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, jackdied, kathyvs, nicodotti
Priority: normal Keywords:

Created on 2008-05-23 17:59 by kathyvs, last changed 2008-08-01 21:01 by jackdied. This issue is now closed.

Messages (5)
msg67259 - (view) Author: Kathy Van Stone (kathyvs) Date: 2008-05-23 17:59
The follow code works fine when run directly. It crashes (with a bus
error) if used as a mod_python handler. It doesn't crash if ElementTree
is replaced with cElementTree.

from xml.etree import ElementTree as eltree

def handler(req):
    body = """<?xml version='1.0' encoding='utf-8'?>
<collection uuid="~01edc22c1628e711ddb20220296b032019"
href="http://localhost:8888/ws/dataset/~01edc22c1628e711ddb20220296b032019">
  <name>Service_offerings query at 2008-05-23 12:47:28.038233</name>
</collection>"""

    response_elem = eltree.XML(body)
    return 0


I don't know if this a mod_python or ElementTree issue, but it looks
more like an ElementTree problem.
msg70045 - (view) Author: nicodotti (nicodotti) Date: 2008-07-19 18:39
Thanks for logging this bug Kathy I had the same problem for 2 days! I
used the cElementTree as you mentioned and it worked fine
msg70046 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-07-19 19:02
This is probably a mod_python problem.
msg70047 - (view) Author: Kathy Van Stone (kathyvs) Date: 2008-07-19 19:07
Does ElementTree do anything unusual in importing? That is one area
where mod_python is different from standard python.
msg70592 - (view) Author: Jack Diederich (jackdied) * (Python committer) Date: 2008-08-01 21:01
It is a common apache problem.  Elementree imports an expat parser
(presumably cElementree doesn't) and different versions of expat play
together very poorly.  Lots of apache modules load one xml lib version
or another and they tend to step on each others toes .. and then segfault.

IIRC the only way to resolve this is to figure out which loaded apache
modules are using expat and recompile them all against the same version.
 Not fun.
History
Date User Action Args
2008-08-01 21:01:17jackdiedsetstatus: open -> closed
resolution: not a bug
messages: + msg70592
nosy: + jackdied
2008-07-19 19:07:54kathyvssetmessages: + msg70047
2008-07-19 19:02:10benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg70046
2008-07-19 18:39:08nicodottisetnosy: + nicodotti
messages: + msg70045
2008-05-23 17:59:38kathyvscreate