A document makes memory bomb out of lxml (nondeterministical, but reproducable)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libxml2 |
Confirmed
|
Medium
|
|||
lxml |
Fix Released
|
Critical
|
Unassigned |
Bug Description
The script below and attached problematic html basically make sure that the program bombs by taking all available memory. Pretty nasty since the system becomes unresponsive.
Usually happens at a few hundred iterations of the loop. If it doesn't freeze the first time you run it, try a few more times. To make it even stranger, the problem does not happen if that read() is pushed out of the loop.
reproduced on two different systems:
>>> print("%-20s: %s" % ('Python', sys.version_info))
Python : sys.version_
>>> print("%-20s: %s" % ('lxml.etree', etree.LXML_
lxml.etree : (3, 2, 3, 0)
>>> print("%-20s: %s" % ('libxml used', etree.LIBXML_
libxml used : (2, 7, 8)
>>> print("%-20s: %s" % ('libxml compiled', etree.LIBXML_
libxml compiled : (2, 7, 8)
>>> print("%-20s: %s" % ('libxslt used', etree.LIBXSLT_
libxslt used : (1, 1, 26)
>>> print("%-20s: %s" % ('libxslt compiled', etree.LIBXSLT_
libxslt compiled : (1, 1, 26)
AND:
>>> print("%-20s: %s" % ('Python', sys.version_info))
Python : sys.version_
>>> print("%-20s: %s" % ('lxml.etree', etree.LXML_
lxml.etree : (3, 2, 3, 0)
>>> print("%-20s: %s" % ('libxml used', etree.LIBXML_
libxml used : (2, 8, 0)
>>> print("%-20s: %s" % ('libxml compiled', etree.LIBXML_
libxml compiled : (2, 8, 0)
>>> print("%-20s: %s" % ('libxslt used', etree.LIBXSLT_
libxslt used : (1, 1, 26)
>>> print("%-20s: %s" % ('libxslt compiled', etree.LIBXSLT_
libxslt compiled : (1, 1, 26)
>>> ## -----
...
Test case to reproduce it:
#!/usr/bin/env python
import lxml.html
i = 0
while True:
i += 1
page_html = open("problem.
a = lxml.html.
print i
Changed in libxml2: | |
importance: | Unknown → Medium |
status: | Unknown → New |
Changed in libxml2: | |
status: | New → Confirmed |
Since this is a simple reproducible test-case, should I resubmit the test case in that originak bug #948627 ?