CSSSelector infinity loop/memory leak

Bug #401630 reported by STX Next
6
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.2.2-py2.4-linux-x86_64
 * libxml2 2.6.32
 * libxslt 1.1.24

2. CentOS 4.7
 * python 2.5.4
 * lxml-2.2.2-py2.5-linux-i686
 * libxml2 2.6.32
 * libxslt 1.1.24

Steps to reproduce:
>>> from lxml.cssselect import CSSSelector
>>> CSSSelector("attributes(href)/html/body/a")
(press ctrl+c or python will 'eat' all your swap and everything will be terrible slow)

Revision history for this message
scoder (scoder) wrote :

I can reproduce this. Seems to be a bug in the CSS parser.

Changed in lxml:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
scoder (scoder) wrote :
Changed in lxml:
assignee: nobody → Stefan Behnel (scoder)
status: Confirmed → Fix Committed
Revision history for this message
scoder (scoder) wrote :

fix released in 2.2.3

Changed in lxml:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.