[XML-SIG] Failure when profiling XML processing

Luke Maurer jyrinx@mindspring.com
14 Apr 2002 19:41:44 -0700


I'm trying to profile some code that parses an XML file. (I've never
used a profiler or done optimizations (this is my first big project)
before.) Here's what happens:

--- snip ---

>>> profile.run("import testCardSet; testCardSet.printAll()")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.2/profile.py", line 71, in run
    prof = prof.run(statement)
  File "/usr/lib/python2.2/profile.py", line 404, in run
    return self.runctx(cmd, dict, dict)
  File "/usr/lib/python2.2/profile.py", line 410, in runctx
    exec cmd in globals, locals
  File "<string>", line 1, in ?
  File "testCardSet.py", line 7, in ?
    set = cardSet.LocalCardSet(filename)
  File "cardSet.py", line 26, in __init__
    self.loadFromFile(filename)
  File "cardSet.py", line 39, in loadFromFile
    loadCardSet.loadCardSet(self, filename)
  File "loadCardSet.py", line 241, in loadCardSet
    doc = xml.dom.minidom.parse(nrcsFile)
  File
"/var/tmp/python2-2.2.1-root/usr/lib/python2.2/xml/dom/minidom.py",
  line 962, in parse
  File
"/var/tmp/python2-2.2.1-root/usr/lib/python2.2/xml/dom/minidom.py",
  line 954, in _doparse
  File
"/var/tmp/python2-2.2.1-root/usr/lib/python2.2/xml/dom/pulldom.py",
  line 255, in getEvent
  File
 
"/var/tmp/python2-2.2.1-root/usr/lib/python2.2/xml/sax/expatreader.py",
  line 143, in feed
  File
 
"/var/tmp/python2-2.2.1-root/usr/lib/python2.2/xml/sax/expatreader.py",
  line 222, in start_element_ns
  File "/usr/lib/python2.2/profile.py", line 214, in trace_dispatch_i
    if self.dispatch[event](self, frame,t):
  File "/usr/lib/python2.2/profile.py", line 260, in trace_dispatch_call
    assert rframe.f_back is frame.f_back, ("Bad call", rfn,
AssertionError: ('Bad call',
('/var/tmp/python2-2.2.1-root/usr/lib/python2.2/xml/sax/expatreader.py',
132, 'feed'), <frame object at 0x81d1914>, <frame object at 0x8129f34>,
<frame object at 0x81d0bc4>, <frame object at 0x81d139c>)

--- snip ---

(I know that wrapped funny; hope it's understandable)

I don't really know, but this looks like a bug to me. The code runs fine
outside of the profiler. I'll submit a bug report to SourceForge if it
is indeed a bug in the XML tools.

Jyrinx
jyrinx_list@mindspring.com