CSSSelector infinity loop/memory leak
Bug #401630 reported by
STX Next
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
Fix Released
|
High
|
scoder |
Bug Description
For some bad selectors CSSSelector don't raise AssertionError but go to infinity loop. In this loop it consume all available memory.
Tested in two different environments (in both this error occurs):
1. Ubuntu 9.04
* python 2.4.6
* lxml-2.
* libxml2 2.6.32
* libxslt 1.1.24
2. CentOS 4.7
* python 2.5.4
* lxml-2.
* libxml2 2.6.32
* libxslt 1.1.24
Steps to reproduce:
>>> from lxml.cssselect import CSSSelector
>>> CSSSelector(
(press ctrl+c or python will 'eat' all your swap and everything will be terrible slow)
To post a comment you must log in.
I can reproduce this. Seems to be a bug in the CSS parser.