gb.xml.html: MatchFilter() causes infinite loop

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

gb.xml.html: MatchFilter() causes infinite loop

Tobias Boege-2
Hi Adrien,

attached is a project with a simple HTML file which causes XmlElement's
MatchFilter() method to enter an infinite loop. The project code tests
of a given node whether it matches the ".title" selector. To trigger the
infinite loop, the node apparently must have a "class" attribute such as

  class="title nowrap"

Since this is my last week of holidays, I thought I'd have some fun and
hunt the bug myself. It was in element.cpp:XMLElement_AttributeContains().
Because I didn't understand your string search code there, I rewrote it
from scratch. But I don't have many gb.xml projects lying around to test
it. It fixes the infinite loop in my current project, though, and delivers
the expected results. I will commit the changes to trunk now and would like
you to confirm that it doesn't break things elsewhere.

Regards,
Tobi

--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

------------------------------------------------------------------------------

_______________________________________________
Gambas-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-devel

xml-matchfilter-infinite-loop-0.0.1.tar.gz (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: gb.xml.html: MatchFilter() causes infinite loop

Adrien Prokopowicz-2
Le Mon, 05 Oct 2015 17:39:30 +0200, Tobias Boege <[hidden email]> a  
écrit:

> Hi Adrien,
>
> attached is a project with a simple HTML file which causes XmlElement's
> MatchFilter() method to enter an infinite loop. The project code tests
> of a given node whether it matches the ".title" selector. To trigger the
> infinite loop, the node apparently must have a "class" attribute such as
>
>   class="title nowrap"
>
> Since this is my last week of holidays, I thought I'd have some fun and
> hunt the bug myself. It was in  
> element.cpp:XMLElement_AttributeContains().
> Because I didn't understand your string search code there, I rewrote it
> from scratch. But I don't have many gb.xml projects lying around to test
> it. It fixes the infinite loop in my current project, though, and  
> delivers
> the expected results. I will commit the changes to trunk now and would  
> like
> you to confirm that it doesn't break things elsewhere.
>
> Regards,
> Tobi
>

Hi Tobias,

First, sorry for the (very) late reply. As I said in another thread, the
past few months have been very tough for me.

I took a look at your code, and it works for my other projects.

Thanks you for fixing this. :)

Regards,
--
Adrien Prokopowicz

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Gambas-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-devel