jahanzaibbahadur / phpquery

Automatically exported from code.google.com/p/phpquery
0 stars 0 forks source link

Memory issues #38

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. using somthing like that
<php>$section_tableau_ligne_element->find('select[name="onglet[]"]
option[value='.$section['onglet'].']')->is('.onglet_desactive')</php>

What is the expected output? What do you see instead?
Normal process. Instead of that I have on error : "Fatal error: Allowed
memory size of 134217728 bytes exhausted (tried to allocate 12 bytes)"

What version of the product are you using? On what operating system?
r56

Please provide any additional information below.

Original issue reported on code.google.com by nicolas....@gmail.com on 18 Sep 2008 at 9:15

GoogleCodeExporter commented 9 years ago
It's on this line the script is timed out :
<php>$section_tableau_ligne_element->find('select[name="onglet[]"]:has(option[va
lue='.$section['onglet'].'])').addClass('onglet_desactive');</php>

The selector text is : "select[name="onglet[]"]:has(option[value=12])"

Original comment by nicolas....@gmail.com on 18 Sep 2008 at 9:18

GoogleCodeExporter commented 9 years ago

Original comment by tobiasz....@gmail.com on 18 Sep 2008 at 9:31

GoogleCodeExporter commented 9 years ago
Can't reproduce it, brackets are fine, selector passes also just fine. Can you 
post a
line number of fatal error ?

Original comment by tobiasz....@gmail.com on 18 Sep 2008 at 9:43

GoogleCodeExporter commented 9 years ago
The error occurs on the line number of phpQuery file.

I think it's not the attribute with bracket the problem.
Cause I use it in other place, and it work well.

The real problem seems to be the ":has()" selector.
Perhaps the Xpath is so complicated then?

Original comment by nicolas....@gmail.com on 18 Sep 2008 at 10:26

GoogleCodeExporter commented 9 years ago
line 3353 ;)

Original comment by nicolas....@gmail.com on 18 Sep 2008 at 10:26

GoogleCodeExporter commented 9 years ago
I need more information to reproduce this issue. Full problematic source code 
and
HTML may be needed, but there are couple of hints you can give before:
1. is select element detached from DOM (do it has parent) ?
2. if yes, how many parents ?
3. what operations has been done prior to problematic code ?
4. how many nodes are present in document ? pq('*')->size() + all detached
5. how many documents are created in problematic script ?
6. if you remove :has pseudoclass, does the problem occures ?
7. can you supply stack trace ? eg xdebug extension dumps it
8. add `phpQuery::$debug = true;` on beggining of the script, then send me 
output by
@ or place on web, because it will be long...

Original comment by tobiasz....@gmail.com on 18 Sep 2008 at 10:58

GoogleCodeExporter commented 9 years ago
Fixed in r110 :)))

This was NASTY bug which could affect almost everyone, so big thx for 
cooperation in
finding it out !

Problem was manipulating on nodes which one of parents were detached...

Original comment by tobiasz....@gmail.com on 22 Sep 2008 at 2:37