You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/loewis'closed_at=<Date2002-08-04.08:27:28.000>created_at=<Date2002-03-25.21:15:27.000>labels= ['library']
title='profiling with xml parsing asserts'updated_at=<Date2002-08-04.08:27:28.000>user='https://bugs.python.org/ainsinga'
I'm getting a 'bad call' assertion error when using the
profiler when parsing XML. (It works ok without the
profiler, and if I don't call SAXparser.parse it
doesn't happen.)
Python 2.2 (#1, Dec 23 2001, 09:30:32)
[GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-98)] on
linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> import t4crash
start document
end document
>>> import profile
>>> t4crash.test()
start document
end document
>>> profile.run('t4crash.test()')
start document
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 "t4crash.py", line 46, in test
main(files)
File "t4crash.py", line 39, in main
SAXparser.parse(fileName)
File
"/var/tmp/python2-2.2-root/usr/lib/python2.2/xml/sax/expatreader.py",
line 53, in parse
File
"/var/tmp/python2-2.2-root/usr/lib/python2.2/xml/sax/xmlreader.py",
line
123, in parse File
"/var/tmp/python2-2.2-root/usr/lib/python2.2/xml/sax/expatreader.py",
line 106,
in feed
File
"/var/tmp/python2-2.2-root/usr/lib/python2.2/xml/sax/expatreader.py",
line 179, in start_element
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-root/usr/lib/python2.2/xml/sax/expatreader.py',
95,
'feed'), <frame object at 0x81d5454>, <frame object at
0x81c82e4>, <frame object
at 0x81d50b4>, <frame object at 0x81d5284>)
>>>
[ainsinga@ainsinga index_xml]$ cat t4crash.py
#!/usr/bin/env python2
I reproduced this with current CVS Python on Windows;
see attached traceback.txt, which shows a screen dump of
the offending <wink> interactive session.
Also, I reproduced this on another FreeBSD box today as
well.
andrewl@taz:andrewl$ python
Python 2.2.1 (#1, May 27 2002, 16:42:22)
[GCC 2.95.3 20010315 (release) [FreeBSD]] on freebsd4
-a
andrewl commented on Jul 2, 2002
andrewlmannequin
Mannequin
More actions
Logged In: YES
user_id=28733
Here is a session log for a much more self-contained
regression file (xmltest.py):
andrewl@taz:andrewl$ python
Python 2.2.1 (#1, May 27 2002, 16:42:22)
[GCC 2.95.3 20010315 (release) [FreeBSD]] on freebsd4
Type "help", "copyright", "credits" or "license" for more
information.
>>> import profile
>>> import xmltest
>>> profile.run('xmltest.main()')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/lib/python2.2/profile.py", line 71, in
run
prof = prof.run(statement)
File "/usr/local/lib/python2.2/profile.py", line 404, in
run
return self.runctx(cmd, dict, dict)
File "/usr/local/lib/python2.2/profile.py", line 410, in
runctx
exec cmd in globals, locals
File "<string>", line 1, in ?
File "xmltest.py", line 24, in main
xml.sax.parseString(testxml, chand)
File "/usr/local/lib/python2.2/xml/sax/__init__.py", line
49, in parseString
parser.parse(inpsrc)
File "/usr/local/lib/python2.2/xml/sax/expatreader.py",
line 90, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/local/lib/python2.2/xml/sax/xmlreader.py", line
123, in parse
self.feed(buffer)
File "/usr/local/lib/python2.2/xml/sax/expatreader.py",
line 143, in feed
self._parser.Parse(data, isFinal)
File "/usr/local/lib/python2.2/xml/sax/expatreader.py",
line 216, in start_element
def start_element(self, name, attrs):
File "/usr/local/lib/python2.2/profile.py", line 214, in
trace_dispatch_i
if self.dispatch[event](self, frame,t):
File "/usr/local/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',
('/usr/local/lib/python2.2/xml/sax/expatreader.py', 132,
'feed'), <frame object at 0x81a880c>, <frame object at
0x81a840c>, <frame object at 0x81bb60c>, <frame object at
0x81a8a0c>)
andrewl commented on Jul 2, 2002
andrewlmannequin
Mannequin
More actions
Logged In: YES
user_id=28733
The xmltest.py program follows since I appear to be too
stupid to figure out how to attach a file to a bug report on
SourceForge.
-a
#!/usr/bin/env python
importxml.sax
testxml = \
"""
<html />
"""
classContentHandler(xml.sax.ContentHandler):
""" Handle callbacks from the SAX XML parser. """def__init__(self):
passdefstartElement(self, name, attrs):
print"start element"defendElement(self, name):
print"end element"defmain():
chand=ContentHandler()
xml.sax.parseString(testxml, chand)
if__name__=="__main__":
main()
loewis commented on Jul 2, 2002
loewismannequin
Mannequin
More actions
Logged In: YES
user_id=21627
Attached is a patch that fixes the problem.
andrewl commented on Aug 1, 2002
andrewlmannequin
Mannequin
More actions
Logged In: YES
user_id=28733
I took a quick look in the browsable CVS repository, and the
diff to expat.c doesn't seem to be committed. Is there
something further that I need to do so that this bug can get
closed?
-a
loewis commented on Aug 1, 2002
loewismannequin
Mannequin
More actions
Logged In: YES
user_id=21627
Confirming that the patch solves the problem for you would help.
Activity
ainsinga commentedon Mar 25, 2002
I'm getting a 'bad call' assertion error when using the
profiler when parsing XML. (It works ok without the
profiler, and if I don't call SAXparser.parse it
doesn't happen.)
# t4crash.py by Aron K. Insinga ([email protected])
25-Mar-2002
ainsinga commentedon Mar 25, 2002
Logged In: YES
user_id=496408
attached is the sample program (which ought to have
indenting preserved!)
tim-one commentedon Mar 25, 2002
Logged In: YES
user_id=31435
Assigned to Fred.
loewis commentedon Mar 27, 2002
Logged In: YES
user_id=21627
I can't reproduce the crash, with 2.3a0.
loewis commentedon Jul 1, 2002
Logged In: YES
user_id=21627
I can't reproduce it with the Python 2.2 that ships with
SuSE 8.0, either.
tim-one commentedon Jul 1, 2002
Logged In: YES
user_id=31435
I reproduced this with current CVS Python on Windows;
see attached traceback.txt, which shows a screen dump of
the offending <wink> interactive session.
andrewl commentedon Jul 1, 2002
Logged In: YES
user_id=28733
There is another filing on this problem at:
http://mail.python.org/pipermail/xml-sig/2002-April/007632.html
Also, I reproduced this on another FreeBSD box today as
well.
andrewl@taz:andrewl$ python
Python 2.2.1 (#1, May 27 2002, 16:42:22)
[GCC 2.95.3 20010315 (release) [FreeBSD]] on freebsd4
-a
andrewl commentedon Jul 2, 2002
Logged In: YES
user_id=28733
Here is a session log for a much more self-contained
regression file (xmltest.py):
andrewl commentedon Jul 2, 2002
Logged In: YES
user_id=28733
The xmltest.py program follows since I appear to be too
stupid to figure out how to attach a file to a bug report on
SourceForge.
-a
#!/usr/bin/env python
testxml = \
"""
<html />
"""
loewis commentedon Jul 2, 2002
Logged In: YES
user_id=21627
Attached is a patch that fixes the problem.
andrewl commentedon Aug 1, 2002
Logged In: YES
user_id=28733
I took a quick look in the browsable CVS repository, and the
diff to expat.c doesn't seem to be committed. Is there
something further that I need to do so that this bug can get
closed?
-a
loewis commentedon Aug 1, 2002
Logged In: YES
user_id=21627
Confirming that the patch solves the problem for you would help.
gvanrossum commentedon Aug 2, 2002
Logged In: YES
user_id=6380
It solves the isolated test case submitted by Andrew P.
Lentvorski to python-dev on July 1, so I propose to check
this in.
andrewl commentedon Aug 2, 2002
Logged In: YES
user_id=28733
I didn't realize you were waiting for confirmation from me
directly. Preliminary runs look like the problem is fixed.
Please commit the patch and mark this bug as closed.
loewis commentedon Aug 4, 2002
Logged In: YES
user_id=21627
Committed as pyexpat.c 2.72 and 2.57.6.1.